[libclc] r210896 - Add files forgotten in the previous commit
Jeroen Ketema
j.ketema at imperial.ac.uk
Fri Jun 13 05:33:40 PDT 2014
Author: jketema
Date: Fri Jun 13 07:33:40 2014
New Revision: 210896
URL: http://llvm.org/viewvc/llvm-project?rev=210896&view=rev
Log:
Add files forgotten in the previous commit
Added:
libclc/trunk/generic/lib/math/exp.cl
libclc/trunk/generic/lib/math/exp.inc
Added: libclc/trunk/generic/lib/math/exp.cl
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/exp.cl?rev=210896&view=auto
==============================================================================
--- libclc/trunk/generic/lib/math/exp.cl (added)
+++ libclc/trunk/generic/lib/math/exp.cl Fri Jun 13 07:33:40 2014
@@ -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>
Added: libclc/trunk/generic/lib/math/exp.inc
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/exp.inc?rev=210896&view=auto
==============================================================================
--- libclc/trunk/generic/lib/math/exp.inc (added)
+++ libclc/trunk/generic/lib/math/exp.inc Fri Jun 13 07:33:40 2014
@@ -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
+}
More information about the cfe-commits
mailing list