@@ -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
@@ -719,8 +719,7 @@ DEVICE_EXTERN_C_NOINLINE void __msan_unpoison_stack(__SYCL_PRIVATE__ void *ptr,
719719static __SYCL_CONSTANT__ const char __msan_print_private_base[] =
720720 " [kernel] __msan_set_private_base(sid=%llu): %p\n " ;
721721
722- DEVICE_EXTERN_C_NOINLINE void
723- __msan_set_private_base (__SYCL_PRIVATE__ void *ptr) {
722+ inline void SetPrivateBaseImpl (__SYCL_PRIVATE__ void *ptr) {
724723 const size_t sid = SubGroupLinearId ();
725724 if (!GetMsanLaunchInfo || sid >= MSAN_MAX_SG_PRIVATE ||
726725 GetMsanLaunchInfo->PrivateShadowOffset == 0 ||
@@ -734,6 +733,19 @@ __msan_set_private_base(__SYCL_PRIVATE__ void *ptr) {
734733 SubGroupBarrier ();
735734}
736735
736+ DEVICE_EXTERN_C_NOINLINE void
737+ __msan_set_private_base (__SYCL_PRIVATE__ void *ptr) {
738+ #if defined(__LIBDEVICE_CPU__)
739+ return ;
740+ #elif defined(__LIBDEVICE_DG2__) || defined(__LIBDEVICE_PVC__)
741+ SetPrivateBaseImpl (ptr);
742+ #else
743+ if (GetDeviceTy () == DeviceType::CPU)
744+ return ;
745+ SetPrivateBaseImpl (ptr);
746+ #endif
747+ }
748+
737749static __SYCL_CONSTANT__ const char __msan_print_strided_copy_unsupport_type[] =
738750 " [kernel] __msan_unpoison_strided_copy: unsupported type(%d)\n " ;
739751
0 commit comments