@@ -34,17 +34,19 @@ using __nativecpu_state = native_cpu::state;
3434#define OCL_PRIVATE __attribute__ ((opencl_private))
3535
3636DEVICE_EXTERN_C void __mux_work_group_barrier(int32_t id, int32_t scope,
37- int32_t semantics);
37+ int32_t semantics) noexcept ;
3838__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 {
4041 if (__spv::Scope::Flag::Workgroup == Execution)
4142 // todo: check id and args; use mux constants
4243 __mux_work_group_barrier (0 , Execution, Semantics);
4344}
4445
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 ;
4648__SYCL_CONVERGENT__ DEVICE_EXTERNAL void
47- __spirv_MemoryBarrier (int32_t Memory, int32_t Semantics) {
49+ __spirv_MemoryBarrier (int32_t Memory, int32_t Semantics) noexcept {
4850 __mux_mem_barrier (Memory, Semantics);
4951}
5052
@@ -54,7 +56,7 @@ __spirv_MemoryBarrier(int32_t Memory, int32_t Semantics) {
5456
5557#define DefGenericCastToPtrExplImpl (sfx, asp, cv )\
5658DEVICE_EXTERNAL cv asp void *\
57- __spirv_GenericCastToPtrExplicit_##sfx(cv void *p ,int ) {\
59+ __spirv_GenericCastToPtrExplicit_##sfx(cv void *p ,int ) noexcept {\
5860 return (cv asp void *)p;\
5961}
6062
@@ -100,9 +102,9 @@ DefSubgroupBlockINTEL(uint32_t) DefSubgroupBlockINTEL(uint64_t)
100102DefSubgroupBlockINTEL(uint8_t ) DefSubgroupBlockINTEL(uint16_t )
101103
102104#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 {\
106108 if (__spv::Scope::Flag::Subgroup == g)\
107109 return __mux_sub_group_##name##_i1 (val);\
108110 else if (__spv::Scope::Flag::Workgroup == g)\
@@ -115,16 +117,16 @@ DefineGOp1(All, all)
115117
116118
117119#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 ; \
121123 DEVICE_EXTERN_C MuxType __mux_work_group_scan_exclusive_##mux_sfx(uint32_t , \
122- MuxType); \
124+ MuxType) noexcept ; \
123125 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 ;\
126128 DEVICE_EXTERNAL Type __spirv_Group##spir_sfx(uint32_t g, uint32_t id, \
127- Type v) { \
129+ Type v) noexcept { \
128130 if (__spv::Scope::Flag::Subgroup == g) { \
129131 if (static_cast <unsigned >(__spv::GroupOperation::InclusiveScan) == id) \
130132 return __mux_sub_group_scan_inclusive_##mux_sfx (v); \
@@ -196,29 +198,29 @@ DefineLogicalGroupOp(bool, bool, i1)
196198
197199#define DefineBroadcastMuxType (Type, Sfx, MuxType, IDType ) \
198200 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 ; \
200202 DEVICE_EXTERN_C MuxType __mux_sub_group_broadcast_##Sfx(MuxType val, \
201- int32_t sg_lid);
203+ int32_t sg_lid) noexcept ;
202204
203205#define DefineBroadCastImpl (Type, Sfx, MuxType, IDType ) \
204206 DEVICE_EXTERNAL Type __spirv_GroupBroadcast (uint32_t g, Type v, \
205- IDType l) { \
207+ IDType l) noexcept { \
206208 if (__spv::Scope::Flag::Subgroup == g) \
207209 return __mux_sub_group_broadcast_##Sfx (v, l); \
208210 else \
209211 return __mux_work_group_broadcast_##Sfx (0 , v, l, 0 , 0 ); \
210212 } \
211213 \
212214 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 { \
214216 if (__spv::Scope::Flag::Subgroup == g) \
215217 return __mux_sub_group_broadcast_##Sfx (v, l[0 ]); \
216218 else \
217219 return __mux_work_group_broadcast_##Sfx (0 , v, l[0 ], l[1 ], 0 ); \
218220 } \
219221 \
220222 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 { \
222224 if (__spv::Scope::Flag::Subgroup == g) \
223225 return __mux_sub_group_broadcast_##Sfx (v, l[0 ]); \
224226 else \
@@ -241,7 +243,7 @@ DefineBroadCast(int64_t, i64, int64_t)
241243
242244#define DefShuffleINTEL (Type, Sfx, MuxType ) \
243245 DEVICE_EXTERN_C MuxType __mux_sub_group_shuffle_##Sfx(MuxType val, \
244- int32_t lid); \
246+ int32_t lid) noexcept ; \
245247 template <> \
246248 DEVICE_EXTERNAL Type __spirv_SubgroupShuffleINTEL<Type>( \
247249 Type val, unsigned id) noexcept { \
@@ -250,7 +252,7 @@ DefineBroadCast(int64_t, i64, int64_t)
250252
251253#define DefShuffleUpINTEL (Type, Sfx, MuxType ) \
252254 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 ; \
254256 template <> \
255257 DEVICE_EXTERNAL Type __spirv_SubgroupShuffleUpINTEL<Type>( \
256258 Type prev, Type curr, unsigned delta) noexcept { \
@@ -260,7 +262,7 @@ DefineBroadCast(int64_t, i64, int64_t)
260262
261263#define DefShuffleDownINTEL (Type, Sfx, MuxType ) \
262264 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 ; \
264266 template <> \
265267 DEVICE_EXTERNAL Type __spirv_SubgroupShuffleDownINTEL<Type>( \
266268 Type curr, Type next, unsigned delta) noexcept { \
@@ -298,7 +300,7 @@ DefShuffleINTEL_All(_Float16, f16, _Float16)
298300// Vector versions of shuffle are generated by the FixABIBuiltinsSYCLNativeCPU pass
299301
300302#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);}
302304
303305Define2ArgForward (uint64_t , __spirv_ocl_u_min, std::min)
304306
0 commit comments