Skip to content

Commit 253bbc8

Browse files
committed
[libclc] Support the generic address space
This commit provides definitions of builtins with the generic address space. It is assumed that all current libclc targets can support the generic address space. One concept to consider is the difference between supporting the generic address space from the user's perspective, and the requirement for libclc as a compiler implementation detail to define separate generic address space builtins. In practice a target (like NVPTX) might notionally support the generic address space, but it's mapped to the same LLVM target address space as the private address space. Therefore libclc may not define both private and generic overloads of the same builtin. We track these two concepts separately, and make the assumption that if the generic address space does clash with another, it's with the private one.
1 parent 694a42f commit 253bbc8

20 files changed

+169
-4
lines changed

libclc/CMakeLists.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,12 +420,37 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
420420
-D${CLC_TARGET_DEFINE}
421421
# All libclc builtin libraries see CLC headers
422422
-I${CMAKE_CURRENT_SOURCE_DIR}/clc/include
423+
# Error on undefined macros
424+
-Werror=undef
423425
)
424426

425427
if( NOT "${cpu}" STREQUAL "" )
426428
list( APPEND build_flags -mcpu=${cpu} )
427429
endif()
428430

431+
# Generic address space support.
432+
# Note: when declaring builtins, we must consider that even if a target
433+
# formally/nominally supports the generic address space, in practice that
434+
# target may map it to the same target address space as another address
435+
# space (often the private one). In such cases we must be careful not to
436+
# multiply-define a builtin in a single target address space, as it would
437+
# result in a mangling clash.
438+
# For this reason we must consider the target support of the generic
439+
# address space separately from the *implementation* decision about whether
440+
# to declare certain builtins in that address space.
441+
# FIXME: Shouldn't clang automatically enable this extension based on the
442+
# target?
443+
list( APPEND build_flags "-Xclang" "-cl-ext=+__opencl_c_generic_address_space" )
444+
# Note: we assume that if there is no distinct generic address space, it
445+
# maps to the private address space.
446+
set ( has_distinct_generic_addrspace TRUE )
447+
if( ARCH STREQUAL nvptx OR ARCH STREQUAL nvptx64 )
448+
set ( has_distinct_generic_addrspace FALSE )
449+
endif()
450+
if( has_distinct_generic_addrspace )
451+
list( APPEND build_flags -D__CLC_DISTINCT_GENERIC_ADDRSPACE__ )
452+
endif()
453+
429454
set( clc_build_flags ${build_flags} -DCLC_INTERNAL )
430455

431456
add_libclc_builtin_set(

libclc/clc/include/clc/clcfunc.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,20 @@
2323
#define _CLC_DEF __attribute__((always_inline))
2424
#endif
2525

26+
#if __OPENCL_C_VERSION__ == CL_VERSION_2_0 || \
27+
(__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && \
28+
defined(__opencl_c_generic_address_space))
29+
#define _CLC_GENERIC_AS_SUPPORTED 1
30+
// Note that we hard-code the assumption that a non-distinct address space means
31+
// that the target maps the generic address space to the private address space.
32+
#ifdef __CLC_DISTINCT_GENERIC_ADDRSPACE__
33+
#define _CLC_DISTINCT_GENERIC_AS_SUPPORTED 1
34+
#else
35+
#define _CLC_DISTINCT_GENERIC_AS_SUPPORTED 0
36+
#endif
37+
#else
38+
#define _CLC_GENERIC_AS_SUPPORTED 0
39+
#define _CLC_DISTINCT_GENERIC_AS_SUPPORTED 0
40+
#endif
41+
2642
#endif // __CLC_CLCFUNC_H_

libclc/clc/include/clc/math/unary_decl_with_int_ptr.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x,
1212
local __CLC_INTN *iptr);
1313
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x,
1414
private __CLC_INTN *iptr);
15+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
16+
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x,
17+
generic __CLC_INTN *iptr);
18+
#endif

libclc/clc/include/clc/math/unary_decl_with_ptr.inc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,8 @@ _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x,
1212
local __CLC_GENTYPE *ptr);
1313
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE
1414
__CLC_FUNCTION(__CLC_GENTYPE x, private __CLC_GENTYPE *ptr);
15+
16+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
17+
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE
18+
__CLC_FUNCTION(__CLC_GENTYPE x, generic __CLC_GENTYPE *ptr);
19+
#endif

libclc/clc/include/clc/math/unary_def_with_int_ptr.inc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,10 @@ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x,
2626
local __CLC_INTN *iptr) {
2727
return __CLC_FUNCTION(FUNCTION)(x, iptr);
2828
}
29+
30+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
31+
_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x,
32+
generic __CLC_INTN *iptr) {
33+
return __CLC_FUNCTION(FUNCTION)(x, iptr);
34+
}
35+
#endif

libclc/clc/include/clc/math/unary_def_with_ptr.inc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,10 @@ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x,
2626
local __CLC_GENTYPE *ptr) {
2727
return __CLC_FUNCTION(FUNCTION)(x, ptr);
2828
}
29+
30+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
31+
_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x,
32+
generic __CLC_GENTYPE *ptr) {
33+
return __CLC_FUNCTION(FUNCTION)(x, ptr);
34+
}
35+
#endif

libclc/clc/lib/generic/math/clc_frexp.cl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,10 @@
2828
#define __CLC_ADDRESS_SPACE local
2929
#include <clc/math/gentype.inc>
3030
#undef __CLC_ADDRESS_SPACE
31+
32+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
33+
#define __CLC_BODY <clc_frexp.inc>
34+
#define __CLC_ADDRESS_SPACE generic
35+
#include <clc/math/gentype.inc>
36+
#undef __CLC_ADDRESS_SPACE
37+
#endif

libclc/clc/lib/generic/math/clc_modf.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,8 @@ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_modf(__CLC_GENTYPE x,
2323
CLC_MODF_DEF(local);
2424
CLC_MODF_DEF(global);
2525

26+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
27+
CLC_MODF_DEF(generic);
28+
#endif
29+
2630
#undef CLC_MODF_DEF

libclc/clspv/lib/shared/vstore_half.inc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,17 @@
1313
FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_GENTYPE, __private);
1414
FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_GENTYPE, __local);
1515
FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_GENTYPE, __global);
16+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
17+
FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_GENTYPE, __generic);
18+
#endif
1619

1720
#undef __CLC_OFFSET
1821
#else
1922
FUNC(, 1, __CLC_GENTYPE, __private);
2023
FUNC(, 1, __CLC_GENTYPE, __local);
2124
FUNC(, 1, __CLC_GENTYPE, __global);
25+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
26+
FUNC(, 1, __CLC_GENTYPE, __generic);
27+
#endif
2228
#endif
2329
#endif

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@
99
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE frexp(__CLC_GENTYPE x, global __CLC_INTN *iptr);
1010
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE frexp(__CLC_GENTYPE x, local __CLC_INTN *iptr);
1111
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE frexp(__CLC_GENTYPE x, private __CLC_INTN *iptr);
12+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
13+
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE frexp(__CLC_GENTYPE x,
14+
generic __CLC_INTN *iptr);
15+
#endif

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,11 @@
2323
#include <clc/math/gentype.inc>
2424
#undef __CLC_ADDRESS_SPACE
2525

26+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
27+
#define __CLC_BODY <clc/math/remquo_decl.inc>
28+
#define __CLC_ADDRESS_SPACE generic
29+
#include <clc/math/gentype.inc>
30+
#undef __CLC_ADDRESS_SPACE
31+
#endif
32+
2633
#undef __CLC_FUNCTION

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE sincos(__CLC_GENTYPE x,
1212
local __CLC_GENTYPE *cosval);
1313
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE sincos(__CLC_GENTYPE x,
1414
private __CLC_GENTYPE *cosval);
15+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
16+
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE sincos(__CLC_GENTYPE x,
17+
generic __CLC_GENTYPE *cosval);
18+
#endif

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,19 @@
1717
_CLC_VLOAD_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE##8, 8, ADDR_SPACE) \
1818
_CLC_VLOAD_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE##16, 16, ADDR_SPACE)
1919

20+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
21+
#define _CLC_VECTOR_VLOAD_GENERIC_DECL _CLC_VECTOR_VLOAD_DECL
22+
#else
23+
// The generic address space isn't available, so make the macro do nothing
24+
#define _CLC_VECTOR_VLOAD_GENERIC_DECL(X, Y, Z, W)
25+
#endif
26+
2027
#define _CLC_VECTOR_VLOAD_PRIM3(SUFFIX, MEM_TYPE, PRIM_TYPE) \
2128
_CLC_VECTOR_VLOAD_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE, __private) \
2229
_CLC_VECTOR_VLOAD_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE, __local) \
2330
_CLC_VECTOR_VLOAD_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE, __constant) \
24-
_CLC_VECTOR_VLOAD_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE, __global)
31+
_CLC_VECTOR_VLOAD_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE, __global) \
32+
_CLC_VECTOR_VLOAD_GENERIC_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE, __generic)
2533

2634
#define _CLC_VECTOR_VLOAD_PRIM1(PRIM_TYPE) \
2735
_CLC_VECTOR_VLOAD_PRIM3(, PRIM_TYPE, PRIM_TYPE)
@@ -61,7 +69,13 @@ _CLC_VLOAD_DECL(a_half, half, float, , __global)
6169
_CLC_VLOAD_DECL(a_half, half, float, , __local)
6270
_CLC_VLOAD_DECL(a_half, half, float, , __private)
6371

72+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
73+
_CLC_VLOAD_DECL(_half, half, float, , __generic)
74+
_CLC_VLOAD_DECL(a_half, half, float, , __generic)
75+
#endif
76+
6477
#undef _CLC_VLOAD_DECL
6578
#undef _CLC_VECTOR_VLOAD_DECL
6679
#undef _CLC_VECTOR_VLOAD_PRIM3
6780
#undef _CLC_VECTOR_VLOAD_PRIM1
81+
#undef _CLC_VECTOR_VLOAD_GENERIC_DECL

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,20 @@
1717
_CLC_VSTORE_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE##8, 8, ADDR_SPACE, RND) \
1818
_CLC_VSTORE_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE##16, 16, ADDR_SPACE, RND)
1919

20+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
21+
#define _CLC_VSTORE_GENERIC_DECL _CLC_VSTORE_DECL
22+
#define _CLC_VECTOR_VSTORE_GENERIC_DECL _CLC_VECTOR_VSTORE_DECL
23+
#else
24+
// The generic address space isn't available, so make the macros do nothing
25+
#define _CLC_VSTORE_GENERIC_DECL(X, Y, Z, W, V, U)
26+
#define _CLC_VECTOR_VSTORE_GENERIC_DECL(X, Y, Z, W, V)
27+
#endif
28+
2029
#define _CLC_VECTOR_VSTORE_PRIM3(SUFFIX, MEM_TYPE, PRIM_TYPE, RND) \
2130
_CLC_VECTOR_VSTORE_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE, __private, RND) \
2231
_CLC_VECTOR_VSTORE_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE, __local, RND) \
23-
_CLC_VECTOR_VSTORE_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE, __global, RND)
32+
_CLC_VECTOR_VSTORE_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE, __global, RND) \
33+
_CLC_VECTOR_VSTORE_GENERIC_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE, __generic, RND)
2434

2535
#define _CLC_VECTOR_VSTORE_PRIM1(PRIM_TYPE) \
2636
_CLC_VECTOR_VSTORE_PRIM3(, PRIM_TYPE, PRIM_TYPE, )
@@ -29,10 +39,12 @@
2939
_CLC_VSTORE_DECL(_half, half, PRIM_TYPE, , __private, RND) \
3040
_CLC_VSTORE_DECL(_half, half, PRIM_TYPE, , __local, RND) \
3141
_CLC_VSTORE_DECL(_half, half, PRIM_TYPE, , __global, RND) \
42+
_CLC_VSTORE_GENERIC_DECL(_half, half, PRIM_TYPE, , __generic, RND) \
3243
_CLC_VECTOR_VSTORE_PRIM3(_half, half, PRIM_TYPE, RND) \
3344
_CLC_VSTORE_DECL(a_half, half, PRIM_TYPE, , __private, RND) \
3445
_CLC_VSTORE_DECL(a_half, half, PRIM_TYPE, , __local, RND) \
3546
_CLC_VSTORE_DECL(a_half, half, PRIM_TYPE, , __global, RND) \
47+
_CLC_VSTORE_GENERIC_DECL(a_half, half, PRIM_TYPE, , __generic, RND) \
3648
_CLC_VECTOR_VSTORE_PRIM3(a_half, half, PRIM_TYPE, RND)
3749

3850
_CLC_VECTOR_VSTORE_PRIM1(char)
@@ -65,6 +77,8 @@ _CLC_VECTOR_VSTORE_PRIM1(half)
6577
#endif
6678

6779
#undef _CLC_VSTORE_DECL
80+
#undef _CLC_VSTORE_GENERIC_DECL
6881
#undef _CLC_VECTOR_VSTORE_DECL
6982
#undef _CLC_VECTOR_VSTORE_PRIM3
7083
#undef _CLC_VECTOR_VSTORE_PRIM1
84+
#undef _CLC_VECTOR_VSTORE_GENERIC_DECL

libclc/generic/lib/math/remquo.cl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,10 @@
2323
#define __CLC_ADDRESS_SPACE private
2424
#include <clc/math/gentype.inc>
2525
#undef __CLC_ADDRESS_SPACE
26+
27+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
28+
#define __CLC_BODY <remquo.inc>
29+
#define __CLC_ADDRESS_SPACE generic
30+
#include <clc/math/gentype.inc>
31+
#undef __CLC_ADDRESS_SPACE
32+
#endif

libclc/generic/lib/math/sincos.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@
1515
__CLC_DECLARE_SINCOS(global, __CLC_GENTYPE)
1616
__CLC_DECLARE_SINCOS(local, __CLC_GENTYPE)
1717
__CLC_DECLARE_SINCOS(private, __CLC_GENTYPE)
18+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
19+
__CLC_DECLARE_SINCOS(generic, __CLC_GENTYPE)
20+
#endif
1821

1922
#undef __CLC_DECLARE_SINCOS

libclc/generic/lib/shared/vload.cl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,19 @@
5151
*)(&x[16 * offset])); \
5252
}
5353

54+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
55+
#define VLOAD_VECTORIZE_GENERIC VLOAD_VECTORIZE
56+
#else
57+
// The generic address space isn't available, so make the macro do nothing
58+
#define VLOAD_VECTORIZE_GENERIC(X, Y)
59+
#endif
60+
5461
#define VLOAD_ADDR_SPACES(__CLC_SCALAR_GENTYPE) \
5562
VLOAD_VECTORIZE(__CLC_SCALAR_GENTYPE, __private) \
5663
VLOAD_VECTORIZE(__CLC_SCALAR_GENTYPE, __local) \
5764
VLOAD_VECTORIZE(__CLC_SCALAR_GENTYPE, __constant) \
58-
VLOAD_VECTORIZE(__CLC_SCALAR_GENTYPE, __global)
65+
VLOAD_VECTORIZE(__CLC_SCALAR_GENTYPE, __global) \
66+
VLOAD_VECTORIZE_GENERIC(__CLC_SCALAR_GENTYPE, __generic)
5967

6068
#define VLOAD_TYPES() \
6169
VLOAD_ADDR_SPACES(char) \
@@ -130,3 +138,4 @@ VLOAD_ADDR_SPACES(half)
130138
#undef VLOAD_TYPES
131139
#undef VLOAD_ADDR_SPACES
132140
#undef VLOAD_VECTORIZE
141+
#undef VLOAD_VECTORIZE_GENERIC

libclc/generic/lib/shared/vload_half.inc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,18 @@ FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __private);
2020
FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __local);
2121
FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __global);
2222
FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __constant);
23+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
24+
FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __generic);
25+
#endif
2326

2427
#undef __CLC_OFFSET
2528
#else
2629
FUNC(, 1, 1, __CLC_GENTYPE, __private);
2730
FUNC(, 1, 1, __CLC_GENTYPE, __local);
2831
FUNC(, 1, 1, __CLC_GENTYPE, __global);
2932
FUNC(, 1, 1, __CLC_GENTYPE, __constant);
33+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
34+
FUNC(, 1, 1, __CLC_GENTYPE, __generic);
35+
#endif
3036
#endif
3137
#endif

libclc/generic/lib/shared/vstore.cl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,18 @@
5050
*)(&mem[16 * offset])) = vec; \
5151
}
5252

53+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
54+
#define VSTORE_VECTORIZE_GENERIC VSTORE_VECTORIZE
55+
#else
56+
// The generic address space isn't available, so make the macro do nothing
57+
#define VSTORE_VECTORIZE_GENERIC(X, Y)
58+
#endif
59+
5360
#define VSTORE_ADDR_SPACES(__CLC_SCALAR___CLC_GENTYPE) \
5461
VSTORE_VECTORIZE(__CLC_SCALAR___CLC_GENTYPE, __private) \
5562
VSTORE_VECTORIZE(__CLC_SCALAR___CLC_GENTYPE, __local) \
56-
VSTORE_VECTORIZE(__CLC_SCALAR___CLC_GENTYPE, __global)
63+
VSTORE_VECTORIZE(__CLC_SCALAR___CLC_GENTYPE, __global) \
64+
VSTORE_VECTORIZE_GENERIC(__CLC_SCALAR___CLC_GENTYPE, __generic)
5765

5866
VSTORE_ADDR_SPACES(char)
5967
VSTORE_ADDR_SPACES(uchar)
@@ -249,3 +257,4 @@ _CLC_DEF _CLC_OVERLOAD double __clc_rte(double x) {
249257
#undef DECLARE_HELPER
250258
#undef VSTORE_ADDR_SPACES
251259
#undef VSTORE_VECTORIZE
260+
#undef VSTORE_VECTORIZE_GENERIC

libclc/generic/lib/shared/vstore_half.inc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,19 @@ FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __local,
3131
STORE_HALF_BUILTIN);
3232
FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __global,
3333
STORE_HALF_BUILTIN);
34+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
35+
FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __generic,
36+
STORE_HALF_BUILTIN);
37+
#endif
3438

3539
#undef __CLC_OFFSET
3640
#else
3741
FUNC(, 1, 1, __CLC_GENTYPE, __private, STORE_HALF_BUILTIN);
3842
FUNC(, 1, 1, __CLC_GENTYPE, __local, STORE_HALF_BUILTIN);
3943
FUNC(, 1, 1, __CLC_GENTYPE, __global, STORE_HALF_BUILTIN);
44+
#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
45+
FUNC(, 1, 1, __CLC_GENTYPE, __generic, STORE_HALF_BUILTIN);
46+
#endif
4047
#endif
4148

4249
#undef STORE_HALF_BUILTIN

0 commit comments

Comments
 (0)