[libclc] 152/291: Add exp10

Andreas Beckmann anbe at moszumanska.debian.org
Tue Sep 8 10:53:44 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 86e401d82a61b637976851c8bdc50c4cb0428800
Author: Jeroen Ketema <j.ketema at imperial.ac.uk>
Date:   Wed Jun 25 10:06:35 2014 +0000

    Add exp10
    
    Reviewed-by: Tom Stellard <tom at stellard.net>
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@211680 91177308-0d34-0410-b5e6-96231b3b80d8
---
 generic/include/clc/clc.h               |  2 ++
 generic/include/clc/math/exp10.h        |  9 +++++++++
 generic/include/clc/math/native_exp10.h |  1 +
 generic/lib/SOURCES                     |  1 +
 generic/lib/math/exp10.cl               |  8 ++++++++
 generic/lib/math/exp10.inc              | 10 ++++++++++
 6 files changed, 31 insertions(+)

diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h
index e93a8c0..e4fbfba 100644
--- a/generic/include/clc/clc.h
+++ b/generic/include/clc/clc.h
@@ -35,6 +35,7 @@
 #include <clc/math/cos.h>
 #include <clc/math/ceil.h>
 #include <clc/math/exp.h>
+#include <clc/math/exp10.h>
 #include <clc/math/exp2.h>
 #include <clc/math/fabs.h>
 #include <clc/math/floor.h>
@@ -58,6 +59,7 @@
 #include <clc/math/native_cos.h>
 #include <clc/math/native_divide.h>
 #include <clc/math/native_exp.h>
+#include <clc/math/native_exp10.h>
 #include <clc/math/native_exp2.h>
 #include <clc/math/native_log.h>
 #include <clc/math/native_log2.h>
diff --git a/generic/include/clc/math/exp10.h b/generic/include/clc/math/exp10.h
new file mode 100644
index 0000000..a1d426a
--- /dev/null
+++ b/generic/include/clc/math/exp10.h
@@ -0,0 +1,9 @@
+#undef exp10
+
+#define __CLC_BODY <clc/math/unary_decl.inc>
+#define __CLC_FUNCTION exp10
+
+#include <clc/math/gentype.inc>
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION
diff --git a/generic/include/clc/math/native_exp10.h b/generic/include/clc/math/native_exp10.h
new file mode 100644
index 0000000..1156f58
--- /dev/null
+++ b/generic/include/clc/math/native_exp10.h
@@ -0,0 +1 @@
+#define native_exp10 exp10
diff --git a/generic/lib/SOURCES b/generic/lib/SOURCES
index 72f890b..c3d0757 100644
--- a/generic/lib/SOURCES
+++ b/generic/lib/SOURCES
@@ -28,6 +28,7 @@ integer/sub_sat_if.ll
 integer/sub_sat_impl.ll
 integer/upsample.cl
 math/exp.cl
+math/exp10.cl
 math/fmax.cl
 math/fmin.cl
 math/hypot.cl
diff --git a/generic/lib/math/exp10.cl b/generic/lib/math/exp10.cl
new file mode 100644
index 0000000..c8039cb
--- /dev/null
+++ b/generic/lib/math/exp10.cl
@@ -0,0 +1,8 @@
+#include <clc/clc.h>
+
+#ifdef cl_khr_fp64
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+#endif
+
+#define __CLC_BODY <exp10.inc>
+#include <clc/math/gentype.inc>
diff --git a/generic/lib/math/exp10.inc b/generic/lib/math/exp10.inc
new file mode 100644
index 0000000..a592c19
--- /dev/null
+++ b/generic/lib/math/exp10.inc
@@ -0,0 +1,10 @@
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE exp10(__CLC_GENTYPE val) {
+  // exp10(x) = exp2(x * log2(10))
+#if __CLC_FPSIZE == 32
+  return exp2(val * log2(10.0f));
+#elif __CLC_FPSIZE == 64
+  return exp2(val * log2(10.0));
+#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