[cfe-commits] [libclc] r157617 - in /libclc/trunk: compile-test.sh configure.py generic/lib/geometric/length.cl generic/lib/geometric/length.inc generic/lib/geometric/normalize.cl generic/lib/math/mad.cl
Peter Collingbourne
peter at pcc.me.uk
Tue May 29 06:35:54 PDT 2012
Author: pcc
Date: Tue May 29 08:35:54 2012
New Revision: 157617
URL: http://llvm.org/viewvc/llvm-project?rev=157617&view=rev
Log:
Enable cl_khr_fp64 when building the library, and fix several bugs
uncovered when doing so.
Modified:
libclc/trunk/compile-test.sh
libclc/trunk/configure.py
libclc/trunk/generic/lib/geometric/length.cl
libclc/trunk/generic/lib/geometric/length.inc
libclc/trunk/generic/lib/geometric/normalize.cl
libclc/trunk/generic/lib/math/mad.cl
Modified: libclc/trunk/compile-test.sh
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/compile-test.sh?rev=157617&r1=157616&r2=157617&view=diff
==============================================================================
--- libclc/trunk/compile-test.sh (original)
+++ libclc/trunk/compile-test.sh Tue May 29 08:35:54 2012
@@ -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 "$@"
Modified: libclc/trunk/configure.py
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/configure.py?rev=157617&r1=157616&r2=157617&view=diff
==============================================================================
--- libclc/trunk/configure.py (original)
+++ libclc/trunk/configure.py Tue May 29 08:35:54 2012
@@ -93,6 +93,7 @@
# 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)
Modified: libclc/trunk/generic/lib/geometric/length.cl
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/geometric/length.cl?rev=157617&r1=157616&r2=157617&view=diff
==============================================================================
--- libclc/trunk/generic/lib/geometric/length.cl (original)
+++ libclc/trunk/generic/lib/geometric/length.cl Tue May 29 08:35:54 2012
@@ -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>
Modified: libclc/trunk/generic/lib/geometric/length.inc
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/geometric/length.inc?rev=157617&r1=157616&r2=157617&view=diff
==============================================================================
--- libclc/trunk/generic/lib/geometric/length.inc (original)
+++ libclc/trunk/generic/lib/geometric/length.inc Tue May 29 08:35:54 2012
@@ -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));
}
Modified: libclc/trunk/generic/lib/geometric/normalize.cl
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/geometric/normalize.cl?rev=157617&r1=157616&r2=157617&view=diff
==============================================================================
--- libclc/trunk/generic/lib/geometric/normalize.cl (original)
+++ libclc/trunk/generic/lib/geometric/normalize.cl Tue May 29 08:35:54 2012
@@ -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>
Modified: libclc/trunk/generic/lib/math/mad.cl
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/mad.cl?rev=157617&r1=157616&r2=157617&view=diff
==============================================================================
--- libclc/trunk/generic/lib/math/mad.cl (original)
+++ libclc/trunk/generic/lib/math/mad.cl Tue May 29 08:35:54 2012
@@ -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>
More information about the cfe-commits
mailing list