performance: reuse allocData if available

Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
Michal Mrozek
2025-08-07 17:06:45 +00:00
committed by Compute-Runtime-Automation
parent da2fc7a586
commit f85e4935e2

View File

@@ -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); const auto requestedAddress = *reinterpret_cast<void *const *>(argVal);
uintptr_t gpuAddress = 0u; uintptr_t gpuAddress = 0u;
NEO::GraphicsAllocation *alloc = driverHandle->getDriverSystemMemoryAllocation(requestedAddress, NEO::GraphicsAllocation *alloc = nullptr;
1u, if (allocData) {
module->getDevice()->getRootDeviceIndex(), gpuAddress = reinterpret_cast<uintptr_t>(requestedAddress);
&gpuAddress); alloc = allocData->gpuAllocations.getGraphicsAllocation(module->getDevice()->getRootDeviceIndex());
if (allocData == nullptr) { } else {
alloc = driverHandle->getDriverSystemMemoryAllocation(requestedAddress, 1u, module->getDevice()->getRootDeviceIndex(), &gpuAddress);
allocData = svmAllocsManager->getSVMAlloc(requestedAddress); allocData = svmAllocsManager->getSVMAlloc(requestedAddress);
} }
NEO::SvmAllocationData *peerAllocData = nullptr; NEO::SvmAllocationData *peerAllocData = nullptr;
if (allocData && driverHandle->isRemoteResourceNeeded(requestedAddress, alloc, allocData, device)) { if (allocData && driverHandle->isRemoteResourceNeeded(requestedAddress, alloc, allocData, device)) {