File tree 2 files changed +8
-0
lines changed
source/loader/layers/sanitizer/asan
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(
463
463
phEvent // /< [out][optional] return an event object that identifies this particular
464
464
// /< kernel execution instance.
465
465
) {
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
+
466
472
auto pfnKernelLaunch = getContext ()->urDdiTable .Enqueue .pfnKernelLaunch ;
467
473
468
474
if (nullptr == pfnKernelLaunch) {
Original file line number Diff line number Diff line change @@ -360,6 +360,8 @@ class AsanInterceptor {
360
360
std::shared_ptr<ShadowMemory>
361
361
getOrCreateShadowMemory (ur_device_handle_t Device, DeviceType Type);
362
362
363
+ ur_shared_mutex KernelLaunchMutex;
364
+
363
365
private:
364
366
ur_result_t updateShadowMemory (std::shared_ptr<ContextInfo> &ContextInfo,
365
367
std::shared_ptr<DeviceInfo> &DeviceInfo,
You can’t perform that action at this time.
0 commit comments