mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-30 09:58:55 +08:00
fix: support alignments in host and shared UnifiedMemoryAllocation
Related-To: LOCI-4334 Signed-off-by: Lu, Wenbin <wenbin.lu@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
b9837ef068
commit
4de792cee0
@@ -619,7 +619,7 @@ GraphicsAllocation *DrmMemoryManager::allocateMemoryByKMD(const AllocationData &
|
||||
auto gmm = std::make_unique<Gmm>(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper(), allocationData.hostPtr,
|
||||
allocationData.size, 0u, CacheSettingsHelper::getGmmUsageType(allocationData.type, allocationData.flags.uncacheable, productHelper), false, systemMemoryStorageInfo, true);
|
||||
size_t bufferSize = allocationData.size;
|
||||
uint64_t gpuRange = acquireGpuRange(bufferSize, allocationData.rootDeviceIndex, HeapIndex::HEAP_STANDARD64KB);
|
||||
uint64_t gpuRange = acquireGpuRangeWithCustomAlignment(bufferSize, allocationData.rootDeviceIndex, HeapIndex::HEAP_STANDARD64KB, allocationData.alignment);
|
||||
|
||||
GemCreate create{};
|
||||
create.size = bufferSize;
|
||||
@@ -1602,6 +1602,9 @@ AllocationStatus getGpuAddress(const AlignmentSelector &alignmentSelector, HeapA
|
||||
|
||||
alignment.heap = HeapIndex::HEAP_EXTENDED;
|
||||
}
|
||||
if (alignment.alignment < allocationData.alignment) {
|
||||
alignment.alignment = allocationData.alignment;
|
||||
}
|
||||
gpuAddress = gmmHelper->canonize(gfxPartition->heapAllocateWithCustomAlignment(alignment.heap, sizeAllocated, alignment.alignment));
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user