File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
sycl/ext/intel/experimental/esimd Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -1051,6 +1051,9 @@ __CLC_BF16_SCAL_VEC(uint32_t)
10511051#undef __CLC_BF16_SCAL_VEC
10521052#undef __CLC_BF16
10531053
1054+ extern __DPCPP_SYCL_EXTERNAL int32_t __spirv_BuiltInGlobalHWThreadIDINTEL ();
1055+ extern __DPCPP_SYCL_EXTERNAL int32_t __spirv_BuiltInSubDeviceIDINTEL ();
1056+
10541057#else // if !__SYCL_DEVICE_ONLY__
10551058
10561059template <typename dataT>
Original file line number Diff line number Diff line change @@ -2669,6 +2669,31 @@ __ESIMD_API void lsc_fence(__ESIMD_NS::simd_mask<N> pred = 1) {
26692669
26702670// / @} sycl_esimd_memory_lsc
26712671
2672+ // / @defgroup sycl_esimd_hw_thread_queries HW thread .
2673+ // / @ingroup sycl_esimd_memory
2674+
2675+ // / @addtogroup sycl_esimd_hw_thread_queries
2676+ // / @{
2677+
2678+ // / Get HW Thread ID
2679+ __ESIMD_API int32_t get_hw_thread_id () {
2680+ #ifdef __SYCL_DEVICE_ONLY__
2681+ return __spirv_BuiltInGlobalHWThreadIDINTEL ();
2682+ #else
2683+ return std::rand ();
2684+ #endif // __SYCL_DEVICE_ONLY__
2685+ }
2686+ // / Get subdevice ID
2687+ __ESIMD_API int32_t get_subdevice_id () {
2688+ #ifdef __SYCL_DEVICE_ONLY__
2689+ return __spirv_BuiltInSubDeviceIDINTEL ();
2690+ #else
2691+ return 0 ;
2692+ #endif
2693+ }
2694+
2695+ // / @} sycl_esimd_hw_thread_queries
2696+
26722697} // namespace experimental::esimd
26732698
26742699namespace esimd {
You can’t perform that action at this time.
0 commit comments