diff options
author | Jan Vesely <jan.vesely@rutgers.edu> | 2018-03-06 17:48:35 +0000 |
---|---|---|
committer | Jan Vesely <jan.vesely@rutgers.edu> | 2018-03-06 17:48:35 +0000 |
commit | dbaf6d0f7ce8d4f590e0ec929726b3085ffc1799 (patch) | |
tree | 56a2ea9d06b1e4cb88dd63163d53700acb828370 | |
parent | 1d6c6ee1cf98d260b486242b288a9d8fa0e4e7e1 (diff) | |
download | bcm5719-llvm-dbaf6d0f7ce8d4f590e0ec929726b3085ffc1799.tar.gz bcm5719-llvm-dbaf6d0f7ce8d4f590e0ec929726b3085ffc1799.zip |
Move cl_khr_fp64 exntension enablement to gentype include lists
This will make adding cl_khr_fp16 support easier
Reviewed-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 326816
26 files changed, 7 insertions, 87 deletions
diff --git a/libclc/generic/include/clc/async/gentype.inc b/libclc/generic/include/clc/async/gentype.inc index 6b79acdff17..c08bb6fa6eb 100644 --- a/libclc/generic/include/clc/async/gentype.inc +++ b/libclc/generic/include/clc/async/gentype.inc @@ -180,6 +180,7 @@ #undef __CLC_GENTYPE #ifdef cl_khr_fp64 +#pragma OPENCL EXTENSION cl_khr_fp64 : enable #define __CLC_GENTYPE double #include __CLC_BODY @@ -202,3 +203,5 @@ #undef __CLC_GENTYPE #endif + +#undef __CLC_BODY diff --git a/libclc/generic/include/clc/geometric/floatn.inc b/libclc/generic/include/clc/geometric/floatn.inc index fe5fba69ab4..f1ec38cc3c1 100644 --- a/libclc/generic/include/clc/geometric/floatn.inc +++ b/libclc/generic/include/clc/geometric/floatn.inc @@ -24,6 +24,7 @@ #ifndef __FLOAT_ONLY #ifdef cl_khr_fp64 +#pragma OPENCL EXTENSION cl_khr_fp64 : enable #define __CLC_FLOAT double #define __CLC_FPSIZE 64 diff --git a/libclc/generic/include/clc/math/binary_intrin.inc b/libclc/generic/include/clc/math/binary_intrin.inc index cfbe74159ec..dd4440af124 100644 --- a/libclc/generic/include/clc/math/binary_intrin.inc +++ b/libclc/generic/include/clc/math/binary_intrin.inc @@ -6,6 +6,7 @@ _CLC_OVERLOAD float8 __CLC_FUNCTION(float8, float8) __asm(__CLC_INTRINSIC ".v8f3 _CLC_OVERLOAD float16 __CLC_FUNCTION(float16, float16) __asm(__CLC_INTRINSIC ".v16f32"); #ifdef cl_khr_fp64 +#pragma OPENCL EXTENSION cl_khr_fp64 : enable _CLC_OVERLOAD double __CLC_FUNCTION(double, double) __asm(__CLC_INTRINSIC ".f64"); _CLC_OVERLOAD double2 __CLC_FUNCTION(double2, double2) __asm(__CLC_INTRINSIC ".v2f64"); _CLC_OVERLOAD double3 __CLC_FUNCTION(double3, double3) __asm(__CLC_INTRINSIC ".v3f64"); diff --git a/libclc/generic/include/clc/math/ternary_intrin.inc b/libclc/generic/include/clc/math/ternary_intrin.inc index 9633696ed9c..58ce36b0ed8 100644 --- a/libclc/generic/include/clc/math/ternary_intrin.inc +++ b/libclc/generic/include/clc/math/ternary_intrin.inc @@ -6,6 +6,7 @@ _CLC_OVERLOAD float8 __CLC_FUNCTION(float8, float8, float8) __asm(__CLC_INTRINSI _CLC_OVERLOAD float16 __CLC_FUNCTION(float16, float16, float16) __asm(__CLC_INTRINSIC ".v16f32"); #ifdef cl_khr_fp64 +#pragma OPENCL EXTENSION cl_khr_fp64 : enable _CLC_OVERLOAD double __CLC_FUNCTION(double, double, double) __asm(__CLC_INTRINSIC ".f64"); _CLC_OVERLOAD double2 __CLC_FUNCTION(double2, double2, double2) __asm(__CLC_INTRINSIC ".v2f64"); _CLC_OVERLOAD double3 __CLC_FUNCTION(double3, double3, double3) __asm(__CLC_INTRINSIC ".v3f64"); diff --git a/libclc/generic/include/clc/math/unary_intrin.inc b/libclc/generic/include/clc/math/unary_intrin.inc index 8c62d8827fe..8e42109d938 100644 --- a/libclc/generic/include/clc/math/unary_intrin.inc +++ b/libclc/generic/include/clc/math/unary_intrin.inc @@ -6,6 +6,7 @@ _CLC_OVERLOAD float8 __CLC_FUNCTION(float8 f) __asm(__CLC_INTRINSIC ".v8f32"); _CLC_OVERLOAD float16 __CLC_FUNCTION(float16 f) __asm(__CLC_INTRINSIC ".v16f32"); #ifdef cl_khr_fp64 +#pragma OPENCL EXTENSION cl_khr_fp64 : enable _CLC_OVERLOAD double __CLC_FUNCTION(double d) __asm(__CLC_INTRINSIC ".f64"); _CLC_OVERLOAD double2 __CLC_FUNCTION(double2 d) __asm(__CLC_INTRINSIC ".v2f64"); _CLC_OVERLOAD double3 __CLC_FUNCTION(double3 d) __asm(__CLC_INTRINSIC ".v3f64"); diff --git a/libclc/generic/lib/async/async_work_group_copy.cl b/libclc/generic/lib/async/async_work_group_copy.cl index fe20ecfd9bb..bf02713e2ac 100644 --- a/libclc/generic/lib/async/async_work_group_copy.cl +++ b/libclc/generic/lib/async/async_work_group_copy.cl @@ -1,9 +1,4 @@ #include <clc/clc.h> -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - #define __CLC_BODY <async_work_group_copy.inc> #include <clc/async/gentype.inc> -#undef __CLC_BODY diff --git a/libclc/generic/lib/async/async_work_group_strided_copy.cl b/libclc/generic/lib/async/async_work_group_strided_copy.cl index 61b88986fe4..57d2d083016 100644 --- a/libclc/generic/lib/async/async_work_group_strided_copy.cl +++ b/libclc/generic/lib/async/async_work_group_strided_copy.cl @@ -1,9 +1,4 @@ #include <clc/clc.h> -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - #define __CLC_BODY <async_work_group_strided_copy.inc> #include <clc/async/gentype.inc> -#undef __CLC_BODY diff --git a/libclc/generic/lib/async/prefetch.cl b/libclc/generic/lib/async/prefetch.cl index 45af21b4d9f..6d32890efe4 100644 --- a/libclc/generic/lib/async/prefetch.cl +++ b/libclc/generic/lib/async/prefetch.cl @@ -1,9 +1,4 @@ #include <clc/clc.h> -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - #define __CLC_BODY <prefetch.inc> #include <clc/async/gentype.inc> -#undef __CLC_BODY diff --git a/libclc/generic/lib/common/mix.cl b/libclc/generic/lib/common/mix.cl index 294f332e67f..7f3d5b61497 100644 --- a/libclc/generic/lib/common/mix.cl +++ b/libclc/generic/lib/common/mix.cl @@ -1,8 +1,4 @@ #include <clc/clc.h> -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - #define __CLC_BODY <mix.inc> #include <clc/math/gentype.inc> diff --git a/libclc/generic/lib/geometric/distance.cl b/libclc/generic/lib/geometric/distance.cl index 4a5b8e25879..0469609e13a 100644 --- a/libclc/generic/lib/geometric/distance.cl +++ b/libclc/generic/lib/geometric/distance.cl @@ -22,9 +22,5 @@ #include <clc/clc.h> -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - #define __CLC_BODY <distance.inc> #include <clc/geometric/floatn.inc> diff --git a/libclc/generic/lib/math/acos.cl b/libclc/generic/lib/math/acos.cl index 3ce96554fef..f6e2ab59730 100644 --- a/libclc/generic/lib/math/acos.cl +++ b/libclc/generic/lib/math/acos.cl @@ -1,8 +1,4 @@ #include <clc/clc.h> -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - #define __CLC_BODY <acos.inc> #include <clc/math/gentype.inc> diff --git a/libclc/generic/lib/math/asin.cl b/libclc/generic/lib/math/asin.cl index d56dbd780a7..7581a504093 100644 --- a/libclc/generic/lib/math/asin.cl +++ b/libclc/generic/lib/math/asin.cl @@ -1,8 +1,4 @@ #include <clc/clc.h> -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - #define __CLC_BODY <asin.inc> #include <clc/math/gentype.inc> diff --git a/libclc/generic/lib/math/clc_sqrt.cl b/libclc/generic/lib/math/clc_sqrt.cl index 86a874d0c31..92c7f6e73b1 100644 --- a/libclc/generic/lib/math/clc_sqrt.cl +++ b/libclc/generic/lib/math/clc_sqrt.cl @@ -22,10 +22,6 @@ #include <clc/clc.h> -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - // Map the llvm sqrt intrinsic to an OpenCL function. #define __CLC_FUNCTION __clc_llvm_intr_sqrt #define __CLC_INTRINSIC "llvm.sqrt" diff --git a/libclc/generic/lib/math/exp10.cl b/libclc/generic/lib/math/exp10.cl index c8039cb8ded..1de25cb19a3 100644 --- a/libclc/generic/lib/math/exp10.cl +++ b/libclc/generic/lib/math/exp10.cl @@ -1,8 +1,4 @@ #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/libclc/generic/lib/math/fdim.cl b/libclc/generic/lib/math/fdim.cl index cf25a4ad836..6899cb7549b 100644 --- a/libclc/generic/lib/math/fdim.cl +++ b/libclc/generic/lib/math/fdim.cl @@ -2,9 +2,5 @@ #include "math.h" -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - #define __CLC_BODY <fdim.inc> #include <clc/math/gentype.inc> diff --git a/libclc/generic/lib/math/fract.cl b/libclc/generic/lib/math/fract.cl index b4340710145..8d0289e948d 100644 --- a/libclc/generic/lib/math/fract.cl +++ b/libclc/generic/lib/math/fract.cl @@ -22,9 +22,5 @@ #include <clc/clc.h> -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - #define __CLC_BODY <fract.inc> #include <clc/math/gentype.inc> diff --git a/libclc/generic/lib/math/frexp.cl b/libclc/generic/lib/math/frexp.cl index acd5d93b0b2..da0b0fac4e7 100644 --- a/libclc/generic/lib/math/frexp.cl +++ b/libclc/generic/lib/math/frexp.cl @@ -2,9 +2,5 @@ #include "math.h" -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - #define __CLC_BODY <frexp.inc> #include <clc/math/gentype.inc> diff --git a/libclc/generic/lib/math/hypot.cl b/libclc/generic/lib/math/hypot.cl index eca042c9153..8be351e6a98 100644 --- a/libclc/generic/lib/math/hypot.cl +++ b/libclc/generic/lib/math/hypot.cl @@ -1,8 +1,4 @@ #include <clc/clc.h> -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - #define __CLC_BODY <hypot.inc> #include <clc/math/gentype.inc> diff --git a/libclc/generic/lib/math/lgamma_r.cl b/libclc/generic/lib/math/lgamma_r.cl index a15ff17203b..3f07845eb9e 100644 --- a/libclc/generic/lib/math/lgamma_r.cl +++ b/libclc/generic/lib/math/lgamma_r.cl @@ -3,9 +3,5 @@ #include "../clcmacro.h" #include "math.h" -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - #define __CLC_BODY <lgamma_r.inc> #include <clc/math/gentype.inc> diff --git a/libclc/generic/lib/math/log10.cl b/libclc/generic/lib/math/log10.cl index d65764a894b..8216f9b63fc 100644 --- a/libclc/generic/lib/math/log10.cl +++ b/libclc/generic/lib/math/log10.cl @@ -1,8 +1,4 @@ #include <clc/clc.h> -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - #define __CLC_BODY <log10.inc> #include <clc/math/gentype.inc> diff --git a/libclc/generic/lib/math/mad.cl b/libclc/generic/lib/math/mad.cl index 6c7b90d150d..86bc70d94be 100644 --- a/libclc/generic/lib/math/mad.cl +++ b/libclc/generic/lib/math/mad.cl @@ -1,8 +1,4 @@ #include <clc/clc.h> -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - #define __CLC_BODY <mad.inc> #include <clc/math/gentype.inc> diff --git a/libclc/generic/lib/math/modf.cl b/libclc/generic/lib/math/modf.cl index 3294fbcadbf..a462cab2e80 100644 --- a/libclc/generic/lib/math/modf.cl +++ b/libclc/generic/lib/math/modf.cl @@ -24,9 +24,5 @@ #include "math.h" -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - #define __CLC_BODY <modf.inc> #include <clc/math/gentype.inc> diff --git a/libclc/generic/lib/math/sincos.cl b/libclc/generic/lib/math/sincos.cl index eace5adcf16..9cae1e46e4b 100644 --- a/libclc/generic/lib/math/sincos.cl +++ b/libclc/generic/lib/math/sincos.cl @@ -1,8 +1,4 @@ #include <clc/clc.h> -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - #define __CLC_BODY <sincos.inc> #include <clc/math/gentype.inc> diff --git a/libclc/generic/lib/shared/clamp.cl b/libclc/generic/lib/shared/clamp.cl index c79a358e00e..b946220485b 100644 --- a/libclc/generic/lib/shared/clamp.cl +++ b/libclc/generic/lib/shared/clamp.cl @@ -3,9 +3,5 @@ #define __CLC_BODY <clamp.inc> #include <clc/integer/gentype.inc> -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - #define __CLC_BODY <clamp.inc> #include <clc/math/gentype.inc> diff --git a/libclc/generic/lib/shared/max.cl b/libclc/generic/lib/shared/max.cl index 1c4457c8214..eb573cdbca8 100644 --- a/libclc/generic/lib/shared/max.cl +++ b/libclc/generic/lib/shared/max.cl @@ -3,9 +3,5 @@ #define __CLC_BODY <max.inc> #include <clc/integer/gentype.inc> -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - #define __CLC_BODY <max.inc> #include <clc/math/gentype.inc> diff --git a/libclc/generic/lib/shared/min.cl b/libclc/generic/lib/shared/min.cl index 433087a1069..19a7d796c7b 100644 --- a/libclc/generic/lib/shared/min.cl +++ b/libclc/generic/lib/shared/min.cl @@ -3,9 +3,5 @@ #define __CLC_BODY <min.inc> #include <clc/integer/gentype.inc> -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - #define __CLC_BODY <min.inc> #include <clc/math/gentype.inc> |