mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 21:42:53 +08:00
Pass canonized gpuAddress in setCpuPtrAndGpuAddress
Related-To: NEO-6523 Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
c51ce2a35c
commit
77dde01503
@@ -85,9 +85,9 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
|
||||
void *getDriverAllocatedCpuPtr() const { return driverAllocatedCpuPointer; }
|
||||
void setDriverAllocatedCpuPtr(void *allocatedCpuPtr) { driverAllocatedCpuPointer = allocatedCpuPtr; }
|
||||
|
||||
void setCpuPtrAndGpuAddress(void *cpuPtr, uint64_t gpuAddress) {
|
||||
void setCpuPtrAndGpuAddress(void *cpuPtr, uint64_t canonizedGpuAddress) {
|
||||
this->cpuPtr = cpuPtr;
|
||||
this->gpuAddress = GmmHelper::canonize(gpuAddress);
|
||||
this->gpuAddress = canonizedGpuAddress;
|
||||
}
|
||||
size_t getUnderlyingBufferSize() const { return size; }
|
||||
void setSize(size_t size) { this->size = size; }
|
||||
|
||||
@@ -98,7 +98,10 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryWithAlignment
|
||||
}
|
||||
memoryAllocation->setReservedAddressRange(gpuPtr, reserveSize);
|
||||
gpuPtr = alignUp(gpuPtr, alignment);
|
||||
memoryAllocation->setCpuPtrAndGpuAddress(ptr, reinterpret_cast<uint64_t>(gpuPtr));
|
||||
|
||||
auto gmmHelper = getGmmHelper(allocationData.rootDeviceIndex);
|
||||
auto canonizedGpuAddress = gmmHelper->canonize(reinterpret_cast<uint64_t>(gpuPtr));
|
||||
memoryAllocation->setCpuPtrAndGpuAddress(ptr, canonizedGpuAddress);
|
||||
}
|
||||
|
||||
if (allocationData.type == AllocationType::DEBUG_CONTEXT_SAVE_AREA ||
|
||||
@@ -144,7 +147,10 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryForNonSvmHost
|
||||
|
||||
GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryWithGpuVa(const AllocationData &allocationData) {
|
||||
auto memoryAllocation = static_cast<MemoryAllocation *>(allocateGraphicsMemoryWithAlignment(allocationData));
|
||||
memoryAllocation->setCpuPtrAndGpuAddress(memoryAllocation->getUnderlyingBuffer(), allocationData.gpuAddress);
|
||||
auto gmmHelper = getGmmHelper(allocationData.rootDeviceIndex);
|
||||
auto canonizedGpuAddress = gmmHelper->canonize(allocationData.gpuAddress);
|
||||
|
||||
memoryAllocation->setCpuPtrAndGpuAddress(memoryAllocation->getUnderlyingBuffer(), canonizedGpuAddress);
|
||||
return memoryAllocation;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user