mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-07 21:27:04 +08:00
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:
committed by
sys_ocldev
parent
b25422deb1
commit
29613a2b1a
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user