[libclc] 135/291: Add files forgotten in the previous commit
Andreas Beckmann
anbe at moszumanska.debian.org
Tue Sep 8 10:53:42 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 956f5b8303c1d3dd535b2c6e162a19e1ead1b342
Author: Jeroen Ketema <j.ketema at imperial.ac.uk>
Date: Fri Jun 13 12:33:40 2014 +0000
Add files forgotten in the previous commit
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@210896 91177308-0d34-0410-b5e6-96231b3b80d8
---
generic/lib/math/exp.cl | 8 ++++++++
generic/lib/math/exp.inc | 10 ++++++++++
2 files changed, 18 insertions(+)
diff --git a/generic/lib/math/exp.cl b/generic/lib/math/exp.cl
new file mode 100644
index 0000000..dbf4a93
--- /dev/null
+++ b/generic/lib/math/exp.cl
@@ -0,0 +1,8 @@
+#include <clc/clc.h>
+
+#ifdef cl_khr_fp64
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+#endif
+
+#define __CLC_BODY <exp.inc>
+#include <clc/math/gentype.inc>
diff --git a/generic/lib/math/exp.inc b/generic/lib/math/exp.inc
new file mode 100644
index 0000000..525fb59
--- /dev/null
+++ b/generic/lib/math/exp.inc
@@ -0,0 +1,10 @@
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE exp(__CLC_GENTYPE val) {
+ // exp(x) = exp2(x * log2(e))
+#if __CLC_FPSIZE == 32
+ return exp2(val * M_LOG2E_F);
+#elif __CLC_FPSIZE == 64
+ return exp2(val * M_LOG2E);
+#else
+#error unknown _CLC_FPSIZE
+#endif
+}
--
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