mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 17:13:29 +08:00
performance: reuse allocData if available
Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
da2fc7a586
commit
f85e4935e2
@@ -865,13 +865,15 @@ ze_result_t KernelImp::setArgBuffer(uint32_t argIndex, size_t argSize, const voi
|
||||
}
|
||||
const auto requestedAddress = *reinterpret_cast<void *const *>(argVal);
|
||||
uintptr_t gpuAddress = 0u;
|
||||
NEO::GraphicsAllocation *alloc = driverHandle->getDriverSystemMemoryAllocation(requestedAddress,
|
||||
1u,
|
||||
module->getDevice()->getRootDeviceIndex(),
|
||||
&gpuAddress);
|
||||
if (allocData == nullptr) {
|
||||
NEO::GraphicsAllocation *alloc = nullptr;
|
||||
if (allocData) {
|
||||
gpuAddress = reinterpret_cast<uintptr_t>(requestedAddress);
|
||||
alloc = allocData->gpuAllocations.getGraphicsAllocation(module->getDevice()->getRootDeviceIndex());
|
||||
} else {
|
||||
alloc = driverHandle->getDriverSystemMemoryAllocation(requestedAddress, 1u, module->getDevice()->getRootDeviceIndex(), &gpuAddress);
|
||||
allocData = svmAllocsManager->getSVMAlloc(requestedAddress);
|
||||
}
|
||||
|
||||
NEO::SvmAllocationData *peerAllocData = nullptr;
|
||||
if (allocData && driverHandle->isRemoteResourceNeeded(requestedAddress, alloc, allocData, device)) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user