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)
1051
1051
#undef __CLC_BF16_SCAL_VEC
1052
1052
#undef __CLC_BF16
1053
1053
1054
+ extern __DPCPP_SYCL_EXTERNAL int32_t __spirv_BuiltInGlobalHWThreadIDINTEL ();
1055
+ extern __DPCPP_SYCL_EXTERNAL int32_t __spirv_BuiltInSubDeviceIDINTEL ();
1056
+
1054
1057
#else // if !__SYCL_DEVICE_ONLY__
1055
1058
1056
1059
template <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) {
2669
2669
2670
2670
// / @} sycl_esimd_memory_lsc
2671
2671
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
+
2672
2697
} // namespace experimental::esimd
2673
2698
2674
2699
namespace esimd {
You can’t perform that action at this time.
0 commit comments