-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libclc] Move 'half' builtins to CLC library #139563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There are no changes to the generated bytecode.
@llvm/pr-subscribers-backend-amdgpu Author: Fraser Cormack (frasercrmck) ChangesThere are no changes to the generated bytecode. Patch is 43.97 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/139563.diff 60 Files Affected:
diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index 50ddfc3930cd3..b0e7aac6f8f36 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -20,7 +20,6 @@ include( GNUInstallDirs )
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
amdgcn-amdhsa/lib/SOURCES;
amdgcn/lib/SOURCES;
- amdgpu/lib/SOURCES;
clspv/lib/SOURCES;
generic/lib/SOURCES;
ptx-nvidiacl/lib/SOURCES;
diff --git a/libclc/amdgpu/lib/SOURCES b/libclc/amdgpu/lib/SOURCES
deleted file mode 100644
index ab5da40711aa4..0000000000000
--- a/libclc/amdgpu/lib/SOURCES
+++ /dev/null
@@ -1,9 +0,0 @@
-math/half_exp.cl
-math/half_exp10.cl
-math/half_exp2.cl
-math/half_log.cl
-math/half_log10.cl
-math/half_log2.cl
-math/half_recip.cl
-math/half_rsqrt.cl
-math/half_sqrt.cl
diff --git a/libclc/clc/include/clc/math/clc_half_cos.h b/libclc/clc/include/clc/math/clc_half_cos.h
new file mode 100644
index 0000000000000..d0efc45793af9
--- /dev/null
+++ b/libclc/clc/include/clc/math/clc_half_cos.h
@@ -0,0 +1,21 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef __CLC_MATH_CLC_HALF_COS_H__
+#define __CLC_MATH_CLC_HALF_COS_H__
+
+#define __FLOAT_ONLY
+#define __CLC_FUNCTION __clc_half_cos
+#define __CLC_BODY <clc/shared/unary_decl.inc>
+
+#include <clc/math/gentype.inc>
+
+#undef __CLC_FUNCTION
+#undef __FLOAT_ONLY
+
+#endif // __CLC_MATH_CLC_HALF_COS_H__
diff --git a/libclc/clc/include/clc/math/clc_half_divide.h b/libclc/clc/include/clc/math/clc_half_divide.h
new file mode 100644
index 0000000000000..5d1e7b9e33e39
--- /dev/null
+++ b/libclc/clc/include/clc/math/clc_half_divide.h
@@ -0,0 +1,21 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef __CLC_MATH_CLC_HALF_DIVIDE_H__
+#define __CLC_MATH_CLC_HALF_DIVIDE_H__
+
+#define __FLOAT_ONLY
+#define __CLC_FUNCTION __clc_half_divide
+#define __CLC_BODY <clc/shared/binary_decl.inc>
+
+#include <clc/math/gentype.inc>
+
+#undef __CLC_FUNCTION
+#undef __FLOAT_ONLY
+
+#endif // __CLC_MATH_CLC_HALF_DIVIDE_H__
diff --git a/libclc/clc/include/clc/math/clc_half_exp.h b/libclc/clc/include/clc/math/clc_half_exp.h
new file mode 100644
index 0000000000000..e95f3d42085c8
--- /dev/null
+++ b/libclc/clc/include/clc/math/clc_half_exp.h
@@ -0,0 +1,21 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef __CLC_MATH_CLC_HALF_EXP_H__
+#define __CLC_MATH_CLC_HALF_EXP_H__
+
+#define __FLOAT_ONLY
+#define __CLC_FUNCTION __clc_half_exp
+#define __CLC_BODY <clc/shared/unary_decl.inc>
+
+#include <clc/math/gentype.inc>
+
+#undef __CLC_FUNCTION
+#undef __FLOAT_ONLY
+
+#endif // __CLC_MATH_CLC_HALF_EXP_H__
diff --git a/libclc/clc/include/clc/math/clc_half_exp10.h b/libclc/clc/include/clc/math/clc_half_exp10.h
new file mode 100644
index 0000000000000..e4cce6e63bf7a
--- /dev/null
+++ b/libclc/clc/include/clc/math/clc_half_exp10.h
@@ -0,0 +1,21 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef __CLC_MATH_CLC_HALF_EXP10_H__
+#define __CLC_MATH_CLC_HALF_EXP10_H__
+
+#define __FLOAT_ONLY
+#define __CLC_FUNCTION __clc_half_exp10
+#define __CLC_BODY <clc/shared/unary_decl.inc>
+
+#include <clc/math/gentype.inc>
+
+#undef __CLC_FUNCTION
+#undef __FLOAT_ONLY
+
+#endif // __CLC_MATH_CLC_HALF_EXP10_H__
diff --git a/libclc/clc/include/clc/math/clc_half_exp2.h b/libclc/clc/include/clc/math/clc_half_exp2.h
new file mode 100644
index 0000000000000..6fc99735f0928
--- /dev/null
+++ b/libclc/clc/include/clc/math/clc_half_exp2.h
@@ -0,0 +1,21 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef __CLC_MATH_CLC_HALF_EXP2_H__
+#define __CLC_MATH_CLC_HALF_EXP2_H__
+
+#define __FLOAT_ONLY
+#define __CLC_FUNCTION __clc_half_exp2
+#define __CLC_BODY <clc/shared/unary_decl.inc>
+
+#include <clc/math/gentype.inc>
+
+#undef __CLC_FUNCTION
+#undef __FLOAT_ONLY
+
+#endif // __CLC_MATH_CLC_HALF_EXP2_H__
diff --git a/libclc/clc/include/clc/math/clc_half_log.h b/libclc/clc/include/clc/math/clc_half_log.h
new file mode 100644
index 0000000000000..e44e686499663
--- /dev/null
+++ b/libclc/clc/include/clc/math/clc_half_log.h
@@ -0,0 +1,21 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef __CLC_MATH_CLC_HALF_LOG_H__
+#define __CLC_MATH_CLC_HALF_LOG_H__
+
+#define __FLOAT_ONLY
+#define __CLC_FUNCTION __clc_half_log
+#define __CLC_BODY <clc/shared/unary_decl.inc>
+
+#include <clc/math/gentype.inc>
+
+#undef __CLC_FUNCTION
+#undef __FLOAT_ONLY
+
+#endif // __CLC_MATH_CLC_HALF_LOG_H__
diff --git a/libclc/clc/include/clc/math/clc_half_log10.h b/libclc/clc/include/clc/math/clc_half_log10.h
new file mode 100644
index 0000000000000..23e0ba116c728
--- /dev/null
+++ b/libclc/clc/include/clc/math/clc_half_log10.h
@@ -0,0 +1,21 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef __CLC_MATH_CLC_HALF_LOG10_H__
+#define __CLC_MATH_CLC_HALF_LOG10_H__
+
+#define __FLOAT_ONLY
+#define __CLC_FUNCTION __clc_half_log10
+#define __CLC_BODY <clc/shared/unary_decl.inc>
+
+#include <clc/math/gentype.inc>
+
+#undef __CLC_FUNCTION
+#undef __FLOAT_ONLY
+
+#endif // __CLC_MATH_CLC_HALF_LOG10_H__
diff --git a/libclc/clc/include/clc/math/clc_half_log2.h b/libclc/clc/include/clc/math/clc_half_log2.h
new file mode 100644
index 0000000000000..8ea2439eb3db6
--- /dev/null
+++ b/libclc/clc/include/clc/math/clc_half_log2.h
@@ -0,0 +1,21 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef __CLC_MATH_CLC_HALF_LOG2_H__
+#define __CLC_MATH_CLC_HALF_LOG2_H__
+
+#define __FLOAT_ONLY
+#define __CLC_FUNCTION __clc_half_log2
+#define __CLC_BODY <clc/shared/unary_decl.inc>
+
+#include <clc/math/gentype.inc>
+
+#undef __CLC_FUNCTION
+#undef __FLOAT_ONLY
+
+#endif // __CLC_MATH_CLC_HALF_LOG2_H__
diff --git a/libclc/clc/include/clc/math/clc_half_powr.h b/libclc/clc/include/clc/math/clc_half_powr.h
new file mode 100644
index 0000000000000..252bfcd785043
--- /dev/null
+++ b/libclc/clc/include/clc/math/clc_half_powr.h
@@ -0,0 +1,21 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef __CLC_MATH_CLC_HALF_POWR_H__
+#define __CLC_MATH_CLC_HALF_POWR_H__
+
+#define __FLOAT_ONLY
+#define __CLC_FUNCTION __clc_half_powr
+#define __CLC_BODY <clc/shared/binary_decl.inc>
+
+#include <clc/math/gentype.inc>
+
+#undef __CLC_FUNCTION
+#undef __FLOAT_ONLY
+
+#endif // __CLC_MATH_CLC_HALF_POWR_H__
diff --git a/libclc/clc/include/clc/math/clc_half_recip.h b/libclc/clc/include/clc/math/clc_half_recip.h
new file mode 100644
index 0000000000000..1adb0bbe249cc
--- /dev/null
+++ b/libclc/clc/include/clc/math/clc_half_recip.h
@@ -0,0 +1,21 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef __CLC_MATH_CLC_HALF_RECIP_H__
+#define __CLC_MATH_CLC_HALF_RECIP_H__
+
+#define __FLOAT_ONLY
+#define __CLC_FUNCTION __clc_half_recip
+#define __CLC_BODY <clc/shared/unary_decl.inc>
+
+#include <clc/math/gentype.inc>
+
+#undef __CLC_FUNCTION
+#undef __FLOAT_ONLY
+
+#endif // __CLC_MATH_CLC_HALF_RECIP_H__
diff --git a/libclc/clc/include/clc/math/clc_half_rsqrt.h b/libclc/clc/include/clc/math/clc_half_rsqrt.h
new file mode 100644
index 0000000000000..6342739ed6f20
--- /dev/null
+++ b/libclc/clc/include/clc/math/clc_half_rsqrt.h
@@ -0,0 +1,21 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef __CLC_MATH_CLC_HALF_RSQRT_H__
+#define __CLC_MATH_CLC_HALF_RSQRT_H__
+
+#define __FLOAT_ONLY
+#define __CLC_FUNCTION __clc_half_rsqrt
+#define __CLC_BODY <clc/shared/unary_decl.inc>
+
+#include <clc/math/gentype.inc>
+
+#undef __CLC_FUNCTION
+#undef __FLOAT_ONLY
+
+#endif // __CLC_MATH_CLC_HALF_RSQRT_H__
diff --git a/libclc/clc/include/clc/math/clc_half_sin.h b/libclc/clc/include/clc/math/clc_half_sin.h
new file mode 100644
index 0000000000000..31378d290fecc
--- /dev/null
+++ b/libclc/clc/include/clc/math/clc_half_sin.h
@@ -0,0 +1,21 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef __CLC_MATH_CLC_HALF_SIN_H__
+#define __CLC_MATH_CLC_HALF_SIN_H__
+
+#define __FLOAT_ONLY
+#define __CLC_FUNCTION __clc_half_sin
+#define __CLC_BODY <clc/shared/unary_decl.inc>
+
+#include <clc/math/gentype.inc>
+
+#undef __CLC_FUNCTION
+#undef __FLOAT_ONLY
+
+#endif // __CLC_MATH_CLC_HALF_SIN_H__
diff --git a/libclc/clc/include/clc/math/clc_half_sqrt.h b/libclc/clc/include/clc/math/clc_half_sqrt.h
new file mode 100644
index 0000000000000..0e765fb3e7731
--- /dev/null
+++ b/libclc/clc/include/clc/math/clc_half_sqrt.h
@@ -0,0 +1,21 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef __CLC_MATH_CLC_HALF_SQRT_H__
+#define __CLC_MATH_CLC_HALF_SQRT_H__
+
+#define __FLOAT_ONLY
+#define __CLC_FUNCTION __clc_half_sqrt
+#define __CLC_BODY <clc/shared/unary_decl.inc>
+
+#include <clc/math/gentype.inc>
+
+#undef __CLC_FUNCTION
+#undef __FLOAT_ONLY
+
+#endif // __CLC_MATH_CLC_HALF_SQRT_H__
diff --git a/libclc/clc/include/clc/math/clc_half_tan.h b/libclc/clc/include/clc/math/clc_half_tan.h
new file mode 100644
index 0000000000000..6c890a952522c
--- /dev/null
+++ b/libclc/clc/include/clc/math/clc_half_tan.h
@@ -0,0 +1,21 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef __CLC_MATH_CLC_HALF_TAN_H__
+#define __CLC_MATH_CLC_HALF_TAN_H__
+
+#define __FLOAT_ONLY
+#define __CLC_FUNCTION __clc_half_tan
+#define __CLC_BODY <clc/shared/unary_decl.inc>
+
+#include <clc/math/gentype.inc>
+
+#undef __CLC_FUNCTION
+#undef __FLOAT_ONLY
+
+#endif // __CLC_MATH_CLC_HALF_TAN_H__
diff --git a/libclc/clc/lib/amdgpu/SOURCES b/libclc/clc/lib/amdgpu/SOURCES
index 31e07b608c4cc..83b13bad9a4f0 100644
--- a/libclc/clc/lib/amdgpu/SOURCES
+++ b/libclc/clc/lib/amdgpu/SOURCES
@@ -1,3 +1,12 @@
+math/clc_half_exp10.cl
+math/clc_half_exp2.cl
+math/clc_half_exp.cl
+math/clc_half_log10.cl
+math/clc_half_log2.cl
+math/clc_half_log.cl
+math/clc_half_recip.cl
+math/clc_half_rsqrt.cl
+math/clc_half_sqrt.cl
math/clc_native_exp2.cl
math/clc_native_exp.cl
math/clc_native_log10.cl
diff --git a/libclc/amdgpu/lib/math/half_exp.cl b/libclc/clc/lib/amdgpu/math/clc_half_exp.cl
similarity index 84%
rename from libclc/amdgpu/lib/math/half_exp.cl
rename to libclc/clc/lib/amdgpu/math/clc_half_exp.cl
index 4cc2b36bb132f..97ca412339016 100644
--- a/libclc/amdgpu/lib/math/half_exp.cl
+++ b/libclc/clc/lib/amdgpu/math/clc_half_exp.cl
@@ -6,9 +6,9 @@
//
//===----------------------------------------------------------------------===//
-#include <clc/clc.h>
+#include <clc/math/clc_native_exp.h>
#define __CLC_FUNC exp
#define __FLOAT_ONLY
-#define __CLC_BODY <half_native_unary.inc>
+#define __CLC_BODY <clc_half_native_unary.inc>
#include <clc/math/gentype.inc>
diff --git a/libclc/amdgpu/lib/math/half_exp10.cl b/libclc/clc/lib/amdgpu/math/clc_half_exp10.cl
similarity index 83%
rename from libclc/amdgpu/lib/math/half_exp10.cl
rename to libclc/clc/lib/amdgpu/math/clc_half_exp10.cl
index 3bcdd2455ef31..b92eb76561765 100644
--- a/libclc/amdgpu/lib/math/half_exp10.cl
+++ b/libclc/clc/lib/amdgpu/math/clc_half_exp10.cl
@@ -6,9 +6,9 @@
//
//===----------------------------------------------------------------------===//
-#include <clc/clc.h>
+#include <clc/math/clc_native_exp10.h>
#define __CLC_FUNC exp10
#define __FLOAT_ONLY
-#define __CLC_BODY <half_native_unary.inc>
+#define __CLC_BODY <clc_half_native_unary.inc>
#include <clc/math/gentype.inc>
diff --git a/libclc/clc/lib/amdgpu/math/clc_half_exp2.cl b/libclc/clc/lib/amdgpu/math/clc_half_exp2.cl
new file mode 100644
index 0000000000000..9750d5008986b
--- /dev/null
+++ b/libclc/clc/lib/amdgpu/math/clc_half_exp2.cl
@@ -0,0 +1,15 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include <clc/internal/clc.h>
+#include <clc/math/clc_native_exp2.h>
+
+#define __CLC_FUNC exp2
+#define __FLOAT_ONLY
+#define __CLC_BODY <clc_half_native_unary.inc>
+#include <clc/math/gentype.inc>
diff --git a/libclc/amdgpu/lib/math/half_log.cl b/libclc/clc/lib/amdgpu/math/clc_half_log.cl
similarity index 84%
rename from libclc/amdgpu/lib/math/half_log.cl
rename to libclc/clc/lib/amdgpu/math/clc_half_log.cl
index d0e924ca97207..302f901158a61 100644
--- a/libclc/amdgpu/lib/math/half_log.cl
+++ b/libclc/clc/lib/amdgpu/math/clc_half_log.cl
@@ -6,9 +6,9 @@
//
//===----------------------------------------------------------------------===//
-#include <clc/clc.h>
+#include <clc/math/clc_native_log.h>
#define __CLC_FUNC log
#define __FLOAT_ONLY
-#define __CLC_BODY <half_native_unary.inc>
+#define __CLC_BODY <clc_half_native_unary.inc>
#include <clc/math/gentype.inc>
diff --git a/libclc/amdgpu/lib/math/half_log10.cl b/libclc/clc/lib/amdgpu/math/clc_half_log10.cl
similarity index 83%
rename from libclc/amdgpu/lib/math/half_log10.cl
rename to libclc/clc/lib/amdgpu/math/clc_half_log10.cl
index 2f3b26e1084ad..a02ea064eaa7e 100644
--- a/libclc/amdgpu/lib/math/half_log10.cl
+++ b/libclc/clc/lib/amdgpu/math/clc_half_log10.cl
@@ -6,9 +6,9 @@
//
//===----------------------------------------------------------------------===//
-#include <clc/clc.h>
+#include <clc/math/clc_native_log10.h>
#define __CLC_FUNC log10
#define __FLOAT_ONLY
-#define __CLC_BODY <half_native_unary.inc>
+#define __CLC_BODY <clc_half_native_unary.inc>
#include <clc/math/gentype.inc>
diff --git a/libclc/amdgpu/lib/math/half_log2.cl b/libclc/clc/lib/amdgpu/math/clc_half_log2.cl
similarity index 84%
rename from libclc/amdgpu/lib/math/half_log2.cl
rename to libclc/clc/lib/amdgpu/math/clc_half_log2.cl
index 9b417fb474ae6..bf6dee986ab56 100644
--- a/libclc/amdgpu/lib/math/half_log2.cl
+++ b/libclc/clc/lib/amdgpu/math/clc_half_log2.cl
@@ -6,9 +6,9 @@
//
//===----------------------------------------------------------------------===//
-#include <clc/clc.h>
+#include <clc/math/clc_native_log2.h>
#define __CLC_FUNC log2
#define __FLOAT_ONLY
-#define __CLC_BODY <half_native_unary.inc>
+#define __CLC_BODY <clc_half_native_unary.inc>
#include <clc/math/gentype.inc>
diff --git a/libclc/amdgpu/lib/math/half_native_unary.inc b/libclc/clc/lib/amdgpu/math/clc_half_native_unary.inc
similarity index 64%
rename from libclc/amdgpu/lib/math/half_native_unary.inc
rename to libclc/clc/lib/amdgpu/math/clc_half_native_unary.inc
index 6ecad7eb483c0..d62343400f2c4 100644
--- a/libclc/amdgpu/lib/math/half_native_unary.inc
+++ b/libclc/clc/lib/amdgpu/math/clc_half_native_unary.inc
@@ -8,11 +8,12 @@
#include <clc/utils.h>
-#define __CLC_HALF_FUNC(x) __CLC_CONCAT(half_, x)
-#define __CLC_NATIVE_FUNC(x) __CLC_CONCAT(native_, x)
+#define __CLC_HALF_FUNC(x) __CLC_CONCAT(__clc_half_, x)
+#define __CLC_NATIVE_FUNC(x) __CLC_CONCAT(__clc_native_, x)
-_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __CLC_HALF_FUNC(__CLC_FUNC)(__CLC_GENTYPE val) {
- return __CLC_NATIVE_FUNC(__CLC_FUNC)(val);
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE
+__CLC_HALF_FUNC(__CLC_FUNC)(__CLC_GENTYPE val) {
+ return __CLC_NATIVE_FUNC(__CLC_FUNC)(val);
}
#undef __CLC_NATIVE_FUNC
diff --git a/libclc/amdgpu/lib/math/half_recip.cl b/libclc/clc/lib/amdgpu/math/clc_half_recip.cl
similarity index 83%
rename from libclc/amdgpu/lib/math/half_recip.cl
rename to libclc/clc/lib/amdgpu/math/clc_half_recip.cl
index 87d56c8fbafcb..c47efd343db13 100644
--- a/libclc/amdgpu/lib/math/half_recip.cl
+++ b/libclc/clc/lib/amdgpu/math/clc_half_recip.cl
@@ -6,9 +6,9 @@
//
//===----------------------------------------------------------------------===//
-#include <clc/clc.h>
+#include <clc/math/clc_native_recip.h>
#define __CLC_FUNC recip
#define __FLOAT_ONLY
-#define __CLC_BODY <half_native_unary.inc>
+#define __CLC_BODY <clc_half_native_unary.inc>
#include <clc/math/gentype.inc>
diff --git a/libclc/amdgpu/lib/math/half_rsqrt.cl b/libclc/clc/lib/amdgpu/math/clc_half_rsqrt.cl
similarity index 83%
rename from libclc/amdgpu/lib/math/half_rsqrt.cl
rename to libclc/clc/lib/amdgpu/math/clc_half_rsqrt.cl
index 099363a913071..c...
[truncated]
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
arsenm
approved these changes
May 12, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are no changes to the generated bytecode.