mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-28 16:48:45 +08:00
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:
committed by
Compute-Runtime-Automation
parent
8dc24d9e2c
commit
72b727e70e
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user