diff options
-rwxr-xr-x | compile-test.sh | 2 | ||||
-rwxr-xr-x | configure.py | 1 | ||||
-rw-r--r-- | generic/lib/geometric/length.cl | 4 | ||||
-rw-r--r-- | generic/lib/geometric/length.inc | 2 | ||||
-rw-r--r-- | generic/lib/geometric/normalize.cl | 4 | ||||
-rw-r--r-- | generic/lib/math/mad.cl | 4 |
6 files changed, 15 insertions, 2 deletions
diff --git a/compile-test.sh b/compile-test.sh index d0f4bb4..7461811 100755 --- a/compile-test.sh +++ b/compile-test.sh @@ -1,3 +1,3 @@ #!/bin/sh -clang -ccc-host-triple nvptx--nvidiacl -Iptx-nvidiacl/include -Igeneric/include -Xclang -mlink-bitcode-file -Xclang nvptx--nvidiacl/lib/builtins.bc -include clc/clc.h -Dcl_clang_storage_class_specifiers "$@" +clang -ccc-host-triple nvptx--nvidiacl -Iptx-nvidiacl/include -Igeneric/include -Xclang -mlink-bitcode-file -Xclang nvptx--nvidiacl/lib/builtins.bc -include clc/clc.h -Dcl_clang_storage_class_specifiers -Dcl_khr_fp64 "$@" diff --git a/configure.py b/configure.py index 829ce6b..ab84a0d 100755 --- a/configure.py +++ b/configure.py @@ -93,6 +93,7 @@ for target in targets: # The rule for building a .bc file for the specified architecture using clang. clang_bc_flags = "-ccc-host-triple %s -I`dirname $in` %s " \ "-Dcl_clang_storage_class_specifiers " \ + "-Dcl_khr_fp64 " \ "-emit-llvm" % (target, clang_cl_includes) clang_bc_rule = "CLANG_CL_BC_" + target c_compiler_rule(b, clang_bc_rule, "LLVM-CC", llvm_clang, clang_bc_flags) diff --git a/generic/lib/geometric/length.cl b/generic/lib/geometric/length.cl index 957fbfd..cbe84a0 100644 --- a/generic/lib/geometric/length.cl +++ b/generic/lib/geometric/length.cl @@ -1,4 +1,8 @@ #include <clc/clc.h> +#ifdef cl_khr_fp64 +#pragma OPENCL EXTENSION cl_khr_fp64 : enable +#endif + #define BODY "length.inc" #include <clc/geometric/floatn.inc> diff --git a/generic/lib/geometric/length.inc b/generic/lib/geometric/length.inc index 66d1604..494789c 100644 --- a/generic/lib/geometric/length.inc +++ b/generic/lib/geometric/length.inc @@ -1,3 +1,3 @@ -_CLC_OVERLOAD _CLC_DEF float length(FLOATN p) { +_CLC_OVERLOAD _CLC_DEF FLOAT length(FLOATN p) { return native_sqrt(dot(p, p)); } diff --git a/generic/lib/geometric/normalize.cl b/generic/lib/geometric/normalize.cl index 95d327c..e5a521f 100644 --- a/generic/lib/geometric/normalize.cl +++ b/generic/lib/geometric/normalize.cl @@ -1,4 +1,8 @@ #include <clc/clc.h> +#ifdef cl_khr_fp64 +#pragma OPENCL EXTENSION cl_khr_fp64 : enable +#endif + #define BODY "normalize.inc" #include <clc/geometric/floatn.inc> diff --git a/generic/lib/math/mad.cl b/generic/lib/math/mad.cl index ff0cdbb..e66e204 100644 --- a/generic/lib/math/mad.cl +++ b/generic/lib/math/mad.cl @@ -1,4 +1,8 @@ #include <clc/clc.h> +#ifdef cl_khr_fp64 +#pragma OPENCL EXTENSION cl_khr_fp64 : enable +#endif + #define BODY <mad.inc> #include <clc/math/gentype.inc> |