fix: SVM corner cases where size equals zero

Allow clEnqueueSVMMemFill with a size equal to zero.  Additionally,
allow a NULL svm_ptr when the size is equal to zero.
Set the event command type properly when enqueueing a marker for
clEnqueueSVMMemcpy with a size equal to zero.

Signed-off-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
This commit is contained in:
Ben Ashbaugh
2025-07-11 01:52:58 +00:00
committed by Compute-Runtime-Automation
parent 8dc24d9e2c
commit 72b727e70e
3 changed files with 113 additions and 53 deletions

View File

@@ -4888,6 +4888,11 @@ cl_int CL_API_CALL clEnqueueSVMMemcpy(cl_command_queue commandQueue,
}
} else {
retVal = pCommandQueue->enqueueMarkerWithWaitList(numEventsInWaitList, eventWaitList, event);
if (event) {
auto pEvent = castToObjectOrAbort<Event>(*event);
pEvent->setCmdType(CL_COMMAND_SVM_MEMCPY);
}
}
TRACING_EXIT(ClEnqueueSvmMemcpy, &retVal);
return retVal;
@@ -4925,7 +4930,7 @@ cl_int CL_API_CALL clEnqueueSVMMemFill(cl_command_queue commandQueue,
return retVal;
}
if ((svmPtr == nullptr) || (size == 0)) {
if ((svmPtr == nullptr) && (size != 0)) {
retVal = CL_INVALID_VALUE;
TRACING_EXIT(ClEnqueueSvmMemFill, &retVal);
return retVal;