[Libclc-dev] [PATCH 12/14] half_tan: Implement using native_tan

Jan Vesely via Libclc-dev libclc-dev at lists.llvm.org
Fri Nov 3 18:32:37 PDT 2017


Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
---
 generic/include/clc/clc.h           | 1 +
 generic/include/clc/math/half_tan.h | 9 +++++++++
 generic/lib/SOURCES                 | 1 +
 generic/lib/math/half_tan.cl        | 6 ++++++
 4 files changed, 17 insertions(+)
 create mode 100644 generic/include/clc/math/half_tan.h
 create mode 100644 generic/lib/math/half_tan.cl

diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h
index 5aa1c94..029d89b 100644
--- a/generic/include/clc/clc.h
+++ b/generic/include/clc/clc.h
@@ -81,6 +81,7 @@
 #include <clc/math/half_rsqrt.h>
 #include <clc/math/half_sin.h>
 #include <clc/math/half_sqrt.h>
+#include <clc/math/half_tan.h>
 #include <clc/math/hypot.h>
 #include <clc/math/ilogb.h>
 #include <clc/math/ldexp.h>
diff --git a/generic/include/clc/math/half_tan.h b/generic/include/clc/math/half_tan.h
new file mode 100644
index 0000000..b78d86f
--- /dev/null
+++ b/generic/include/clc/math/half_tan.h
@@ -0,0 +1,9 @@
+#define __CLC_BODY <clc/math/unary_decl.inc>
+#define __CLC_FUNCTION half_tan
+#define __FLOAT_ONLY
+
+#include <clc/math/gentype.inc>
+
+#undef __FLOAT_ONLY
+#undef __CLC_BODY
+#undef __CLC_FUNCTION
diff --git a/generic/lib/SOURCES b/generic/lib/SOURCES
index 0ee2dd0..e63b439 100644
--- a/generic/lib/SOURCES
+++ b/generic/lib/SOURCES
@@ -115,6 +115,7 @@ math/half_recip.cl
 math/half_rsqrt.cl
 math/half_sin.cl
 math/half_sqrt.cl
+math/half_tan.cl
 math/hypot.cl
 math/ilogb.cl
 math/clc_ldexp.cl
diff --git a/generic/lib/math/half_tan.cl b/generic/lib/math/half_tan.cl
new file mode 100644
index 0000000..9bb66fd
--- /dev/null
+++ b/generic/lib/math/half_tan.cl
@@ -0,0 +1,6 @@
+#include <clc/clc.h>
+
+#define __CLC_FUNC tan
+#define __CLC_BODY <half_native_unary.inc>
+#define __FLOAT_ONLY
+#include <clc/math/gentype.inc>
-- 
2.13.6



More information about the Libclc-dev mailing list