Enable cl_khr_fp64 when building the library, and fix several bugs

uncovered when doing so.

llvm-svn: 157617
This commit is contained in:
Peter Collingbourne 2012-05-29 13:35:54 +00:00
parent 20a5813a5f
commit 9acfba3322
6 changed files with 15 additions and 2 deletions

View File

@ -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 "$@"

View File

@ -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)

View File

@ -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>

View File

@ -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));
}

View File

@ -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>

View File

@ -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>