[Libclc-dev] [PATCH 03/11] ceil: Remove llvm intrinsic from the header.
Jan Vesely via Libclc-dev
libclc-dev at lists.llvm.org
Tue Mar 12 00:56:54 PDT 2019
Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
---
generic/include/clc/math/ceil.h | 11 ++++++-----
generic/lib/SOURCES | 1 +
generic/lib/math/ceil.cl | 11 +++++++++++
3 files changed, 18 insertions(+), 5 deletions(-)
create mode 100644 generic/lib/math/ceil.cl
diff --git a/generic/include/clc/math/ceil.h b/generic/include/clc/math/ceil.h
index 5b40abf..b444c48 100644
--- a/generic/include/clc/math/ceil.h
+++ b/generic/include/clc/math/ceil.h
@@ -1,6 +1,7 @@
-#undef ceil
-#define ceil __clc_ceil
+#define __CLC_BODY <clc/math/unary_decl.inc>
+#define __CLC_FUNCTION ceil
-#define __CLC_FUNCTION __clc_ceil
-#define __CLC_INTRINSIC "llvm.ceil"
-#include <clc/math/unary_intrin.inc>
+#include <clc/math/gentype.inc>
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION
diff --git a/generic/lib/SOURCES b/generic/lib/SOURCES
index 788aee6..03a0479 100644
--- a/generic/lib/SOURCES
+++ b/generic/lib/SOURCES
@@ -89,6 +89,7 @@ math/atan2pi.cl
math/atanh.cl
math/atanpi.cl
math/cbrt.cl
+math/ceil.cl
math/copysign.cl
math/cos.cl
math/cosh.cl
diff --git a/generic/lib/math/ceil.cl b/generic/lib/math/ceil.cl
new file mode 100644
index 0000000..3402f6f
--- /dev/null
+++ b/generic/lib/math/ceil.cl
@@ -0,0 +1,11 @@
+#include <clc/clc.h>
+#include "../clcmacro.h"
+
+// Map the llvm intrinsic to an OpenCL function.
+#define __CLC_FUNCTION __clc_ceil
+#define __CLC_INTRINSIC "llvm.ceil"
+#include <clc/math/unary_intrin.inc>
+
+#undef __CLC_FUNCTION
+#define __CLC_FUNCTION ceil
+#include "unary_builtin.inc"
--
2.19.2
More information about the Libclc-dev
mailing list