Block SVMAllocsManager creation in Context when SVM is not supported

- skip SVM tests when SVM is not supported

Related-To: NEO-3157

Change-Id: Ie5d5ef4778749f60537084fc7f388714954a4873
Signed-off-by: Hoppe, Mateusz <mateusz.hoppe@intel.com>
This commit is contained in:
Hoppe, Mateusz
2019-05-15 15:04:43 +02:00
committed by sys_ocldev
parent 9217b80b42
commit d15174d7c5
10 changed files with 74 additions and 21 deletions

View File

@@ -3621,6 +3621,12 @@ cl_int CL_API_CALL clSetKernelArgSVMPointer(cl_kernel kernel,
return retVal;
}
auto svmManager = pKernel->getContext().getSVMAllocsManager();
if (!svmManager) {
retVal = CL_INVALID_ARG_VALUE;
return retVal;
}
cl_int kernelArgAddressQualifier = pKernel->getKernelArgAddressQualifier(argIndex);
if ((kernelArgAddressQualifier != CL_KERNEL_ARG_ADDRESS_GLOBAL) &&
(kernelArgAddressQualifier != CL_KERNEL_ARG_ADDRESS_CONSTANT)) {
@@ -3630,7 +3636,7 @@ cl_int CL_API_CALL clSetKernelArgSVMPointer(cl_kernel kernel,
GraphicsAllocation *pSvmAlloc = nullptr;
if (argValue != nullptr) {
auto svmData = pKernel->getContext().getSVMAllocsManager()->getSVMAlloc(argValue);
auto svmData = svmManager->getSVMAlloc(argValue);
if (svmData == nullptr) {
retVal = CL_INVALID_ARG_VALUE;
return retVal;
@@ -3668,6 +3674,10 @@ 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;
}
pKernel->clearKernelExecInfo();
for (uint32_t i = 0; i < numPointers; i++) {
auto svmData = pKernel->getContext().getSVMAllocsManager()->getSVMAlloc((const void *)pSvmPtrList[i]);
@@ -4145,9 +4155,14 @@ cl_int CL_API_CALL clEnqueueSVMMigrateMem(cl_command_queue commandQueue,
retVal = CL_INVALID_VALUE;
return retVal;
}
auto pSvmAllocMgr = pCommandQueue->getContext().getSVMAllocsManager();
if (pSvmAllocMgr == nullptr) {
retVal = CL_INVALID_VALUE;
return retVal;
}
for (uint32_t i = 0; i < numSvmPointers; i++) {
SVMAllocsManager *pSvmAllocMgr = pCommandQueue->getContext().getSVMAllocsManager();
auto svmData = pSvmAllocMgr->getSVMAlloc(svmPointers[i]);
if (svmData == nullptr) {
retVal = CL_INVALID_VALUE;