diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt index e698f48065702..b55f6c3adce1f 100644 --- a/libclc/CMakeLists.txt +++ b/libclc/CMakeLists.txt @@ -346,7 +346,19 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) message( STATUS " device: ${d} ( ${${d}_aliases} )" ) + # Note: when declaring builtins, we must consider that even if a target + # formally/nominally supports the generic address space, in practice that + # target may map it to the same target address space as another address + # space (often the private one). In such cases we must be careful not to + # multiply-define a builtin in a single target address space, as it would + # result in a mangling clash. + # For this reason we must consider the target support of the generic + # address space separately from the *implementation* decision about whether + # to declare certain builtins in that address space. set ( supports_generic_addrspace TRUE ) + # Note: we assume that if there is no distinct generic address space, it + # maps to the private address space. + set ( has_distinct_generic_addrspace TRUE ) if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 ) set( opt_flags -O3 ) set( spvflags --spirv-max-version=1.1 ) @@ -354,19 +366,12 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) set( opt_flags -O3 ) elseif( ARCH STREQUAL nvptx OR ARCH STREQUAL nvptx64 ) set( opt_flags -O3 "--nvvm-reflect-enable=false" ) - # Note: when declaring builtins, we don't consider NVIDIA as supporting - # the generic address space. This is because it maps to the same target - # address space as the private address space, resulting in a mangling - # clash. - # Since we can't declare builtins overloaded on both address spaces - # simultaneously, we choose declare the builtins using the private space, - # which will also work for the generic address space. - set( supports_generic_addrspace FALSE ) + set( has_distinct_generic_addrspace FALSE ) elseif( ARCH STREQUAL amdgcn ) set( opt_flags -O3 --amdgpu-oclc-reflect-enable=false ) elseif( ARCH STREQUAL x86_64) set( opt_flags ) - set( supports_generic_addrspace FALSE ) + set( has_distinct_generic_addrspace FALSE ) else() set( opt_flags -O3 ) endif() @@ -379,7 +384,6 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) file( MAKE_DIRECTORY ${LIBCLC_ARCH_OBJFILE_DIR} ) # OpenCL 3.0 extensions - list( APPEND flags -cl-std=CL3.0 "-Xclang" ) string(CONCAT CL_3_0_EXTENSIONS "-cl-ext=" "+cl_khr_fp64," @@ -387,8 +391,11 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) "+__opencl_c_3d_image_writes," "+__opencl_c_images," "+cl_khr_3d_image_writes") - if(supports_generic_addrspace) + if( supports_generic_addrspace ) string( APPEND CL_3_0_EXTENSIONS ",+__opencl_c_generic_address_space" ) + if( has_distinct_generic_addrspace ) + list( APPEND flags -D__CLC_DISTINCT_GENERIC_ADDRSPACE__ ) + endif() else() # Explictly disable opencl_c_generic_address_space (it may be enabled # by default on some targets). We also disable opencl_c_pipes and @@ -397,7 +404,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) string( APPEND CL_3_0_EXTENSIONS ",-__opencl_c_pipes" ) string( APPEND CL_3_0_EXTENSIONS ",-__opencl_c_device_enqueue" ) endif() - list( APPEND flags ${CL_3_0_EXTENSIONS}) + list( APPEND flags -cl-std=CL3.0 "-Xclang" ${CL_3_0_EXTENSIONS} ) # Add platform specific flags if(WIN32) diff --git a/libclc/generic/include/clc/clc.h b/libclc/generic/include/clc/clc.h index e17bd97c5b900..e01947c4680c0 100644 --- a/libclc/generic/include/clc/clc.h +++ b/libclc/generic/include/clc/clc.h @@ -18,8 +18,16 @@ (__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && \ defined(__opencl_c_generic_address_space)) #define _CLC_GENERIC_AS_SUPPORTED 1 +// Note that we hard-code the assumption that a non-distinct address space means +// that the target maps the generic address space to the private address space. +#ifdef __CLC_DISTINCT_GENERIC_ADDRSPACE__ +#define _CLC_DISTINCT_GENERIC_AS_SUPPORTED 1 +#else +#define _CLC_DISTINCT_GENERIC_AS_SUPPORTED 0 +#endif #else #define _CLC_GENERIC_AS_SUPPORTED 0 +#define _CLC_DISTINCT_GENERIC_AS_SUPPORTED 0 #endif /* Function Attributes */ diff --git a/libclc/generic/include/clc/math/fract.inc b/libclc/generic/include/clc/math/fract.inc index 73f88dd81a7d1..dd6ccda7bf399 100644 --- a/libclc/generic/include/clc/math/fract.inc +++ b/libclc/generic/include/clc/math/fract.inc @@ -23,6 +23,6 @@ _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE fract(__CLC_GENTYPE x, global __CLC_GENTYPE *iptr); _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE fract(__CLC_GENTYPE x, local __CLC_GENTYPE *iptr); _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE fract(__CLC_GENTYPE x, private __CLC_GENTYPE *iptr); -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE fract(__CLC_GENTYPE x, generic __CLC_GENTYPE *iptr); #endif diff --git a/libclc/generic/include/clc/math/frexp.inc b/libclc/generic/include/clc/math/frexp.inc index d9194d1178ffc..41c097fa87404 100644 --- a/libclc/generic/include/clc/math/frexp.inc +++ b/libclc/generic/include/clc/math/frexp.inc @@ -1,6 +1,6 @@ _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE frexp(__CLC_GENTYPE x, global __CLC_INTN *iptr); _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE frexp(__CLC_GENTYPE x, local __CLC_INTN *iptr); _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE frexp(__CLC_GENTYPE x, private __CLC_INTN *iptr); -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE frexp(__CLC_GENTYPE x, generic __CLC_INTN *iptr); #endif diff --git a/libclc/generic/include/clc/math/modf.inc b/libclc/generic/include/clc/math/modf.inc index 05c1038fa1cb8..a74635d30b44b 100644 --- a/libclc/generic/include/clc/math/modf.inc +++ b/libclc/generic/include/clc/math/modf.inc @@ -23,6 +23,6 @@ _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE modf(__CLC_GENTYPE x, global __CLC_GENTYPE *iptr); _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE modf(__CLC_GENTYPE x, local __CLC_GENTYPE *iptr); _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE modf(__CLC_GENTYPE x, private __CLC_GENTYPE *iptr); -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE modf(__CLC_GENTYPE x, generic __CLC_GENTYPE *iptr); #endif diff --git a/libclc/generic/include/clc/math/remquo.h b/libclc/generic/include/clc/math/remquo.h index e05e66c3d4815..bba4726a93286 100644 --- a/libclc/generic/include/clc/math/remquo.h +++ b/libclc/generic/include/clc/math/remquo.h @@ -15,7 +15,7 @@ #include #undef __CLC_ADDRESS_SPACE -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED #define __CLC_BODY #define __CLC_ADDRESS_SPACE generic #include diff --git a/libclc/generic/include/clc/math/sincos.inc b/libclc/generic/include/clc/math/sincos.inc index 05a2b1360638f..c3e52d6ab035a 100644 --- a/libclc/generic/include/clc/math/sincos.inc +++ b/libclc/generic/include/clc/math/sincos.inc @@ -1,6 +1,6 @@ _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE sincos (__CLC_GENTYPE x, global __CLC_GENTYPE * cosval); _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE sincos (__CLC_GENTYPE x, local __CLC_GENTYPE * cosval); _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE sincos (__CLC_GENTYPE x, private __CLC_GENTYPE * cosval); -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE sincos (__CLC_GENTYPE x, generic __CLC_GENTYPE * cosval); #endif diff --git a/libclc/generic/include/clc/shared/vload.h b/libclc/generic/include/clc/shared/vload.h index c558a1e2f5eea..386868365c149 100644 --- a/libclc/generic/include/clc/shared/vload.h +++ b/libclc/generic/include/clc/shared/vload.h @@ -9,7 +9,7 @@ _CLC_VLOAD_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE##8, 8, ADDR_SPACE) \ _CLC_VLOAD_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE##16, 16, ADDR_SPACE) -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED #define _CLC_VECTOR_VLOAD_GENERIC_DECL _CLC_VECTOR_VLOAD_DECL #else // The generic address space isn't available, so make the macro do nothing @@ -61,7 +61,7 @@ _CLC_VLOAD_DECL(a_half, half, float, , __global) _CLC_VLOAD_DECL(a_half, half, float, , __local) _CLC_VLOAD_DECL(a_half, half, float, , __private) -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_VLOAD_DECL(_half, half, float, , __generic) _CLC_VLOAD_DECL(a_half, half, float, , __generic) #endif diff --git a/libclc/generic/include/clc/shared/vstore.h b/libclc/generic/include/clc/shared/vstore.h index d4aac11b8d63e..6d270178193b3 100644 --- a/libclc/generic/include/clc/shared/vstore.h +++ b/libclc/generic/include/clc/shared/vstore.h @@ -9,7 +9,7 @@ _CLC_VSTORE_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE##8, 8, ADDR_SPACE, RND) \ _CLC_VSTORE_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE##16, 16, ADDR_SPACE, RND) -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED #define _CLC_VSTORE_GENERIC_DECL _CLC_VSTORE_DECL #define _CLC_VECTOR_VSTORE_GENERIC_DECL _CLC_VECTOR_VSTORE_DECL #else diff --git a/libclc/generic/include/spirv/spirv.h b/libclc/generic/include/spirv/spirv.h index 419a46f85b539..a22c376e5263e 100644 --- a/libclc/generic/include/spirv/spirv.h +++ b/libclc/generic/include/spirv/spirv.h @@ -24,8 +24,16 @@ (__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && \ defined(__opencl_c_generic_address_space)) #define _CLC_GENERIC_AS_SUPPORTED 1 +// Note that we hard-code the assumption that a non-distinct address space means +// that the target maps the generic address space to the private address space. +#if __CLC_DISTINCT_GENERIC_ADDRSPACE__ +#define _CLC_DISTINCT_GENERIC_AS_SUPPORTED 1 +#else +#define _CLC_DISTINCT_GENERIC_AS_SUPPORTED 0 +#endif #else #define _CLC_GENERIC_AS_SUPPORTED 0 +#define _CLC_DISTINCT_GENERIC_AS_SUPPORTED 0 #endif /* Function Attributes */ diff --git a/libclc/generic/include/spirv/spirv_builtins.h b/libclc/generic/include/spirv/spirv_builtins.h index adb0b14b690f9..5812039a0e73b 100644 --- a/libclc/generic/include/spirv/spirv_builtins.h +++ b/libclc/generic/include/spirv/spirv_builtins.h @@ -14476,7 +14476,7 @@ _CLC_OVERLOAD _CLC_DECL __clc_vec16_fp16_t __spirv_ocl_fract(__clc_vec16_fp16_t, __clc_vec16_fp16_t __global *); #endif -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DECL __clc_fp32_t __spirv_ocl_fract(__clc_fp32_t, __clc_fp32_t __generic *); @@ -14637,7 +14637,7 @@ _CLC_OVERLOAD _CLC_DECL __clc_vec16_fp16_t __spirv_ocl_frexp(__clc_vec16_fp16_t, __clc_vec16_int32_t __global *); #endif -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DECL __clc_fp32_t __spirv_ocl_frexp(__clc_fp32_t, __clc_int32_t __generic *); _CLC_OVERLOAD _CLC_DECL __clc_vec2_fp32_t @@ -15218,7 +15218,7 @@ _CLC_OVERLOAD _CLC_DECL __clc_vec16_fp16_t __spirv_ocl_lgamma_r(__clc_vec16_fp16_t, __clc_vec16_int32_t __global *); #endif -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DECL __clc_fp32_t __spirv_ocl_lgamma_r(__clc_fp32_t, __clc_int32_t __generic *); _CLC_OVERLOAD _CLC_DECL __clc_vec2_fp32_t @@ -15767,7 +15767,7 @@ _CLC_OVERLOAD _CLC_DECL __clc_vec16_fp16_t __spirv_ocl_modf(__clc_vec16_fp16_t, __clc_vec16_fp16_t __global *); #endif -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DECL __clc_fp32_t __spirv_ocl_modf(__clc_fp32_t, __clc_fp32_t __generic *); _CLC_OVERLOAD _CLC_DECL __clc_vec2_fp32_t @@ -16752,7 +16752,7 @@ _CLC_OVERLOAD _CLC_DECL __clc_vec16_fp16_t __spirv_ocl_remquo( __clc_vec16_fp16_t, __clc_vec16_fp16_t, __clc_vec16_int32_t __global *); #endif -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DECL __clc_fp32_t __spirv_ocl_remquo(__clc_fp32_t, __clc_fp32_t, __clc_int32_t __generic *); _CLC_OVERLOAD _CLC_DECL __clc_vec2_fp32_t __spirv_ocl_remquo( @@ -19016,7 +19016,7 @@ _CLC_OVERLOAD _CLC_DECL __clc_vec16_fp16_t __spirv_ocl_sincos(__clc_vec16_fp16_t, __clc_vec16_fp16_t __global *); #endif -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DECL __clc_fp32_t __spirv_ocl_sincos(__clc_fp32_t, __clc_fp32_t __generic *); _CLC_OVERLOAD _CLC_DECL __clc_vec2_fp32_t diff --git a/libclc/generic/lib/math/fract.inc b/libclc/generic/lib/math/fract.inc index 0abe269d13ab9..92bc00feee201 100644 --- a/libclc/generic/lib/math/fract.inc +++ b/libclc/generic/lib/math/fract.inc @@ -39,7 +39,7 @@ FRACT_DEF(private); FRACT_DEF(local); FRACT_DEF(global); -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED FRACT_DEF(generic); #endif diff --git a/libclc/generic/lib/math/frexp.cl b/libclc/generic/lib/math/frexp.cl index 1213a72c6a2df..fec133c7cd10a 100644 --- a/libclc/generic/lib/math/frexp.cl +++ b/libclc/generic/lib/math/frexp.cl @@ -16,7 +16,7 @@ #include #undef __CLC_ADDRESS_SPACE -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED #define __CLC_BODY #define __CLC_ADDRESS_SPACE generic #include diff --git a/libclc/generic/lib/math/modf.inc b/libclc/generic/lib/math/modf.inc index ae71ac7e07667..a9a4e16461093 100644 --- a/libclc/generic/lib/math/modf.inc +++ b/libclc/generic/lib/math/modf.inc @@ -43,7 +43,7 @@ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE modf(__CLC_GENTYPE x, private __CLC_GENTYPE MODF_DEF(local); MODF_DEF(global); -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED MODF_DEF(generic); #endif diff --git a/libclc/generic/lib/math/remquo.cl b/libclc/generic/lib/math/remquo.cl index 0efe1cde509b7..a05ddacd32bbc 100644 --- a/libclc/generic/lib/math/remquo.cl +++ b/libclc/generic/lib/math/remquo.cl @@ -16,7 +16,7 @@ #include #undef __CLC_ADDRESS_SPACE -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED #define __CLC_BODY #define __CLC_ADDRESS_SPACE generic #include diff --git a/libclc/generic/lib/math/sincos.inc b/libclc/generic/lib/math/sincos.inc index d917f2854d425..177e74e605c51 100644 --- a/libclc/generic/lib/math/sincos.inc +++ b/libclc/generic/lib/math/sincos.inc @@ -8,7 +8,7 @@ __CLC_DECLARE_SINCOS(global, __CLC_GENTYPE) __CLC_DECLARE_SINCOS(local, __CLC_GENTYPE) __CLC_DECLARE_SINCOS(private, __CLC_GENTYPE) -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED __CLC_DECLARE_SINCOS(generic, __CLC_GENTYPE) #endif diff --git a/libclc/generic/lib/shared/vload.cl b/libclc/generic/lib/shared/vload.cl index 0d33d1f0ec305..62151a958773c 100644 --- a/libclc/generic/lib/shared/vload.cl +++ b/libclc/generic/lib/shared/vload.cl @@ -27,7 +27,7 @@ return *((const ADDR_SPACE less_aligned_##ADDR_SPACE##PRIM_TYPE##16*) (&x[16*offset])); \ } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED #define VLOAD_VECTORIZE_GENERIC VLOAD_VECTORIZE #else // The generic address space isn't available, so make the macro do nothing @@ -70,7 +70,7 @@ float __clc_vload_half_float_helper__constant(const __constant half *); float __clc_vload_half_float_helper__global(const __global half *); float __clc_vload_half_float_helper__local(const __local half *); float __clc_vload_half_float_helper__private(const __private half *); -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED float __clc_vload_half_float_helper__generic(const __generic half *); #endif diff --git a/libclc/generic/lib/shared/vload_half.inc b/libclc/generic/lib/shared/vload_half.inc index da98741fc5589..09ecd8798afad 100644 --- a/libclc/generic/lib/shared/vload_half.inc +++ b/libclc/generic/lib/shared/vload_half.inc @@ -12,7 +12,7 @@ FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __local); FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __global); FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __constant); -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __generic); #endif @@ -22,7 +22,7 @@ FUNC(, 1, 1, __CLC_GENTYPE, __local); FUNC(, 1, 1, __CLC_GENTYPE, __global); FUNC(, 1, 1, __CLC_GENTYPE, __constant); -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED FUNC(, 1, 1, __CLC_GENTYPE, __generic); #endif #endif diff --git a/libclc/generic/lib/shared/vstore.cl b/libclc/generic/lib/shared/vstore.cl index 2ffe21eee87ee..f72a965419702 100644 --- a/libclc/generic/lib/shared/vstore.cl +++ b/libclc/generic/lib/shared/vstore.cl @@ -28,7 +28,7 @@ *((ADDR_SPACE less_aligned_##ADDR_SPACE##PRIM_TYPE##16*) (&mem[16*offset])) = vec; \ } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED #define VSTORE_VECTORIZE_GENERIC VSTORE_VECTORIZE #else // The generic address space isn't available, so make the macro do nothing @@ -75,7 +75,7 @@ _CLC_DEF void __clc_vstore_half_##STYPE##_helper##AS(STYPE s, AS half *d) \ DECLARE_HELPER(float, __private, __builtin_store_halff); DECLARE_HELPER(float, __global, __builtin_store_halff); DECLARE_HELPER(float, __local, __builtin_store_halff); -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED DECLARE_HELPER(float, __generic, __builtin_store_halff); #endif @@ -83,7 +83,7 @@ DECLARE_HELPER(float, __generic, __builtin_store_halff); DECLARE_HELPER(double, __private, __builtin_store_half); DECLARE_HELPER(double, __global, __builtin_store_half); DECLARE_HELPER(double, __local, __builtin_store_half); -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED DECLARE_HELPER(double, __generic, __builtin_store_half); #endif #endif diff --git a/libclc/generic/lib/shared/vstore_half.inc b/libclc/generic/lib/shared/vstore_half.inc index a53da770dfbc6..2e6f1170639c6 100644 --- a/libclc/generic/lib/shared/vstore_half.inc +++ b/libclc/generic/lib/shared/vstore_half.inc @@ -11,7 +11,7 @@ FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __CLC_SCALAR_GENTYPE, __private); FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __CLC_SCALAR_GENTYPE, __local); FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __CLC_SCALAR_GENTYPE, __global); -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __CLC_SCALAR_GENTYPE, __generic); #endif @@ -20,7 +20,7 @@ FUNC(, 1, 1, __CLC_GENTYPE, __CLC_SCALAR_GENTYPE, __private); FUNC(, 1, 1, __CLC_GENTYPE, __CLC_SCALAR_GENTYPE, __local); FUNC(, 1, 1, __CLC_GENTYPE, __CLC_SCALAR_GENTYPE, __global); -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED FUNC(, 1, 1, __CLC_GENTYPE, __CLC_SCALAR_GENTYPE, __generic); #endif #endif diff --git a/libclc/generic/libspirv/float16.cl b/libclc/generic/libspirv/float16.cl index 41c2dcc8573fb..4bd36c175eb71 100644 --- a/libclc/generic/libspirv/float16.cl +++ b/libclc/generic/libspirv/float16.cl @@ -4735,7 +4735,7 @@ __spirv_ocl_fract(__clc_float16_t args_0, __clc_float16_t __global *args_1) { return __spirv_ocl_fract(as_half(args_0), (__clc_fp16_t __global *)(args_1)); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_fp16_t __spirv_ocl_fract(__clc_float16_t args_0, __clc_float16_t __generic *args_1) { return __spirv_ocl_fract(as_half(args_0), (__clc_fp16_t __generic *)(args_1)); @@ -4760,7 +4760,7 @@ _CLC_OVERLOAD _CLC_DEF __clc_vec2_fp16_t __spirv_ocl_fract( (__clc_vec2_fp16_t __global *)(args_1)); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec2_fp16_t __spirv_ocl_fract( __clc_vec2_float16_t args_0, __clc_vec2_float16_t __generic *args_1) { return __spirv_ocl_fract(as_half2(args_0), @@ -4786,7 +4786,7 @@ _CLC_OVERLOAD _CLC_DEF __clc_vec3_fp16_t __spirv_ocl_fract( (__clc_vec3_fp16_t __global *)(args_1)); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec3_fp16_t __spirv_ocl_fract( __clc_vec3_float16_t args_0, __clc_vec3_float16_t __generic *args_1) { return __spirv_ocl_fract(as_half3(args_0), @@ -4812,7 +4812,7 @@ _CLC_OVERLOAD _CLC_DEF __clc_vec4_fp16_t __spirv_ocl_fract( (__clc_vec4_fp16_t __global *)(args_1)); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec4_fp16_t __spirv_ocl_fract( __clc_vec4_float16_t args_0, __clc_vec4_float16_t __generic *args_1) { return __spirv_ocl_fract(as_half4(args_0), @@ -4838,7 +4838,7 @@ _CLC_OVERLOAD _CLC_DEF __clc_vec8_fp16_t __spirv_ocl_fract( (__clc_vec8_fp16_t __global *)(args_1)); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec8_fp16_t __spirv_ocl_fract( __clc_vec8_float16_t args_0, __clc_vec8_float16_t __generic *args_1) { return __spirv_ocl_fract(as_half8(args_0), @@ -4864,7 +4864,7 @@ _CLC_OVERLOAD _CLC_DEF __clc_vec16_fp16_t __spirv_ocl_fract( (__clc_vec16_fp16_t __global *)(args_1)); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec16_fp16_t __spirv_ocl_fract( __clc_vec16_float16_t args_0, __clc_vec16_float16_t __generic *args_1) { return __spirv_ocl_fract(as_half16(args_0), @@ -4887,7 +4887,7 @@ __spirv_ocl_frexp(__clc_float16_t args_0, __clc_int32_t __global *args_1) { return __spirv_ocl_frexp(as_half(args_0), args_1); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_fp16_t __spirv_ocl_frexp(__clc_float16_t args_0, __clc_int32_t __generic *args_1) { return __spirv_ocl_frexp(as_half(args_0), args_1); @@ -4909,7 +4909,7 @@ _CLC_OVERLOAD _CLC_DEF __clc_vec2_fp16_t __spirv_ocl_frexp( return __spirv_ocl_frexp(as_half2(args_0), args_1); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec2_fp16_t __spirv_ocl_frexp( __clc_vec2_float16_t args_0, __clc_vec2_int32_t __generic *args_1) { return __spirv_ocl_frexp(as_half2(args_0), args_1); @@ -4931,7 +4931,7 @@ _CLC_OVERLOAD _CLC_DEF __clc_vec3_fp16_t __spirv_ocl_frexp( return __spirv_ocl_frexp(as_half3(args_0), args_1); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec3_fp16_t __spirv_ocl_frexp( __clc_vec3_float16_t args_0, __clc_vec3_int32_t __generic *args_1) { return __spirv_ocl_frexp(as_half3(args_0), args_1); @@ -4953,7 +4953,7 @@ _CLC_OVERLOAD _CLC_DEF __clc_vec4_fp16_t __spirv_ocl_frexp( return __spirv_ocl_frexp(as_half4(args_0), args_1); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec4_fp16_t __spirv_ocl_frexp( __clc_vec4_float16_t args_0, __clc_vec4_int32_t __generic *args_1) { return __spirv_ocl_frexp(as_half4(args_0), args_1); @@ -4975,7 +4975,7 @@ _CLC_OVERLOAD _CLC_DEF __clc_vec8_fp16_t __spirv_ocl_frexp( return __spirv_ocl_frexp(as_half8(args_0), args_1); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec8_fp16_t __spirv_ocl_frexp( __clc_vec8_float16_t args_0, __clc_vec8_int32_t __generic *args_1) { return __spirv_ocl_frexp(as_half8(args_0), args_1); @@ -4997,7 +4997,7 @@ _CLC_OVERLOAD _CLC_DEF __clc_vec16_fp16_t __spirv_ocl_frexp( return __spirv_ocl_frexp(as_half16(args_0), args_1); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec16_fp16_t __spirv_ocl_frexp( __clc_vec16_float16_t args_0, __clc_vec16_int32_t __generic *args_1) { return __spirv_ocl_frexp(as_half16(args_0), args_1); @@ -5189,7 +5189,7 @@ __spirv_ocl_lgamma_r(__clc_float16_t args_0, __clc_int32_t __global *args_1) { return __spirv_ocl_lgamma_r(as_half(args_0), args_1); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_fp16_t __spirv_ocl_lgamma_r(__clc_float16_t args_0, __clc_int32_t __generic *args_1) { return __spirv_ocl_lgamma_r(as_half(args_0), args_1); @@ -5211,7 +5211,7 @@ _CLC_OVERLOAD _CLC_DEF __clc_vec2_fp16_t __spirv_ocl_lgamma_r( return __spirv_ocl_lgamma_r(as_half2(args_0), args_1); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec2_fp16_t __spirv_ocl_lgamma_r( __clc_vec2_float16_t args_0, __clc_vec2_int32_t __generic *args_1) { return __spirv_ocl_lgamma_r(as_half2(args_0), args_1); @@ -5233,7 +5233,7 @@ _CLC_OVERLOAD _CLC_DEF __clc_vec3_fp16_t __spirv_ocl_lgamma_r( return __spirv_ocl_lgamma_r(as_half3(args_0), args_1); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec3_fp16_t __spirv_ocl_lgamma_r( __clc_vec3_float16_t args_0, __clc_vec3_int32_t __generic *args_1) { return __spirv_ocl_lgamma_r(as_half3(args_0), args_1); @@ -5255,7 +5255,7 @@ _CLC_OVERLOAD _CLC_DEF __clc_vec4_fp16_t __spirv_ocl_lgamma_r( return __spirv_ocl_lgamma_r(as_half4(args_0), args_1); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec4_fp16_t __spirv_ocl_lgamma_r( __clc_vec4_float16_t args_0, __clc_vec4_int32_t __generic *args_1) { return __spirv_ocl_lgamma_r(as_half4(args_0), args_1); @@ -5277,7 +5277,7 @@ _CLC_OVERLOAD _CLC_DEF __clc_vec8_fp16_t __spirv_ocl_lgamma_r( return __spirv_ocl_lgamma_r(as_half8(args_0), args_1); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec8_fp16_t __spirv_ocl_lgamma_r( __clc_vec8_float16_t args_0, __clc_vec8_int32_t __generic *args_1) { return __spirv_ocl_lgamma_r(as_half8(args_0), args_1); @@ -5299,7 +5299,7 @@ _CLC_OVERLOAD _CLC_DEF __clc_vec16_fp16_t __spirv_ocl_lgamma_r( return __spirv_ocl_lgamma_r(as_half16(args_0), args_1); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec16_fp16_t __spirv_ocl_lgamma_r( __clc_vec16_float16_t args_0, __clc_vec16_int32_t __generic *args_1) { return __spirv_ocl_lgamma_r(as_half16(args_0), args_1); @@ -5603,7 +5603,7 @@ __spirv_ocl_modf(__clc_float16_t args_0, __clc_float16_t __global *args_1) { return __spirv_ocl_modf(as_half(args_0), (__clc_fp16_t __global *)(args_1)); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_fp16_t __spirv_ocl_modf(__clc_float16_t args_0, __clc_float16_t __generic *args_1) { return __spirv_ocl_modf(as_half(args_0), (__clc_fp16_t __generic *)(args_1)); @@ -5628,7 +5628,7 @@ _CLC_OVERLOAD _CLC_DEF __clc_vec2_fp16_t __spirv_ocl_modf( (__clc_vec2_fp16_t __global *)(args_1)); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec2_fp16_t __spirv_ocl_modf( __clc_vec2_float16_t args_0, __clc_vec2_float16_t __generic *args_1) { return __spirv_ocl_modf(as_half2(args_0), @@ -5654,7 +5654,7 @@ _CLC_OVERLOAD _CLC_DEF __clc_vec3_fp16_t __spirv_ocl_modf( (__clc_vec3_fp16_t __global *)(args_1)); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec3_fp16_t __spirv_ocl_modf( __clc_vec3_float16_t args_0, __clc_vec3_float16_t __generic *args_1) { return __spirv_ocl_modf(as_half3(args_0), @@ -5680,7 +5680,7 @@ _CLC_OVERLOAD _CLC_DEF __clc_vec4_fp16_t __spirv_ocl_modf( (__clc_vec4_fp16_t __global *)(args_1)); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec4_fp16_t __spirv_ocl_modf( __clc_vec4_float16_t args_0, __clc_vec4_float16_t __generic *args_1) { return __spirv_ocl_modf(as_half4(args_0), @@ -5706,7 +5706,7 @@ _CLC_OVERLOAD _CLC_DEF __clc_vec8_fp16_t __spirv_ocl_modf( (__clc_vec8_fp16_t __global *)(args_1)); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec8_fp16_t __spirv_ocl_modf( __clc_vec8_float16_t args_0, __clc_vec8_float16_t __generic *args_1) { return __spirv_ocl_modf(as_half8(args_0), @@ -5731,7 +5731,7 @@ _CLC_OVERLOAD _CLC_DEF __clc_vec16_fp16_t __spirv_ocl_modf( (__clc_vec16_fp16_t __global *)(args_1)); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec16_fp16_t __spirv_ocl_modf( __clc_vec16_float16_t args_0, __clc_vec16_float16_t __generic *args_1) { return __spirv_ocl_modf(as_half16(args_0), @@ -5993,7 +5993,7 @@ __spirv_ocl_remquo(__clc_float16_t args_0, __clc_float16_t args_1, return __spirv_ocl_remquo(as_half(args_0), as_half(args_1), args_2); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_fp16_t __spirv_ocl_remquo(__clc_float16_t args_0, __clc_float16_t args_1, __clc_int32_t __generic *args_2) { @@ -6019,7 +6019,7 @@ __spirv_ocl_remquo(__clc_vec2_float16_t args_0, __clc_vec2_float16_t args_1, return __spirv_ocl_remquo(as_half2(args_0), as_half2(args_1), args_2); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec2_fp16_t __spirv_ocl_remquo(__clc_vec2_float16_t args_0, __clc_vec2_float16_t args_1, __clc_vec2_int32_t __generic *args_2) { @@ -6045,7 +6045,7 @@ __spirv_ocl_remquo(__clc_vec3_float16_t args_0, __clc_vec3_float16_t args_1, return __spirv_ocl_remquo(as_half3(args_0), as_half3(args_1), args_2); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec3_fp16_t __spirv_ocl_remquo(__clc_vec3_float16_t args_0, __clc_vec3_float16_t args_1, __clc_vec3_int32_t __generic *args_2) { @@ -6071,7 +6071,7 @@ __spirv_ocl_remquo(__clc_vec4_float16_t args_0, __clc_vec4_float16_t args_1, return __spirv_ocl_remquo(as_half4(args_0), as_half4(args_1), args_2); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec4_fp16_t __spirv_ocl_remquo(__clc_vec4_float16_t args_0, __clc_vec4_float16_t args_1, __clc_vec4_int32_t __generic *args_2) { @@ -6097,7 +6097,7 @@ __spirv_ocl_remquo(__clc_vec8_float16_t args_0, __clc_vec8_float16_t args_1, return __spirv_ocl_remquo(as_half8(args_0), as_half8(args_1), args_2); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec8_fp16_t __spirv_ocl_remquo(__clc_vec8_float16_t args_0, __clc_vec8_float16_t args_1, __clc_vec8_int32_t __generic *args_2) { @@ -6123,7 +6123,7 @@ __spirv_ocl_remquo(__clc_vec16_float16_t args_0, __clc_vec16_float16_t args_1, return __spirv_ocl_remquo(as_half16(args_0), as_half16(args_1), args_2); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec16_fp16_t __spirv_ocl_remquo(__clc_vec16_float16_t args_0, __clc_vec16_float16_t args_1, __clc_vec16_int32_t __generic *args_2) { @@ -6573,7 +6573,7 @@ __spirv_ocl_sincos(__clc_float16_t args_0, __clc_float16_t __global *args_1) { return __spirv_ocl_sincos(as_half(args_0), (__clc_fp16_t __global *)(args_1)); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_fp16_t __spirv_ocl_sincos(__clc_float16_t args_0, __clc_float16_t __generic *args_1) { return __spirv_ocl_sincos(as_half(args_0), @@ -6597,7 +6597,7 @@ _CLC_OVERLOAD _CLC_DEF __clc_vec2_fp16_t __spirv_ocl_sincos( return __spirv_ocl_sincos(as_half2(args_0), (__clc_vec2_fp16_t __global *)(args_1)); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec2_fp16_t __spirv_ocl_sincos( __clc_vec2_float16_t args_0, __clc_vec2_float16_t __generic *args_1) { return __spirv_ocl_sincos(as_half2(args_0), (__clc_vec2_fp16_t __generic *)(args_1)); @@ -6621,7 +6621,7 @@ _CLC_OVERLOAD _CLC_DEF __clc_vec3_fp16_t __spirv_ocl_sincos( (__clc_vec3_fp16_t __global *)(args_1)); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec3_fp16_t __spirv_ocl_sincos( __clc_vec3_float16_t args_0, __clc_vec3_float16_t __generic *args_1) { return __spirv_ocl_sincos(as_half3(args_0), (__clc_vec3_fp16_t __generic *)(args_1)); @@ -6646,7 +6646,7 @@ _CLC_OVERLOAD _CLC_DEF __clc_vec4_fp16_t __spirv_ocl_sincos( (__clc_vec4_fp16_t __global *)(args_1)); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec4_fp16_t __spirv_ocl_sincos(__clc_vec4_float16_t args_0, __clc_vec4_float16_t __generic *args_1) { return __spirv_ocl_sincos(as_half4(args_0), @@ -6672,7 +6672,7 @@ _CLC_OVERLOAD _CLC_DEF __clc_vec8_fp16_t __spirv_ocl_sincos( (__clc_vec8_fp16_t __global *)(args_1)); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec8_fp16_t __spirv_ocl_sincos( __clc_vec8_float16_t args_0, __clc_vec8_float16_t __generic *args_1) { return __spirv_ocl_sincos(as_half8(args_0), @@ -6698,7 +6698,7 @@ _CLC_OVERLOAD _CLC_DEF __clc_vec16_fp16_t __spirv_ocl_sincos( (__clc_vec16_fp16_t __global *)(args_1)); } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED _CLC_OVERLOAD _CLC_DEF __clc_vec16_fp16_t __spirv_ocl_sincos( __clc_vec16_float16_t args_0, __clc_vec16_float16_t __generic *args_1) { return __spirv_ocl_sincos(as_half16(args_0), diff --git a/libclc/generic/libspirv/math/fract.inc b/libclc/generic/libspirv/math/fract.inc index 512efc3f8e885..4af2a8049deee 100644 --- a/libclc/generic/libspirv/math/fract.inc +++ b/libclc/generic/libspirv/math/fract.inc @@ -46,7 +46,7 @@ __spirv_ocl_fract(__CLC_GENTYPE x, private __CLC_GENTYPE *iptr) { FRACT_DEF(local); FRACT_DEF(global); -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED FRACT_DEF(generic); #endif diff --git a/libclc/generic/libspirv/math/frexp.cl b/libclc/generic/libspirv/math/frexp.cl index 4df1e827cfa76..6b05fe88832b4 100644 --- a/libclc/generic/libspirv/math/frexp.cl +++ b/libclc/generic/libspirv/math/frexp.cl @@ -24,7 +24,7 @@ #include #undef __CLC_ADDRESS_SPACE -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED #define __CLC_BODY #define __CLC_ADDRESS_SPACE generic #include diff --git a/libclc/generic/libspirv/math/lgamma_r.cl b/libclc/generic/libspirv/math/lgamma_r.cl index a84e9e6442c45..920cce8635dc4 100644 --- a/libclc/generic/libspirv/math/lgamma_r.cl +++ b/libclc/generic/libspirv/math/lgamma_r.cl @@ -659,7 +659,7 @@ _CLC_V_V_VP_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, half, __spirv_ocl_lgamma_r, half, #include #undef __CLC_ADDRSPACE -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED #define __CLC_ADDRSPACE generic #define __CLC_BODY #include diff --git a/libclc/generic/libspirv/math/modf.inc b/libclc/generic/libspirv/math/modf.inc index 887fde2151f03..9add4e7304503 100644 --- a/libclc/generic/libspirv/math/modf.inc +++ b/libclc/generic/libspirv/math/modf.inc @@ -41,7 +41,7 @@ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __spirv_ocl_modf(__CLC_GENTYPE x, MODF_DEF(local); MODF_DEF(global); -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED MODF_DEF(generic); #endif diff --git a/libclc/generic/libspirv/math/remquo.cl b/libclc/generic/libspirv/math/remquo.cl index 23d2a15d534aa..7a5a58298cc05 100644 --- a/libclc/generic/libspirv/math/remquo.cl +++ b/libclc/generic/libspirv/math/remquo.cl @@ -25,7 +25,7 @@ #include #undef __CLC_ADDRESS_SPACE -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED #define __CLC_BODY #define __CLC_ADDRESS_SPACE generic #include diff --git a/libclc/generic/libspirv/math/sincos.inc b/libclc/generic/libspirv/math/sincos.inc index 0f2e859392963..dde178ee719e0 100644 --- a/libclc/generic/libspirv/math/sincos.inc +++ b/libclc/generic/libspirv/math/sincos.inc @@ -16,7 +16,7 @@ __CLC_DECLARE_SINCOS(global, __CLC_GENTYPE) __CLC_DECLARE_SINCOS(local, __CLC_GENTYPE) __CLC_DECLARE_SINCOS(private, __CLC_GENTYPE) -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED __CLC_DECLARE_SINCOS(generic, __CLC_GENTYPE) #endif diff --git a/libclc/generic/libspirv/shared/vload.cl b/libclc/generic/libspirv/shared/vload.cl index 228df353f6806..0752b0aa8b665 100644 --- a/libclc/generic/libspirv/shared/vload.cl +++ b/libclc/generic/libspirv/shared/vload.cl @@ -59,7 +59,7 @@ *)(&x[16 * offset])); \ } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED #define VLOAD_VECTORIZE_GENERIC VLOAD_VECTORIZE #else // The generic address space isn't available, so make the macro do nothing @@ -107,7 +107,7 @@ float __clc_vload_half_float_helper__global(const __global half *); float __clc_vload_half_float_helper__local(const __local half *); float __clc_vload_half_float_helper__private(const __private half *); -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED float __clc_vload_half_float_helper__generic(const __generic half *); #endif @@ -170,7 +170,7 @@ GEN_VLOAD_HALF(__global) GEN_VLOAD_HALF(__local) GEN_VLOAD_HALF(__constant) -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED GEN_VLOAD_HALF(__generic) #endif diff --git a/libclc/generic/libspirv/shared/vstore.cl b/libclc/generic/libspirv/shared/vstore.cl index a769d43a3ff3d..eb85d35f8d4ca 100644 --- a/libclc/generic/libspirv/shared/vstore.cl +++ b/libclc/generic/libspirv/shared/vstore.cl @@ -58,7 +58,7 @@ *)(&mem[16 * offset])) = vec; \ } -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED #define VSTORE_VECTORIZE_GENERIC VSTORE_VECTORIZE #else // The generic address space isn't available, so make the macro do nothing @@ -105,7 +105,7 @@ VSTORE_ADDR_SPACES(half) DECLARE_HELPER(float, __private, __builtin_store_halff); DECLARE_HELPER(float, __global, __builtin_store_halff); DECLARE_HELPER(float, __local, __builtin_store_halff); -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED DECLARE_HELPER(float, __generic, __builtin_store_halff); #endif @@ -113,7 +113,7 @@ DECLARE_HELPER(float, __generic, __builtin_store_halff); DECLARE_HELPER(double, __private, __builtin_store_half); DECLARE_HELPER(double, __global, __builtin_store_half); DECLARE_HELPER(double, __local, __builtin_store_half); -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED DECLARE_HELPER(double, __generic, __builtin_store_half); #endif #endif diff --git a/libclc/generic/libspirv/shared/vstore_half.inc b/libclc/generic/libspirv/shared/vstore_half.inc index 55a367897ff1c..2cc716b1f74ed 100644 --- a/libclc/generic/libspirv/shared/vstore_half.inc +++ b/libclc/generic/libspirv/shared/vstore_half.inc @@ -22,7 +22,7 @@ FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __CLC_SCALAR_GENTYPE, __local, n); FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __CLC_SCALAR_GENTYPE, __global, n); -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __CLC_SCALAR_GENTYPE, __generic, n); #endif @@ -32,7 +32,7 @@ FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, FUNC_SCALAR(1, 1, __CLC_GENTYPE, __CLC_SCALAR_GENTYPE, __private); FUNC_SCALAR(1, 1, __CLC_GENTYPE, __CLC_SCALAR_GENTYPE, __local); FUNC_SCALAR(1, 1, __CLC_GENTYPE, __CLC_SCALAR_GENTYPE, __global); -#if _CLC_GENERIC_AS_SUPPORTED +#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED FUNC_SCALAR(1, 1, __CLC_GENTYPE, __CLC_SCALAR_GENTYPE, __generic); #endif #endif