Skip to content

Commit bdaf1e2

Browse files
authored
[libclc] Separate out generic AS support macros (#13792)
The previous model where we declare/define builtins based on whether target supports the generic address space was not able to capture the full complexity of what we need. We could see this in the fact that the two targets which we marked as not supporting the generic AS do in fact support it. The problem is rather that the target AS they map the generic AS to is the same target AS mapped to by the private AS. This problem hasn't properly been made apparent because all builtins we want to support with the generic AS also have overloads on the private AS. However, as can be seen in PRs like #13428, some targets want to support generic AS overloads of atomic builtins which don't also have private AS overloads. It's here that the simple dichotomy breaks down. This patch splits up the support of the generic AS into: 1. The target doesn't support the generic AS 2. The target supports the generic AS as a distinct target AS 3. The target supports the generic AS mapped identically as the private the AS All of our previous uses of case 1 have been migrated to case 3. These targets can make use of case 2 in the future to support generic AS builtins where no private AS builtins are supported. Note how we hardcode the assumption that the clash is on the private address space. This is unfortunate but for simplicity as it's the case for the two targets we care about. It was already being made, but in a less obvious way. There are ways of loosening this assumption if we ever needed to but it would currently complicate the code for untested scenarios.
1 parent 0e109f6 commit bdaf1e2

30 files changed

+113
-90
lines changed

libclc/CMakeLists.txt

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -346,27 +346,32 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
346346

347347
message( STATUS " device: ${d} ( ${${d}_aliases} )" )
348348

349+
# Note: when declaring builtins, we must consider that even if a target
350+
# formally/nominally supports the generic address space, in practice that
351+
# target may map it to the same target address space as another address
352+
# space (often the private one). In such cases we must be careful not to
353+
# multiply-define a builtin in a single target address space, as it would
354+
# result in a mangling clash.
355+
# For this reason we must consider the target support of the generic
356+
# address space separately from the *implementation* decision about whether
357+
# to declare certain builtins in that address space.
349358
set ( supports_generic_addrspace TRUE )
359+
# Note: we assume that if there is no distinct generic address space, it
360+
# maps to the private address space.
361+
set ( has_distinct_generic_addrspace TRUE )
350362
if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 )
351363
set( opt_flags -O3 )
352364
set( spvflags --spirv-max-version=1.1 )
353365
elseif( ARCH STREQUAL clspv OR ARCH STREQUAL clspv64 )
354366
set( opt_flags -O3 )
355367
elseif( ARCH STREQUAL nvptx OR ARCH STREQUAL nvptx64 )
356368
set( opt_flags -O3 "--nvvm-reflect-enable=false" )
357-
# Note: when declaring builtins, we don't consider NVIDIA as supporting
358-
# the generic address space. This is because it maps to the same target
359-
# address space as the private address space, resulting in a mangling
360-
# clash.
361-
# Since we can't declare builtins overloaded on both address spaces
362-
# simultaneously, we choose declare the builtins using the private space,
363-
# which will also work for the generic address space.
364-
set( supports_generic_addrspace FALSE )
369+
set( has_distinct_generic_addrspace FALSE )
365370
elseif( ARCH STREQUAL amdgcn )
366371
set( opt_flags -O3 --amdgpu-oclc-reflect-enable=false )
367372
elseif( ARCH STREQUAL x86_64)
368373
set( opt_flags )
369-
set( supports_generic_addrspace FALSE )
374+
set( has_distinct_generic_addrspace FALSE )
370375
else()
371376
set( opt_flags -O3 )
372377
endif()
@@ -379,16 +384,18 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
379384
file( MAKE_DIRECTORY ${LIBCLC_ARCH_OBJFILE_DIR} )
380385

381386
# OpenCL 3.0 extensions
382-
list( APPEND flags -cl-std=CL3.0 "-Xclang" )
383387
string(CONCAT CL_3_0_EXTENSIONS
384388
"-cl-ext="
385389
"+cl_khr_fp64,"
386390
"+cl_khr_fp16,"
387391
"+__opencl_c_3d_image_writes,"
388392
"+__opencl_c_images,"
389393
"+cl_khr_3d_image_writes")
390-
if(supports_generic_addrspace)
394+
if( supports_generic_addrspace )
391395
string( APPEND CL_3_0_EXTENSIONS ",+__opencl_c_generic_address_space" )
396+
if( has_distinct_generic_addrspace )
397+
list( APPEND flags -D__CLC_DISTINCT_GENERIC_ADDRSPACE__ )
398+
endif()
392399
else()
393400
# Explictly disable opencl_c_generic_address_space (it may be enabled
394401
# by default on some targets). We also disable opencl_c_pipes and
@@ -397,7 +404,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
397404
string( APPEND CL_3_0_EXTENSIONS ",-__opencl_c_pipes" )
398405
string( APPEND CL_3_0_EXTENSIONS ",-__opencl_c_device_enqueue" )
399406
endif()
400-
list( APPEND flags ${CL_3_0_EXTENSIONS})
407+
list( APPEND flags -cl-std=CL3.0 "-Xclang" ${CL_3_0_EXTENSIONS} )
401408

402409
# Add platform specific flags
403410
if(WIN32)

libclc/generic/include/clc/clc.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,16 @@
1818
(__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && \
1919
defined(__opencl_c_generic_address_space))
2020
#define _CLC_GENERIC_AS_SUPPORTED 1
21+
// Note that we hard-code the assumption that a non-distinct address space means
22+
// that the target maps the generic address space to the private address space.
23+
#ifdef __CLC_DISTINCT_GENERIC_ADDRSPACE__
24+
#define _CLC_DISTINCT_GENERIC_AS_SUPPORTED 1
25+
#else
26+
#define _CLC_DISTINCT_GENERIC_AS_SUPPORTED 0
27+
#endif
2128
#else
2229
#define _CLC_GENERIC_AS_SUPPORTED 0
30+
#define _CLC_DISTINCT_GENERIC_AS_SUPPORTED 0
2331
#endif
2432

2533
/* Function Attributes */

libclc/generic/include/clc/math/fract.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE fract(__CLC_GENTYPE x, global __CLC_GENTYPE *iptr);
2424
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE fract(__CLC_GENTYPE x, local __CLC_GENTYPE *iptr);
2525
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE fract(__CLC_GENTYPE x, private __CLC_GENTYPE *iptr);
26-
#if _CLC_GENERIC_AS_SUPPORTED
26+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
2727
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE fract(__CLC_GENTYPE x, generic __CLC_GENTYPE *iptr);
2828
#endif
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE frexp(__CLC_GENTYPE x, global __CLC_INTN *iptr);
22
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE frexp(__CLC_GENTYPE x, local __CLC_INTN *iptr);
33
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE frexp(__CLC_GENTYPE x, private __CLC_INTN *iptr);
4-
#if _CLC_GENERIC_AS_SUPPORTED
4+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
55
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE frexp(__CLC_GENTYPE x, generic __CLC_INTN *iptr);
66
#endif

libclc/generic/include/clc/math/modf.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE modf(__CLC_GENTYPE x, global __CLC_GENTYPE *iptr);
2424
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE modf(__CLC_GENTYPE x, local __CLC_GENTYPE *iptr);
2525
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE modf(__CLC_GENTYPE x, private __CLC_GENTYPE *iptr);
26-
#if _CLC_GENERIC_AS_SUPPORTED
26+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
2727
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE modf(__CLC_GENTYPE x, generic __CLC_GENTYPE *iptr);
2828
#endif

libclc/generic/include/clc/math/remquo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <clc/math/gentype.inc>
1616
#undef __CLC_ADDRESS_SPACE
1717

18-
#if _CLC_GENERIC_AS_SUPPORTED
18+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
1919
#define __CLC_BODY <clc/math/remquo.inc>
2020
#define __CLC_ADDRESS_SPACE generic
2121
#include <clc/math/gentype.inc>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE sincos (__CLC_GENTYPE x, global __CLC_GENTYPE * cosval);
22
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE sincos (__CLC_GENTYPE x, local __CLC_GENTYPE * cosval);
33
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE sincos (__CLC_GENTYPE x, private __CLC_GENTYPE * cosval);
4-
#if _CLC_GENERIC_AS_SUPPORTED
4+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
55
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE sincos (__CLC_GENTYPE x, generic __CLC_GENTYPE * cosval);
66
#endif

libclc/generic/include/clc/shared/vload.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
_CLC_VLOAD_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE##8, 8, ADDR_SPACE) \
1010
_CLC_VLOAD_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE##16, 16, ADDR_SPACE)
1111

12-
#if _CLC_GENERIC_AS_SUPPORTED
12+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
1313
#define _CLC_VECTOR_VLOAD_GENERIC_DECL _CLC_VECTOR_VLOAD_DECL
1414
#else
1515
// 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)
6161
_CLC_VLOAD_DECL(a_half, half, float, , __local)
6262
_CLC_VLOAD_DECL(a_half, half, float, , __private)
6363

64-
#if _CLC_GENERIC_AS_SUPPORTED
64+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
6565
_CLC_VLOAD_DECL(_half, half, float, , __generic)
6666
_CLC_VLOAD_DECL(a_half, half, float, , __generic)
6767
#endif

libclc/generic/include/clc/shared/vstore.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
_CLC_VSTORE_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE##8, 8, ADDR_SPACE, RND) \
1010
_CLC_VSTORE_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE##16, 16, ADDR_SPACE, RND)
1111

12-
#if _CLC_GENERIC_AS_SUPPORTED
12+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
1313
#define _CLC_VSTORE_GENERIC_DECL _CLC_VSTORE_DECL
1414
#define _CLC_VECTOR_VSTORE_GENERIC_DECL _CLC_VECTOR_VSTORE_DECL
1515
#else

libclc/generic/include/spirv/spirv.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,16 @@
2424
(__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && \
2525
defined(__opencl_c_generic_address_space))
2626
#define _CLC_GENERIC_AS_SUPPORTED 1
27+
// Note that we hard-code the assumption that a non-distinct address space means
28+
// that the target maps the generic address space to the private address space.
29+
#if __CLC_DISTINCT_GENERIC_ADDRSPACE__
30+
#define _CLC_DISTINCT_GENERIC_AS_SUPPORTED 1
31+
#else
32+
#define _CLC_DISTINCT_GENERIC_AS_SUPPORTED 0
33+
#endif
2734
#else
2835
#define _CLC_GENERIC_AS_SUPPORTED 0
36+
#define _CLC_DISTINCT_GENERIC_AS_SUPPORTED 0
2937
#endif
3038

3139
/* Function Attributes */

libclc/generic/include/spirv/spirv_builtins.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14476,7 +14476,7 @@ _CLC_OVERLOAD _CLC_DECL __clc_vec16_fp16_t
1447614476
__spirv_ocl_fract(__clc_vec16_fp16_t, __clc_vec16_fp16_t __global *);
1447714477
#endif
1447814478

14479-
#if _CLC_GENERIC_AS_SUPPORTED
14479+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
1448014480
_CLC_OVERLOAD _CLC_DECL __clc_fp32_t
1448114481
__spirv_ocl_fract(__clc_fp32_t, __clc_fp32_t __generic *);
1448214482

@@ -14637,7 +14637,7 @@ _CLC_OVERLOAD _CLC_DECL __clc_vec16_fp16_t
1463714637
__spirv_ocl_frexp(__clc_vec16_fp16_t, __clc_vec16_int32_t __global *);
1463814638
#endif
1463914639

14640-
#if _CLC_GENERIC_AS_SUPPORTED
14640+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
1464114641
_CLC_OVERLOAD _CLC_DECL __clc_fp32_t
1464214642
__spirv_ocl_frexp(__clc_fp32_t, __clc_int32_t __generic *);
1464314643
_CLC_OVERLOAD _CLC_DECL __clc_vec2_fp32_t
@@ -15218,7 +15218,7 @@ _CLC_OVERLOAD _CLC_DECL __clc_vec16_fp16_t
1521815218
__spirv_ocl_lgamma_r(__clc_vec16_fp16_t, __clc_vec16_int32_t __global *);
1521915219
#endif
1522015220

15221-
#if _CLC_GENERIC_AS_SUPPORTED
15221+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
1522215222
_CLC_OVERLOAD _CLC_DECL __clc_fp32_t
1522315223
__spirv_ocl_lgamma_r(__clc_fp32_t, __clc_int32_t __generic *);
1522415224
_CLC_OVERLOAD _CLC_DECL __clc_vec2_fp32_t
@@ -15767,7 +15767,7 @@ _CLC_OVERLOAD _CLC_DECL __clc_vec16_fp16_t
1576715767
__spirv_ocl_modf(__clc_vec16_fp16_t, __clc_vec16_fp16_t __global *);
1576815768
#endif
1576915769

15770-
#if _CLC_GENERIC_AS_SUPPORTED
15770+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
1577115771
_CLC_OVERLOAD _CLC_DECL __clc_fp32_t __spirv_ocl_modf(__clc_fp32_t,
1577215772
__clc_fp32_t __generic *);
1577315773
_CLC_OVERLOAD _CLC_DECL __clc_vec2_fp32_t
@@ -16752,7 +16752,7 @@ _CLC_OVERLOAD _CLC_DECL __clc_vec16_fp16_t __spirv_ocl_remquo(
1675216752
__clc_vec16_fp16_t, __clc_vec16_fp16_t, __clc_vec16_int32_t __global *);
1675316753
#endif
1675416754

16755-
#if _CLC_GENERIC_AS_SUPPORTED
16755+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
1675616756
_CLC_OVERLOAD _CLC_DECL __clc_fp32_t
1675716757
__spirv_ocl_remquo(__clc_fp32_t, __clc_fp32_t, __clc_int32_t __generic *);
1675816758
_CLC_OVERLOAD _CLC_DECL __clc_vec2_fp32_t __spirv_ocl_remquo(
@@ -19016,7 +19016,7 @@ _CLC_OVERLOAD _CLC_DECL __clc_vec16_fp16_t
1901619016
__spirv_ocl_sincos(__clc_vec16_fp16_t, __clc_vec16_fp16_t __global *);
1901719017
#endif
1901819018

19019-
#if _CLC_GENERIC_AS_SUPPORTED
19019+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
1902019020
_CLC_OVERLOAD _CLC_DECL __clc_fp32_t
1902119021
__spirv_ocl_sincos(__clc_fp32_t, __clc_fp32_t __generic *);
1902219022
_CLC_OVERLOAD _CLC_DECL __clc_vec2_fp32_t

libclc/generic/lib/math/fract.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
FRACT_DEF(private);
4040
FRACT_DEF(local);
4141
FRACT_DEF(global);
42-
#if _CLC_GENERIC_AS_SUPPORTED
42+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
4343
FRACT_DEF(generic);
4444
#endif
4545

libclc/generic/lib/math/frexp.cl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <clc/math/gentype.inc>
1717
#undef __CLC_ADDRESS_SPACE
1818

19-
#if _CLC_GENERIC_AS_SUPPORTED
19+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
2020
#define __CLC_BODY <frexp.inc>
2121
#define __CLC_ADDRESS_SPACE generic
2222
#include <clc/math/gentype.inc>

libclc/generic/lib/math/modf.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE modf(__CLC_GENTYPE x, private __CLC_GENTYPE
4343

4444
MODF_DEF(local);
4545
MODF_DEF(global);
46-
#if _CLC_GENERIC_AS_SUPPORTED
46+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
4747
MODF_DEF(generic);
4848
#endif
4949

libclc/generic/lib/math/remquo.cl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <clc/math/gentype.inc>
1717
#undef __CLC_ADDRESS_SPACE
1818

19-
#if _CLC_GENERIC_AS_SUPPORTED
19+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
2020
#define __CLC_BODY <remquo.inc>
2121
#define __CLC_ADDRESS_SPACE generic
2222
#include <clc/math/gentype.inc>

libclc/generic/lib/math/sincos.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
__CLC_DECLARE_SINCOS(global, __CLC_GENTYPE)
99
__CLC_DECLARE_SINCOS(local, __CLC_GENTYPE)
1010
__CLC_DECLARE_SINCOS(private, __CLC_GENTYPE)
11-
#if _CLC_GENERIC_AS_SUPPORTED
11+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
1212
__CLC_DECLARE_SINCOS(generic, __CLC_GENTYPE)
1313
#endif
1414

libclc/generic/lib/shared/vload.cl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
return *((const ADDR_SPACE less_aligned_##ADDR_SPACE##PRIM_TYPE##16*) (&x[16*offset])); \
2828
}
2929

30-
#if _CLC_GENERIC_AS_SUPPORTED
30+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
3131
#define VLOAD_VECTORIZE_GENERIC VLOAD_VECTORIZE
3232
#else
3333
// 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 *);
7070
float __clc_vload_half_float_helper__global(const __global half *);
7171
float __clc_vload_half_float_helper__local(const __local half *);
7272
float __clc_vload_half_float_helper__private(const __private half *);
73-
#if _CLC_GENERIC_AS_SUPPORTED
73+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
7474
float __clc_vload_half_float_helper__generic(const __generic half *);
7575
#endif
7676

libclc/generic/lib/shared/vload_half.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __local);
1313
FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __global);
1414
FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __constant);
15-
#if _CLC_GENERIC_AS_SUPPORTED
15+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
1616
FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __generic);
1717
#endif
1818

@@ -22,7 +22,7 @@
2222
FUNC(, 1, 1, __CLC_GENTYPE, __local);
2323
FUNC(, 1, 1, __CLC_GENTYPE, __global);
2424
FUNC(, 1, 1, __CLC_GENTYPE, __constant);
25-
#if _CLC_GENERIC_AS_SUPPORTED
25+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
2626
FUNC(, 1, 1, __CLC_GENTYPE, __generic);
2727
#endif
2828
#endif

libclc/generic/lib/shared/vstore.cl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*((ADDR_SPACE less_aligned_##ADDR_SPACE##PRIM_TYPE##16*) (&mem[16*offset])) = vec; \
2929
}
3030

31-
#if _CLC_GENERIC_AS_SUPPORTED
31+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
3232
#define VSTORE_VECTORIZE_GENERIC VSTORE_VECTORIZE
3333
#else
3434
// The generic address space isn't available, so make the macro do nothing
@@ -75,15 +75,15 @@ _CLC_DEF void __clc_vstore_half_##STYPE##_helper##AS(STYPE s, AS half *d) \
7575
DECLARE_HELPER(float, __private, __builtin_store_halff);
7676
DECLARE_HELPER(float, __global, __builtin_store_halff);
7777
DECLARE_HELPER(float, __local, __builtin_store_halff);
78-
#if _CLC_GENERIC_AS_SUPPORTED
78+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
7979
DECLARE_HELPER(float, __generic, __builtin_store_halff);
8080
#endif
8181

8282
#ifdef cl_khr_fp64
8383
DECLARE_HELPER(double, __private, __builtin_store_half);
8484
DECLARE_HELPER(double, __global, __builtin_store_half);
8585
DECLARE_HELPER(double, __local, __builtin_store_half);
86-
#if _CLC_GENERIC_AS_SUPPORTED
86+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
8787
DECLARE_HELPER(double, __generic, __builtin_store_half);
8888
#endif
8989
#endif

libclc/generic/lib/shared/vstore_half.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __CLC_SCALAR_GENTYPE, __private);
1212
FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __CLC_SCALAR_GENTYPE, __local);
1313
FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __CLC_SCALAR_GENTYPE, __global);
14-
#if _CLC_GENERIC_AS_SUPPORTED
14+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
1515
FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __CLC_SCALAR_GENTYPE, __generic);
1616
#endif
1717

@@ -20,7 +20,7 @@
2020
FUNC(, 1, 1, __CLC_GENTYPE, __CLC_SCALAR_GENTYPE, __private);
2121
FUNC(, 1, 1, __CLC_GENTYPE, __CLC_SCALAR_GENTYPE, __local);
2222
FUNC(, 1, 1, __CLC_GENTYPE, __CLC_SCALAR_GENTYPE, __global);
23-
#if _CLC_GENERIC_AS_SUPPORTED
23+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
2424
FUNC(, 1, 1, __CLC_GENTYPE, __CLC_SCALAR_GENTYPE, __generic);
2525
#endif
2626
#endif

0 commit comments

Comments
 (0)