@@ -31,16 +31,7 @@ using __nativecpu_state = native_cpu::state;
31
31
32
32
#define OCL_LOCAL __attribute__ ((opencl_local))
33
33
#define OCL_GLOBAL __attribute__ ((opencl_global))
34
-
35
- DEVICE_EXTERNAL OCL_LOCAL void *
36
- __spirv_GenericCastToPtrExplicit_ToLocal(void *p, int ) {
37
- return (OCL_LOCAL void *)p;
38
- }
39
-
40
- DEVICE_EXTERNAL OCL_GLOBAL void *
41
- __spirv_GenericCastToPtrExplicit_ToGlobal (void *p, int ) {
42
- return (OCL_GLOBAL void *)p;
43
- }
34
+ #define OCL_PRIVATE __attribute__ ((opencl_private))
44
35
45
36
DEVICE_EXTERN_C void __mux_work_group_barrier(uint32_t id, uint32_t scope,
46
37
uint32_t semantics);
@@ -61,6 +52,23 @@ __spirv_MemoryBarrier(uint32_t Memory, uint32_t Semantics) {
61
52
// Turning clang format off here because it reorders macro invocations
62
53
// making the following code very difficult to read.
63
54
// clang-format off
55
+
56
+ #define DefGenericCastToPtrExplImpl (sfx, asp, cv )\
57
+ DEVICE_EXTERNAL cv asp void *\
58
+ __spirv_GenericCastToPtrExplicit_##sfx(cv void *p ,int ) {\
59
+ return (cv asp void *)p;\
60
+ }
61
+
62
+ #define DefGenericCastToPtrExpl (sfx, asp )\
63
+ DefGenericCastToPtrExplImpl (sfx, asp, )\
64
+ DefGenericCastToPtrExplImpl(sfx, asp, const )\
65
+ DefGenericCastToPtrExplImpl(sfx, asp, volatile )\
66
+ DefGenericCastToPtrExplImpl(sfx, asp, const volatile )
67
+
68
+ DefGenericCastToPtrExpl(ToPrivate, OCL_PRIVATE)
69
+ DefGenericCastToPtrExpl(ToLocal, OCL_LOCAL)
70
+ DefGenericCastToPtrExpl(ToGlobal, OCL_GLOBAL)
71
+
64
72
#define DefSubgroupBlockINTEL1 (Type, PType ) \
65
73
template <> \
66
74
__SYCL_CONVERGENT__ DEVICE_EXTERNAL Type \
0 commit comments