@@ -212,16 +212,16 @@ inline uptr MemToShadow(uptr addr, uint32_t as) {
212212#elif defined(__LIBDEVICE_CPU__)
213213 shadow_ptr = MemToShadow_CPU (addr);
214214#else
215- if (LIKELY (GetMsanLaunchInfo-> DeviceTy == DeviceType::CPU) ) {
215+ if (GetDeviceTy () == DeviceType::CPU) {
216216 shadow_ptr = MemToShadow_CPU (addr);
217- } else if (GetMsanLaunchInfo-> DeviceTy == DeviceType::GPU_PVC) {
217+ } else if (GetDeviceTy () == DeviceType::GPU_PVC) {
218218 shadow_ptr = MemToShadow_PVC (addr, as);
219- } else if (GetMsanLaunchInfo-> DeviceTy == DeviceType::GPU_DG2) {
219+ } else if (GetDeviceTy () == DeviceType::GPU_DG2) {
220220 shadow_ptr = MemToShadow_DG2 (addr, as);
221221 } else {
222222 shadow_ptr = GetMsanLaunchInfo->CleanShadow ;
223- MSAN_DEBUG (__spirv_ocl_printf (__msan_print_unsupport_device_type,
224- GetMsanLaunchInfo-> DeviceTy ));
223+ MSAN_DEBUG (
224+ __spirv_ocl_printf (__msan_print_unsupport_device_type, GetDeviceTy () ));
225225 }
226226#endif
227227
@@ -269,17 +269,17 @@ inline uptr MemToOrigin(uptr addr, uint32_t as) {
269269#elif defined(__LIBDEVICE_CPU__)
270270 origin_ptr = MemToOrigin_CPU (addr);
271271#else
272- if (LIKELY (GetMsanLaunchInfo-> DeviceTy == DeviceType::CPU) ) {
272+ if (GetDeviceTy () == DeviceType::CPU) {
273273 origin_ptr = MemToOrigin_CPU (aligned_addr);
274- } else if (GetMsanLaunchInfo-> DeviceTy == DeviceType::GPU_PVC) {
274+ } else if (GetDeviceTy () == DeviceType::GPU_PVC) {
275275 origin_ptr = MemToOrigin_PVC (aligned_addr, as);
276- } else if (GetMsanLaunchInfo-> DeviceTy == DeviceType::GPU_DG2) {
276+ } else if (GetDeviceTy () == DeviceType::GPU_DG2) {
277277 origin_ptr = MemToOrigin_DG2 (aligned_addr, as);
278278 } else {
279279 // Return clean shadow (0s) by default
280280 origin_ptr = GetMsanLaunchInfo->CleanShadow ;
281- MSAN_DEBUG (__spirv_ocl_printf (__msan_print_unsupport_device_type,
282- GetMsanLaunchInfo-> DeviceTy ));
281+ MSAN_DEBUG (
282+ __spirv_ocl_printf (__msan_print_unsupport_device_type, GetDeviceTy () ));
283283 }
284284#endif
285285
@@ -737,8 +737,7 @@ DEVICE_EXTERN_C_NOINLINE void __msan_unpoison_shadow(uptr ptr, uint32_t as,
737737static __SYCL_CONSTANT__ const char __msan_print_private_base[] =
738738 " [kernel] __msan_set_private_base(sid=%llu): %p\n " ;
739739
740- DEVICE_EXTERN_C_NOINLINE void
741- __msan_set_private_base (__SYCL_PRIVATE__ void *ptr) {
740+ inline void SetPrivateBaseImpl (__SYCL_PRIVATE__ void *ptr) {
742741 const size_t sid = SubGroupLinearId ();
743742 if (!GetMsanLaunchInfo || sid >= MSAN_MAX_SG_PRIVATE ||
744743 GetMsanLaunchInfo->PrivateShadowOffset == 0 ||
@@ -752,6 +751,19 @@ __msan_set_private_base(__SYCL_PRIVATE__ void *ptr) {
752751 SubGroupBarrier ();
753752}
754753
754+ DEVICE_EXTERN_C_NOINLINE void
755+ __msan_set_private_base (__SYCL_PRIVATE__ void *ptr) {
756+ #if defined(__LIBDEVICE_CPU__)
757+ return ;
758+ #elif defined(__LIBDEVICE_DG2__) || defined(__LIBDEVICE_PVC__)
759+ SetPrivateBaseImpl (ptr);
760+ #else
761+ if (GetDeviceTy () == DeviceType::CPU)
762+ return ;
763+ SetPrivateBaseImpl (ptr);
764+ #endif
765+ }
766+
755767static __SYCL_CONSTANT__ const char __msan_print_strided_copy_unsupport_type[] =
756768 " [kernel] __msan_unpoison_strided_copy: unsupported type(%d)\n " ;
757769
0 commit comments