mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 17:13:29 +08:00
Return CL_INVALID_OPERATION error
In clSetKernelArgSVMPointer and clSetKernelExecInfo functions CL_INVALID_OPERATION error is returned if the associated device does not support SVM. Related-To: NEO-4368 Change-Id: I2a311d9307588ae992cee977b25df10841ebf668 Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
8978fcce3d
commit
6174022ed1
@@ -4452,15 +4452,16 @@ cl_int CL_API_CALL clSetKernelArgSVMPointer(cl_kernel kernel,
|
||||
return retVal;
|
||||
}
|
||||
|
||||
if (argIndex >= pKernel->getKernelArgsNumber()) {
|
||||
retVal = CL_INVALID_ARG_INDEX;
|
||||
const HardwareInfo &hwInfo = pKernel->getDevice().getHardwareInfo();
|
||||
if (!hwInfo.capabilityTable.ftrSvm) {
|
||||
retVal = CL_INVALID_OPERATION;
|
||||
TRACING_EXIT(clSetKernelArgSVMPointer, &retVal);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
auto svmManager = pKernel->getContext().getSVMAllocsManager();
|
||||
if (!svmManager) {
|
||||
retVal = CL_INVALID_ARG_VALUE;
|
||||
if (argIndex >= pKernel->getKernelArgsNumber()) {
|
||||
retVal = CL_INVALID_ARG_INDEX;
|
||||
TRACING_EXIT(clSetKernelArgSVMPointer, &retVal);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
@@ -4474,6 +4475,7 @@ cl_int CL_API_CALL clSetKernelArgSVMPointer(cl_kernel kernel,
|
||||
|
||||
GraphicsAllocation *pSvmAlloc = nullptr;
|
||||
if (argValue != nullptr) {
|
||||
auto svmManager = pKernel->getContext().getSVMAllocsManager();
|
||||
auto svmData = svmManager->getSVMAlloc(argValue);
|
||||
if (svmData == nullptr) {
|
||||
if (!pKernel->getDevice().areSharedSystemAllocationsAllowed()) {
|
||||
@@ -4509,6 +4511,13 @@ cl_int CL_API_CALL clSetKernelExecInfo(cl_kernel kernel,
|
||||
return retVal;
|
||||
}
|
||||
|
||||
const HardwareInfo &hwInfo = pKernel->getDevice().getHardwareInfo();
|
||||
if (!hwInfo.capabilityTable.ftrSvm) {
|
||||
retVal = CL_INVALID_OPERATION;
|
||||
TRACING_EXIT(clSetKernelExecInfo, &retVal);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
switch (paramName) {
|
||||
case CL_KERNEL_EXEC_INFO_INDIRECT_DEVICE_ACCESS_INTEL:
|
||||
case CL_KERNEL_EXEC_INFO_INDIRECT_HOST_ACCESS_INTEL:
|
||||
@@ -4529,10 +4538,6 @@ cl_int CL_API_CALL clSetKernelExecInfo(cl_kernel kernel,
|
||||
size_t numPointers = paramValueSize / sizeof(void *);
|
||||
size_t *pSvmPtrList = (size_t *)paramValue;
|
||||
|
||||
if (pKernel->getContext().getSVMAllocsManager() == nullptr) {
|
||||
return CL_INVALID_VALUE;
|
||||
}
|
||||
|
||||
if (paramName == CL_KERNEL_EXEC_INFO_SVM_PTRS) {
|
||||
pKernel->clearSvmKernelExecInfo();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user