mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-31 12:11:31 +08:00
Return CL_INVALID_OPERATION error for enqueuing SVM operations
The error code is returned if the associated device does not support SVM. Related-To: NEO-4368 Change-Id: I7c2300e05768e4acf541fa92bd94913de9b5eb81 Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
f2e24797ae
commit
6ce9402fc2
@@ -4173,6 +4173,13 @@ cl_int CL_API_CALL clEnqueueSVMFree(cl_command_queue commandQueue,
|
||||
return retVal;
|
||||
}
|
||||
|
||||
auto &device = pCommandQueue->getDevice();
|
||||
if (!device.getHardwareInfo().capabilityTable.ftrSvm) {
|
||||
retVal = CL_INVALID_OPERATION;
|
||||
TRACING_EXIT(clEnqueueSVMFree, &retVal);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
if (((svmPointers != nullptr) && (numSvmPointers == 0)) ||
|
||||
((svmPointers == nullptr) && (numSvmPointers != 0))) {
|
||||
retVal = CL_INVALID_VALUE;
|
||||
@@ -4225,6 +4232,13 @@ cl_int CL_API_CALL clEnqueueSVMMemcpy(cl_command_queue commandQueue,
|
||||
return retVal;
|
||||
}
|
||||
|
||||
auto &device = pCommandQueue->getDevice();
|
||||
if (!device.getHardwareInfo().capabilityTable.ftrSvm) {
|
||||
retVal = CL_INVALID_OPERATION;
|
||||
TRACING_EXIT(clEnqueueSVMMemcpy, &retVal);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
if ((dstPtr == nullptr) || (srcPtr == nullptr)) {
|
||||
retVal = CL_INVALID_VALUE;
|
||||
TRACING_EXIT(clEnqueueSVMMemcpy, &retVal);
|
||||
@@ -4276,6 +4290,13 @@ cl_int CL_API_CALL clEnqueueSVMMemFill(cl_command_queue commandQueue,
|
||||
return retVal;
|
||||
}
|
||||
|
||||
auto &device = pCommandQueue->getDevice();
|
||||
if (!device.getHardwareInfo().capabilityTable.ftrSvm) {
|
||||
retVal = CL_INVALID_OPERATION;
|
||||
TRACING_EXIT(clEnqueueSVMMemFill, &retVal);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
if ((svmPtr == nullptr) || (size == 0)) {
|
||||
retVal = CL_INVALID_VALUE;
|
||||
TRACING_EXIT(clEnqueueSVMMemFill, &retVal);
|
||||
@@ -4325,6 +4346,13 @@ cl_int CL_API_CALL clEnqueueSVMMap(cl_command_queue commandQueue,
|
||||
return retVal;
|
||||
}
|
||||
|
||||
auto &device = pCommandQueue->getDevice();
|
||||
if (!device.getHardwareInfo().capabilityTable.ftrSvm) {
|
||||
retVal = CL_INVALID_OPERATION;
|
||||
TRACING_EXIT(clEnqueueSVMMap, &retVal);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
if ((svmPtr == nullptr) || (size == 0)) {
|
||||
retVal = CL_INVALID_VALUE;
|
||||
TRACING_EXIT(clEnqueueSVMMap, &retVal);
|
||||
@@ -4372,6 +4400,13 @@ cl_int CL_API_CALL clEnqueueSVMUnmap(cl_command_queue commandQueue,
|
||||
return retVal;
|
||||
}
|
||||
|
||||
auto &device = pCommandQueue->getDevice();
|
||||
if (!device.getHardwareInfo().capabilityTable.ftrSvm) {
|
||||
retVal = CL_INVALID_OPERATION;
|
||||
TRACING_EXIT(clEnqueueSVMUnmap, &retVal);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
retVal = pCommandQueue->enqueueSVMUnmap(
|
||||
svmPtr,
|
||||
numEventsInWaitList,
|
||||
@@ -5027,6 +5062,13 @@ cl_int CL_API_CALL clEnqueueSVMMigrateMem(cl_command_queue commandQueue,
|
||||
return retVal;
|
||||
}
|
||||
|
||||
auto &device = pCommandQueue->getDevice();
|
||||
if (!device.getHardwareInfo().capabilityTable.ftrSvm) {
|
||||
retVal = CL_INVALID_OPERATION;
|
||||
TRACING_EXIT(clEnqueueSVMMigrateMem, &retVal);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
if (numSvmPointers == 0 || svmPointers == nullptr) {
|
||||
retVal = CL_INVALID_VALUE;
|
||||
TRACING_EXIT(clEnqueueSVMMigrateMem, &retVal);
|
||||
@@ -5041,12 +5083,9 @@ cl_int CL_API_CALL clEnqueueSVMMigrateMem(cl_command_queue commandQueue,
|
||||
TRACING_EXIT(clEnqueueSVMMigrateMem, &retVal);
|
||||
return retVal;
|
||||
}
|
||||
auto pSvmAllocMgr = pCommandQueue->getContext().getSVMAllocsManager();
|
||||
|
||||
if (pSvmAllocMgr == nullptr) {
|
||||
retVal = CL_INVALID_VALUE;
|
||||
return retVal;
|
||||
}
|
||||
auto pSvmAllocMgr = pCommandQueue->getContext().getSVMAllocsManager();
|
||||
UNRECOVERABLE_IF(pSvmAllocMgr == nullptr);
|
||||
|
||||
for (uint32_t i = 0; i < numSvmPointers; i++) {
|
||||
auto svmData = pSvmAllocMgr->getSVMAlloc(svmPointers[i]);
|
||||
|
||||
Reference in New Issue
Block a user