mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-10 12:53:42 +08:00
Improve caching in clSetKernelArgSVMPointer 2/n
Update allocIdMemoryManagerCounter on cache hit Related-To: NEO-6737 Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
fc11701422
commit
6556d9a510
@ -4890,6 +4890,7 @@ cl_int CL_API_CALL clSetKernelArgSVMPointer(cl_kernel kernel,
|
||||
auto svmData = svmManager->getSVMAlloc(argValue);
|
||||
if (pMultiDeviceKernel->getKernelArguments()[argIndex].allocId == svmData->getAllocId()) {
|
||||
reuseFromCache = true;
|
||||
pMultiDeviceKernel->storeKernelArgAllocIdMemoryManagerCounter(argIndex, svmManager->allocationsCounter);
|
||||
}
|
||||
}
|
||||
if (reuseFromCache) {
|
||||
|
@ -951,6 +951,10 @@ void Kernel::storeKernelArg(uint32_t argIndex, kernelArgType argType, void *argO
|
||||
kernelArguments[argIndex].svmFlags = argSvmFlags;
|
||||
}
|
||||
|
||||
void Kernel::storeKernelArgAllocIdMemoryManagerCounter(uint32_t argIndex, uint32_t allocIdMemoryManagerCounter) {
|
||||
kernelArguments[argIndex].allocIdMemoryManagerCounter = allocIdMemoryManagerCounter;
|
||||
}
|
||||
|
||||
const void *Kernel::getKernelArg(uint32_t argIndex) const {
|
||||
return kernelArguments[argIndex].object;
|
||||
}
|
||||
|
@ -278,6 +278,7 @@ class Kernel : public ReferenceTrackedObject<Kernel> {
|
||||
size_t argSize,
|
||||
GraphicsAllocation *argSvmAlloc = nullptr,
|
||||
cl_mem_flags argSvmFlags = 0);
|
||||
void storeKernelArgAllocIdMemoryManagerCounter(uint32_t argIndex, uint32_t allocIdMemoryManagerCounter);
|
||||
const void *getKernelArg(uint32_t argIndex) const;
|
||||
const SimpleKernelArgInfo &getKernelArgInfo(uint32_t argIndex) const;
|
||||
|
||||
|
@ -54,6 +54,7 @@ void MultiDeviceKernel::clearUnifiedMemoryExecInfo() { callOnEachKernel(&Kernel:
|
||||
int MultiDeviceKernel::setKernelThreadArbitrationPolicy(uint32_t propertyValue) { return getResultFromEachKernel(&Kernel::setKernelThreadArbitrationPolicy, propertyValue); }
|
||||
cl_int MultiDeviceKernel::setKernelExecutionType(cl_execution_info_kernel_type_intel executionType) { return getResultFromEachKernel(&Kernel::setKernelExecutionType, executionType); }
|
||||
int32_t MultiDeviceKernel::setAdditionalKernelExecInfoWithParam(uint32_t paramName, size_t paramValueSize, const void *paramValue) { return getResultFromEachKernel(&Kernel::setAdditionalKernelExecInfoWithParam, paramName, paramValueSize, paramValue); }
|
||||
void MultiDeviceKernel::storeKernelArgAllocIdMemoryManagerCounter(uint32_t argIndex, uint32_t allocIdMemoryManagerCounter) { defaultKernel->storeKernelArgAllocIdMemoryManagerCounter(argIndex, allocIdMemoryManagerCounter); };
|
||||
|
||||
cl_int MultiDeviceKernel::cloneKernel(MultiDeviceKernel *pSourceMultiDeviceKernel) {
|
||||
for (auto rootDeviceIndex = 0u; rootDeviceIndex < kernels.size(); rootDeviceIndex++) {
|
||||
|
@ -67,6 +67,7 @@ class MultiDeviceKernel : public BaseObject<_cl_kernel> {
|
||||
int setKernelThreadArbitrationPolicy(uint32_t propertyValue);
|
||||
cl_int setKernelExecutionType(cl_execution_info_kernel_type_intel executionType);
|
||||
int32_t setAdditionalKernelExecInfoWithParam(uint32_t paramName, size_t paramValueSize, const void *paramValue);
|
||||
void storeKernelArgAllocIdMemoryManagerCounter(uint32_t argIndex, uint32_t allocIdMemoryManagerCounter);
|
||||
Program *getProgram() const { return program; }
|
||||
const KernelInfoContainer &getKernelInfos() const { return kernelInfos; }
|
||||
|
||||
|
Reference in New Issue
Block a user