Allow to set shared system memory pointers in constant buffers.

Change-Id: Ie2a811c0f50abf667df82517abf2291e00a18460
Signed-off-by: Mrozek, Michal <michal.mrozek@intel.com>
This commit is contained in:
Mrozek, Michal
2019-09-04 17:26:57 +02:00
committed by sys_ocldev
parent b25422deb1
commit 29613a2b1a
5 changed files with 54 additions and 4 deletions

View File

@@ -4204,12 +4204,16 @@ cl_int CL_API_CALL clSetKernelArgSVMPointer(cl_kernel kernel,
if (argValue != nullptr) {
auto svmData = svmManager->getSVMAlloc(argValue);
if (svmData == nullptr) {
retVal = CL_INVALID_ARG_VALUE;
TRACING_EXIT(clSetKernelArgSVMPointer, &retVal);
return retVal;
if (!pKernel->getDevice().areSharedSystemAllocationsAllowed()) {
retVal = CL_INVALID_ARG_VALUE;
TRACING_EXIT(clSetKernelArgSVMPointer, &retVal);
return retVal;
}
} else {
pSvmAlloc = svmData->gpuAllocation;
}
pSvmAlloc = svmData->gpuAllocation;
}
retVal = pKernel->setArgSvmAlloc(argIndex, const_cast<void *>(argValue), pSvmAlloc);
TRACING_EXIT(clSetKernelArgSVMPointer, &retVal);
return retVal;

View File

@@ -93,6 +93,9 @@ class Device : public BaseObject<_cl_device_id> {
bool isFullRangeSvm() const {
return executionEnvironment->isFullRangeSvm();
}
bool areSharedSystemAllocationsAllowed() const {
return this->deviceInfo.sharedSystemMemCapabilities != 0u;
}
protected:
Device() = delete;