@@ -34,17 +34,19 @@ using __nativecpu_state = native_cpu::state;
34
34
#define OCL_PRIVATE __attribute__ ((opencl_private))
35
35
36
36
DEVICE_EXTERN_C void __mux_work_group_barrier(int32_t id, int32_t scope,
37
- int32_t semantics);
37
+ int32_t semantics) noexcept ;
38
38
__SYCL_CONVERGENT__ DEVICE_EXTERNAL void
39
- __spirv_ControlBarrier (int32_t Execution, int32_t Memory, int32_t Semantics) {
39
+ __spirv_ControlBarrier (int32_t Execution, int32_t Memory,
40
+ int32_t Semantics) noexcept {
40
41
if (__spv::Scope::Flag::Workgroup == Execution)
41
42
// todo: check id and args; use mux constants
42
43
__mux_work_group_barrier (0 , Execution, Semantics);
43
44
}
44
45
45
- DEVICE_EXTERN_C void __mux_mem_barrier (int32_t scope, int32_t semantics);
46
+ DEVICE_EXTERN_C void __mux_mem_barrier (int32_t scope,
47
+ int32_t semantics) noexcept ;
46
48
__SYCL_CONVERGENT__ DEVICE_EXTERNAL void
47
- __spirv_MemoryBarrier (int32_t Memory, int32_t Semantics) {
49
+ __spirv_MemoryBarrier (int32_t Memory, int32_t Semantics) noexcept {
48
50
__mux_mem_barrier (Memory, Semantics);
49
51
}
50
52
@@ -54,7 +56,7 @@ __spirv_MemoryBarrier(int32_t Memory, int32_t Semantics) {
54
56
55
57
#define DefGenericCastToPtrExplImpl (sfx, asp, cv )\
56
58
DEVICE_EXTERNAL cv asp void *\
57
- __spirv_GenericCastToPtrExplicit_##sfx(cv void *p ,int ) {\
59
+ __spirv_GenericCastToPtrExplicit_##sfx(cv void *p ,int ) noexcept {\
58
60
return (cv asp void *)p;\
59
61
}
60
62
@@ -100,9 +102,9 @@ DefSubgroupBlockINTEL(uint32_t) DefSubgroupBlockINTEL(uint64_t)
100
102
DefSubgroupBlockINTEL(uint8_t ) DefSubgroupBlockINTEL(uint16_t )
101
103
102
104
#define DefineGOp1 (spir_sfx, name )\
103
- DEVICE_EXTERN_C bool __mux_sub_group_##name##_i1(bool );\
104
- DEVICE_EXTERN_C bool __mux_work_group_##name##_i1(uint32_t id, bool val);\
105
- DEVICE_EXTERNAL bool __spirv_Group ## spir_sfx(unsigned g, bool val) {\
105
+ DEVICE_EXTERN_C bool __mux_sub_group_##name##_i1(bool ) noexcept ;\
106
+ DEVICE_EXTERN_C bool __mux_work_group_##name##_i1(uint32_t id, bool val) noexcept ;\
107
+ DEVICE_EXTERNAL bool __spirv_Group ## spir_sfx(unsigned g, bool val) noexcept {\
106
108
if (__spv::Scope::Flag::Subgroup == g)\
107
109
return __mux_sub_group_##name##_i1 (val);\
108
110
else if (__spv::Scope::Flag::Workgroup == g)\
@@ -115,16 +117,16 @@ DefineGOp1(All, all)
115
117
116
118
117
119
#define DefineGOp (Type, MuxType, spir_sfx, mux_sfx ) \
118
- DEVICE_EXTERN_C MuxType __mux_sub_group_scan_inclusive_##mux_sfx(MuxType); \
119
- DEVICE_EXTERN_C MuxType __mux_sub_group_scan_exclusive_##mux_sfx(MuxType); \
120
- DEVICE_EXTERN_C MuxType __mux_sub_group_reduce_##mux_sfx(MuxType); \
120
+ DEVICE_EXTERN_C MuxType __mux_sub_group_scan_inclusive_##mux_sfx(MuxType) noexcept ; \
121
+ DEVICE_EXTERN_C MuxType __mux_sub_group_scan_exclusive_##mux_sfx(MuxType) noexcept ; \
122
+ DEVICE_EXTERN_C MuxType __mux_sub_group_reduce_##mux_sfx(MuxType) noexcept ; \
121
123
DEVICE_EXTERN_C MuxType __mux_work_group_scan_exclusive_##mux_sfx(uint32_t , \
122
- MuxType); \
124
+ MuxType) noexcept ; \
123
125
DEVICE_EXTERN_C MuxType __mux_work_group_scan_inclusive_##mux_sfx(uint32_t , \
124
- MuxType); \
125
- DEVICE_EXTERN_C MuxType __mux_work_group_reduce_##mux_sfx(uint32_t , MuxType);\
126
+ MuxType) noexcept ; \
127
+ DEVICE_EXTERN_C MuxType __mux_work_group_reduce_##mux_sfx(uint32_t , MuxType) noexcept ;\
126
128
DEVICE_EXTERNAL Type __spirv_Group##spir_sfx(uint32_t g, uint32_t id, \
127
- Type v) { \
129
+ Type v) noexcept { \
128
130
if (__spv::Scope::Flag::Subgroup == g) { \
129
131
if (static_cast <unsigned >(__spv::GroupOperation::InclusiveScan) == id) \
130
132
return __mux_sub_group_scan_inclusive_##mux_sfx (v); \
@@ -196,29 +198,29 @@ DefineLogicalGroupOp(bool, bool, i1)
196
198
197
199
#define DefineBroadcastMuxType (Type, Sfx, MuxType, IDType ) \
198
200
DEVICE_EXTERN_C MuxType __mux_work_group_broadcast_##Sfx( \
199
- int32_t id, MuxType val, uint64_t lidx, uint64_t lidy, uint64_t lidz); \
201
+ int32_t id, MuxType val, uint64_t lidx, uint64_t lidy, uint64_t lidz) noexcept ; \
200
202
DEVICE_EXTERN_C MuxType __mux_sub_group_broadcast_##Sfx(MuxType val, \
201
- int32_t sg_lid);
203
+ int32_t sg_lid) noexcept ;
202
204
203
205
#define DefineBroadCastImpl (Type, Sfx, MuxType, IDType ) \
204
206
DEVICE_EXTERNAL Type __spirv_GroupBroadcast (uint32_t g, Type v, \
205
- IDType l) { \
207
+ IDType l) noexcept { \
206
208
if (__spv::Scope::Flag::Subgroup == g) \
207
209
return __mux_sub_group_broadcast_##Sfx (v, l); \
208
210
else \
209
211
return __mux_work_group_broadcast_##Sfx (0 , v, l, 0 , 0 ); \
210
212
} \
211
213
\
212
214
DEVICE_EXTERNAL Type __spirv_GroupBroadcast (uint32_t g, Type v, \
213
- sycl::vec<IDType, 2 >::vector_t l) { \
215
+ sycl::vec<IDType, 2 >::vector_t l) noexcept { \
214
216
if (__spv::Scope::Flag::Subgroup == g) \
215
217
return __mux_sub_group_broadcast_##Sfx (v, l[0 ]); \
216
218
else \
217
219
return __mux_work_group_broadcast_##Sfx (0 , v, l[0 ], l[1 ], 0 ); \
218
220
} \
219
221
\
220
222
DEVICE_EXTERNAL Type __spirv_GroupBroadcast (uint32_t g, Type v, \
221
- sycl::vec<IDType, 3 >::vector_t l) { \
223
+ sycl::vec<IDType, 3 >::vector_t l) noexcept { \
222
224
if (__spv::Scope::Flag::Subgroup == g) \
223
225
return __mux_sub_group_broadcast_##Sfx (v, l[0 ]); \
224
226
else \
@@ -241,7 +243,7 @@ DefineBroadCast(int64_t, i64, int64_t)
241
243
242
244
#define DefShuffleINTEL (Type, Sfx, MuxType ) \
243
245
DEVICE_EXTERN_C MuxType __mux_sub_group_shuffle_##Sfx(MuxType val, \
244
- int32_t lid); \
246
+ int32_t lid) noexcept ; \
245
247
template <> \
246
248
DEVICE_EXTERNAL Type __spirv_SubgroupShuffleINTEL<Type>( \
247
249
Type val, unsigned id) noexcept { \
@@ -250,7 +252,7 @@ DefineBroadCast(int64_t, i64, int64_t)
250
252
251
253
#define DefShuffleUpINTEL (Type, Sfx, MuxType ) \
252
254
DEVICE_EXTERN_C MuxType __mux_sub_group_shuffle_up_##Sfx( \
253
- MuxType prev, MuxType curr, int32_t delta); \
255
+ MuxType prev, MuxType curr, int32_t delta) noexcept ; \
254
256
template <> \
255
257
DEVICE_EXTERNAL Type __spirv_SubgroupShuffleUpINTEL<Type>( \
256
258
Type prev, Type curr, unsigned delta) noexcept { \
@@ -260,7 +262,7 @@ DefineBroadCast(int64_t, i64, int64_t)
260
262
261
263
#define DefShuffleDownINTEL (Type, Sfx, MuxType ) \
262
264
DEVICE_EXTERN_C MuxType __mux_sub_group_shuffle_down_##Sfx( \
263
- MuxType curr, MuxType next, int32_t delta); \
265
+ MuxType curr, MuxType next, int32_t delta) noexcept ; \
264
266
template <> \
265
267
DEVICE_EXTERNAL Type __spirv_SubgroupShuffleDownINTEL<Type>( \
266
268
Type curr, Type next, unsigned delta) noexcept { \
@@ -298,7 +300,7 @@ DefShuffleINTEL_All(_Float16, f16, _Float16)
298
300
// Vector versions of shuffle are generated by the FixABIBuiltinsSYCLNativeCPU pass
299
301
300
302
#define Define2ArgForward (Type, Name, Callee )\
301
- DEVICE_EXTERNAL Type Name (Type a, Type b) { return Callee (a,b);}
303
+ DEVICE_EXTERNAL Type Name (Type a, Type b) noexcept { return Callee (a,b);}
302
304
303
305
Define2ArgForward (uint64_t , __spirv_ocl_u_min, std::min)
304
306
0 commit comments