[libclc] 12/79: native_tan: Switch implementation to use native_sin/native_cos
Andreas Boll
aboll-guest at moszumanska.debian.org
Mon Mar 19 16:50:55 UTC 2018
This is an automated email from the git hooks/post-receive script.
aboll-guest pushed a commit to branch master
in repository libclc.
commit 928e00cd150e54694a7bf598a3730b8d8a2a0512
Author: Jan Vesely <jan.vesely at rutgers.edu>
Date: Mon Nov 13 18:28:48 2017 +0000
native_tan: Switch implementation to use native_sin/native_cos
Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@318064 91177308-0d34-0410-b5e6-96231b3b80d8
---
generic/include/clc/math/native_tan.h | 17 ++++++++---------
generic/lib/SOURCES | 1 +
generic/lib/math/native_tan.cl | 5 +++++
generic/lib/math/native_tan.inc | 3 +++
4 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/generic/include/clc/math/native_tan.h b/generic/include/clc/math/native_tan.h
index cb44538..317b0e5 100644
--- a/generic/include/clc/math/native_tan.h
+++ b/generic/include/clc/math/native_tan.h
@@ -1,10 +1,9 @@
-//===-- generic/include/clc/math/native_tan.h -----------------------------===//
+#define __CLC_BODY <clc/math/unary_decl.inc>
+#define __CLC_FUNCTION native_tan
+#define __FLOAT_ONLY
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under both the University of Illinois Open Source
-// License and the MIT license. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-#define native_tan tan
+#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 2b31465..b5e8c92 100644
--- a/generic/lib/SOURCES
+++ b/generic/lib/SOURCES
@@ -128,6 +128,7 @@ math/native_log10.cl
math/native_log2.cl
math/native_sin.cl
math/native_sqrt.cl
+math/native_tan.cl
math/tables.cl
math/clc_nextafter.cl
math/nextafter.cl
diff --git a/generic/lib/math/native_tan.cl b/generic/lib/math/native_tan.cl
new file mode 100644
index 0000000..33f6d5f
--- /dev/null
+++ b/generic/lib/math/native_tan.cl
@@ -0,0 +1,5 @@
+#include <clc/clc.h>
+
+#define __CLC_BODY <native_tan.inc>
+#define __FLOAT_ONLY
+#include <clc/math/gentype.inc>
diff --git a/generic/lib/math/native_tan.inc b/generic/lib/math/native_tan.inc
new file mode 100644
index 0000000..61a8517
--- /dev/null
+++ b/generic/lib/math/native_tan.inc
@@ -0,0 +1,3 @@
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE native_tan(__CLC_GENTYPE val) {
+ return native_sin(val) / native_cos(val);
+}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/libclc.git
More information about the Pkg-opencl-commits
mailing list