File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
source/loader/layers/sanitizer/asan Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -463,6 +463,12 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueKernelLaunch(
463463 phEvent // /< [out][optional] return an event object that identifies this particular
464464 // /< kernel execution instance.
465465) {
466+ // This mutex is to prevent concurrent kernel launches across different queues
467+ // as the DeviceASAN local/private shadow memory does not support concurrent
468+ // kernel launches now.
469+ std::scoped_lock<ur_shared_mutex> Guard (
470+ getAsanInterceptor ()->KernelLaunchMutex );
471+
466472 auto pfnKernelLaunch = getContext ()->urDdiTable .Enqueue .pfnKernelLaunch ;
467473
468474 if (nullptr == pfnKernelLaunch) {
Original file line number Diff line number Diff line change @@ -360,6 +360,8 @@ class AsanInterceptor {
360360 std::shared_ptr<ShadowMemory>
361361 getOrCreateShadowMemory (ur_device_handle_t Device, DeviceType Type);
362362
363+ ur_shared_mutex KernelLaunchMutex;
364+
363365 private:
364366 ur_result_t updateShadowMemory (std::shared_ptr<ContextInfo> &ContextInfo,
365367 std::shared_ptr<DeviceInfo> &DeviceInfo,
You can’t perform that action at this time.
0 commit comments