mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 21:18:24 +08:00
Allow debug flag to apply allocation alignment for heaps
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
841e536bc2
commit
4809a2a9b3
@@ -68,7 +68,7 @@ class GfxPartition {
|
||||
return getHeap(heapIndex).allocate(size);
|
||||
}
|
||||
|
||||
uint64_t heapAllocateWithCustomAlignment(HeapIndex heapIndex, size_t &size, size_t alignment) {
|
||||
MOCKABLE_VIRTUAL uint64_t heapAllocateWithCustomAlignment(HeapIndex heapIndex, size_t &size, size_t alignment) {
|
||||
return getHeap(heapIndex).allocateWithCustomAlignment(size, alignment);
|
||||
}
|
||||
|
||||
|
||||
@@ -1331,7 +1331,13 @@ uint64_t getGpuAddress(const AlignmentSelector &alignmentSelector, HeapAssigner
|
||||
case AllocationType::INTERNAL_HEAP:
|
||||
case AllocationType::DEBUG_MODULE_AREA: {
|
||||
auto heap = heapAssigner.get32BitHeapIndex(allocType, true, hwInfo, useFrontWindow);
|
||||
gpuAddress = gmmHelper.canonize(gfxPartition->heapAllocate(heap, sizeAllocated));
|
||||
size_t alignment = 0;
|
||||
|
||||
if (DebugManager.flags.ExperimentalEnableCustomLocalMemoryAlignment.get() != -1) {
|
||||
alignment = static_cast<size_t>(DebugManager.flags.ExperimentalEnableCustomLocalMemoryAlignment.get());
|
||||
}
|
||||
|
||||
gpuAddress = gmmHelper.canonize(gfxPartition->heapAllocateWithCustomAlignment(heap, sizeAllocated, alignment));
|
||||
} break;
|
||||
case AllocationType::WRITE_COMBINED:
|
||||
sizeAllocated = 0;
|
||||
@@ -1744,12 +1750,12 @@ void createMemoryRegionsForSharedAllocation(const HardwareInfo &hwInfo, MemoryIn
|
||||
auto memoryBanks = allocationData.storageInfo.memoryBanks;
|
||||
|
||||
if (allocationData.usmInitialPlacement == GraphicsAllocation::UsmInitialPlacement::CPU) {
|
||||
//System memory region
|
||||
// System memory region
|
||||
auto regionClassAndInstance = memoryInfo.getMemoryRegionClassAndInstance(0u, hwInfo);
|
||||
memRegions.push_back(regionClassAndInstance);
|
||||
}
|
||||
|
||||
//All local memory regions
|
||||
// All local memory regions
|
||||
size_t currentBank = 0;
|
||||
size_t i = 0;
|
||||
|
||||
@@ -1763,7 +1769,7 @@ void createMemoryRegionsForSharedAllocation(const HardwareInfo &hwInfo, MemoryIn
|
||||
}
|
||||
|
||||
if (allocationData.usmInitialPlacement == GraphicsAllocation::UsmInitialPlacement::GPU) {
|
||||
//System memory region
|
||||
// System memory region
|
||||
auto regionClassAndInstance = memoryInfo.getMemoryRegionClassAndInstance(0u, hwInfo);
|
||||
memRegions.push_back(regionClassAndInstance);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user