mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-06 02:18:05 +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);
|
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)) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user