File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
source/loader/layers/sanitizer Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -743,7 +743,8 @@ ur_result_t SanitizerInterceptor::prepareLaunch(
743
743
// Write shadow memory offset for local memory
744
744
if (cl_DetectLocals) {
745
745
// CPU needn't this
746
- if (DeviceInfo->Type == DeviceType::GPU_PVC) {
746
+ if (DeviceInfo->Type == DeviceType::GPU_PVC ||
747
+ DeviceInfo->Type == DeviceType::GPU_DG2) {
747
748
size_t LocalMemorySize = GetLocalMemorySize (DeviceInfo->Handle );
748
749
size_t LocalShadowMemorySize =
749
750
(NumWG * LocalMemorySize) >> ASAN_SHADOW_SCALE;
@@ -762,6 +763,14 @@ ur_result_t SanitizerInterceptor::prepareLaunch(
762
763
context.logger .info (" ShadowMemory(Local, {} - {})" ,
763
764
(void *)LaunchInfo.LocalShadowOffset ,
764
765
(void *)LaunchInfo.LocalShadowOffsetEnd );
766
+
767
+ // Write shadow memory offset for local memory
768
+ EnqueueWriteGlobal (kSPIR_AsanShadowMemoryLocalStart ,
769
+ &LaunchInfo.LocalShadowOffset ,
770
+ sizeof (LaunchInfo.LocalShadowOffset ));
771
+ EnqueueWriteGlobal (kSPIR_AsanShadowMemoryLocalEnd ,
772
+ &LaunchInfo.LocalShadowOffsetEnd ,
773
+ sizeof (LaunchInfo.LocalShadowOffsetEnd ));
765
774
}
766
775
}
767
776
} while (false );
Original file line number Diff line number Diff line change @@ -90,6 +90,10 @@ constexpr auto kSPIR_AsanShadowMemoryGlobalStart =
90
90
" __AsanShadowMemoryGlobalStart" ;
91
91
constexpr auto kSPIR_AsanShadowMemoryGlobalEnd = " __AsanShadowMemoryGlobalEnd" ;
92
92
93
+ constexpr auto kSPIR_AsanShadowMemoryLocalStart =
94
+ " __AsanShadowMemoryLocalStart" ;
95
+ constexpr auto kSPIR_AsanShadowMemoryLocalEnd = " __AsanShadowMemoryLocalEnd" ;
96
+
93
97
constexpr auto kSPIR_DeviceType = " __DeviceType" ;
94
98
constexpr auto kSPIR_AsanDebug = " __AsanDebug" ;
95
99
You can’t perform that action at this time.
0 commit comments