[libclc] 122/291: Add sincos

Andreas Beckmann anbe at moszumanska.debian.org
Tue Sep 8 10:53:40 UTC 2015


This is an automated email from the git hooks/post-receive script.

anbe pushed a commit to branch master
in repository libclc.

commit 1e278a7b0476ff8e9a5a48dec30bfaca249c7590
Author: Tom Stellard <thomas.stellard at amd.com>
Date:   Fri Mar 21 16:22:01 2014 +0000

    Add sincos
    
    Patch by: Jeroen Ketema
    
    Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
    
    git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@204478 91177308-0d34-0410-b5e6-96231b3b80d8
---
 generic/include/clc/clc.h           |  1 +
 generic/include/clc/math/sincos.h   |  2 ++
 generic/include/clc/math/sincos.inc |  8 ++++++++
 generic/lib/SOURCES                 |  1 +
 generic/lib/math/sincos.cl          |  8 ++++++++
 generic/lib/math/sincos.inc         | 11 +++++++++++
 6 files changed, 31 insertions(+)

diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h
index 0cd6d15..f8c1853 100644
--- a/generic/include/clc/clc.h
+++ b/generic/include/clc/clc.h
@@ -50,6 +50,7 @@
 #include <clc/math/rint.h>
 #include <clc/math/round.h>
 #include <clc/math/sin.h>
+#include <clc/math/sincos.h>
 #include <clc/math/sqrt.h>
 #include <clc/math/trunc.h>
 #include <clc/math/native_cos.h>
diff --git a/generic/include/clc/math/sincos.h b/generic/include/clc/math/sincos.h
new file mode 100644
index 0000000..fbb9b55
--- /dev/null
+++ b/generic/include/clc/math/sincos.h
@@ -0,0 +1,2 @@
+#define __CLC_BODY <clc/math/sincos.inc>
+#include <clc/math/gentype.inc>
diff --git a/generic/include/clc/math/sincos.inc b/generic/include/clc/math/sincos.inc
new file mode 100644
index 0000000..444ac82
--- /dev/null
+++ b/generic/include/clc/math/sincos.inc
@@ -0,0 +1,8 @@
+#define __CLC_DECLARE_SINCOS(ADDRSPACE, TYPE) \
+  _CLC_OVERLOAD _CLC_DECL TYPE sincos (TYPE x, ADDRSPACE TYPE * cosval);
+
+__CLC_DECLARE_SINCOS(global, __CLC_GENTYPE)
+__CLC_DECLARE_SINCOS(local, __CLC_GENTYPE)
+__CLC_DECLARE_SINCOS(private, __CLC_GENTYPE)
+
+#undef __CLC_DECLARE_SINCOS
diff --git a/generic/lib/SOURCES b/generic/lib/SOURCES
index aa14165..6ccdf48 100644
--- a/generic/lib/SOURCES
+++ b/generic/lib/SOURCES
@@ -33,6 +33,7 @@ math/hypot.cl
 math/mad.cl
 math/clc_nextafter.cl
 math/nextafter.cl
+math/sincos.cl
 relational/any.cl
 relational/isnan.cl
 shared/clamp.cl
diff --git a/generic/lib/math/sincos.cl b/generic/lib/math/sincos.cl
new file mode 100644
index 0000000..eace5ad
--- /dev/null
+++ b/generic/lib/math/sincos.cl
@@ -0,0 +1,8 @@
+#include <clc/clc.h>
+
+#ifdef cl_khr_fp64
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+#endif
+
+#define __CLC_BODY <sincos.inc>
+#include <clc/math/gentype.inc>
diff --git a/generic/lib/math/sincos.inc b/generic/lib/math/sincos.inc
new file mode 100644
index 0000000..e97f0f9
--- /dev/null
+++ b/generic/lib/math/sincos.inc
@@ -0,0 +1,11 @@
+#define __CLC_DECLARE_SINCOS(ADDRSPACE, TYPE) \
+  _CLC_OVERLOAD _CLC_DEF TYPE sincos (TYPE x, ADDRSPACE TYPE * cosval) { \
+    *cosval = cos(x); \
+    return sin(x); \
+  }
+
+__CLC_DECLARE_SINCOS(global, __CLC_GENTYPE)
+__CLC_DECLARE_SINCOS(local, __CLC_GENTYPE)
+__CLC_DECLARE_SINCOS(private, __CLC_GENTYPE)
+
+#undef __CLC_DECLARE_SINCOS

-- 
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