Skip to content

Commit e9e3158

Browse files
committed
Fix urEnqueueKernelLaunchWithArgsExp() in asan_ddi.cpp
1 parent 4b57ee4 commit e9e3158

File tree

1 file changed

+19
-3
lines changed
  • unified-runtime/source/loader/layers/sanitizer/asan

1 file changed

+19
-3
lines changed

unified-runtime/source/loader/layers/sanitizer/asan/asan_ddi.cpp

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1749,10 +1749,26 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueKernelLaunchWithArgsExp(
17491749

17501750
UR_CALL(getAsanInterceptor()->preLaunchKernel(hKernel, hQueue, LaunchInfo));
17511751

1752-
UR_CALL(getContext()->urDdiTable.EnqueueExp.pfnKernelLaunchWithArgsExp(
1752+
/*
1753+
UR_CALL(getContext()->urDdiTable.EnqueueExp.pfnKernelLaunchWithArgsExp(
1754+
hQueue, hKernel, workDim, pGlobalWorkOffset, pGlobalWorkSize,
1755+
LaunchInfo.LocalWorkSize.data(), 0, nullptr, numPropsInLaunchPropList,
1756+
launchPropList, numEventsInWaitList, phEventWaitList, phEvent));
1757+
*/
1758+
1759+
ur_result_t UrRes = getContext()->urDdiTable.Enqueue.pfnKernelLaunch(
17531760
hQueue, hKernel, workDim, pGlobalWorkOffset, pGlobalWorkSize,
1754-
LaunchInfo.LocalWorkSize.data(), 0, nullptr, numPropsInLaunchPropList,
1755-
launchPropList, numEventsInWaitList, phEventWaitList, phEvent));
1761+
LaunchInfo.LocalWorkSize.data(), numPropsInLaunchPropList, launchPropList,
1762+
numEventsInWaitList, phEventWaitList, phEvent);
1763+
if (UrRes != UR_RESULT_SUCCESS) {
1764+
if (UrRes == UR_RESULT_ERROR_OUT_OF_DEVICE_MEMORY) {
1765+
UR_LOG_L(
1766+
getContext()->logger, ERR,
1767+
"urEnqueueKernelLaunch failed due to out of device memory, maybe "
1768+
"SLM is fully used.");
1769+
}
1770+
return UrRes;
1771+
}
17561772

17571773
UR_CALL(getAsanInterceptor()->postLaunchKernel(hKernel, hQueue, LaunchInfo));
17581774

0 commit comments

Comments
 (0)