fix: add missing AlignLocalMemoryVaTo2MB flag support
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
parent
7ca0210ef2
commit
5ccfd6f2be
|
@ -844,10 +844,14 @@ size_t ModuleImp::computeKernelIsaAllocationAlignedSizeWithPadding(size_t isaSiz
|
||||||
NEO::GraphicsAllocation *ModuleImp::allocateKernelsIsaMemory(size_t size) {
|
NEO::GraphicsAllocation *ModuleImp::allocateKernelsIsaMemory(size_t size) {
|
||||||
auto allocType = (this->type == ModuleType::builtin ? NEO::AllocationType::kernelIsaInternal : NEO::AllocationType::kernelIsa);
|
auto allocType = (this->type == ModuleType::builtin ? NEO::AllocationType::kernelIsaInternal : NEO::AllocationType::kernelIsa);
|
||||||
auto neoDevice = this->device->getNEODevice();
|
auto neoDevice = this->device->getNEODevice();
|
||||||
return neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({neoDevice->getRootDeviceIndex(),
|
|
||||||
size,
|
NEO::AllocationProperties properties{neoDevice->getRootDeviceIndex(), size, allocType, neoDevice->getDeviceBitfield()};
|
||||||
allocType,
|
|
||||||
neoDevice->getDeviceBitfield()});
|
if (NEO::debugManager.flags.AlignLocalMemoryVaTo2MB.get() == 1) {
|
||||||
|
properties.alignment = MemoryConstants::pageSize2M;
|
||||||
|
}
|
||||||
|
|
||||||
|
return neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModuleImp::createDebugZebin() {
|
void ModuleImp::createDebugZebin() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2019-2023 Intel Corporation
|
* Copyright (C) 2019-2024 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
|
@ -21,6 +21,10 @@ GraphicsAllocation *HeapHelper::getHeapAllocation(uint32_t heapType, size_t heap
|
||||||
allocationType = AllocationType::internalHeap;
|
allocationType = AllocationType::internalHeap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (NEO::debugManager.flags.AlignLocalMemoryVaTo2MB.get() == 1) {
|
||||||
|
alignment = MemoryConstants::pageSize2M;
|
||||||
|
}
|
||||||
|
|
||||||
auto allocation = this->storageForReuse->obtainReusableAllocation(heapSize, allocationType);
|
auto allocation = this->storageForReuse->obtainReusableAllocation(heapSize, allocationType);
|
||||||
if (allocation) {
|
if (allocation) {
|
||||||
return allocation.release();
|
return allocation.release();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2018-2023 Intel Corporation
|
* Copyright (C) 2018-2024 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
#include "shared/source/program/kernel_info.h"
|
#include "shared/source/program/kernel_info.h"
|
||||||
|
|
||||||
|
#include "shared/source/debug_settings/debug_settings_manager.h"
|
||||||
#include "shared/source/device/device.h"
|
#include "shared/source/device/device.h"
|
||||||
#include "shared/source/device_binary_format/zebin/zebin_elf.h"
|
#include "shared/source/device_binary_format/zebin/zebin_elf.h"
|
||||||
#include "shared/source/helpers/kernel_helpers.h"
|
#include "shared/source/helpers/kernel_helpers.h"
|
||||||
|
@ -59,6 +60,12 @@ bool KernelInfo::createKernelAllocation(const Device &device, bool internalIsa)
|
||||||
auto kernelIsaSize = heapInfo.kernelHeapSize;
|
auto kernelIsaSize = heapInfo.kernelHeapSize;
|
||||||
const auto allocType = internalIsa ? AllocationType::kernelIsaInternal : AllocationType::kernelIsa;
|
const auto allocType = internalIsa ? AllocationType::kernelIsaInternal : AllocationType::kernelIsa;
|
||||||
|
|
||||||
|
AllocationProperties properties = {device.getRootDeviceIndex(), kernelIsaSize, allocType, device.getDeviceBitfield()};
|
||||||
|
|
||||||
|
if (debugManager.flags.AlignLocalMemoryVaTo2MB.get() == 1) {
|
||||||
|
properties.alignment = MemoryConstants::pageSize2M;
|
||||||
|
}
|
||||||
|
|
||||||
if (device.getMemoryManager()->isKernelBinaryReuseEnabled()) {
|
if (device.getMemoryManager()->isKernelBinaryReuseEnabled()) {
|
||||||
auto lock = device.getMemoryManager()->lockKernelAllocationMap();
|
auto lock = device.getMemoryManager()->lockKernelAllocationMap();
|
||||||
auto kernelName = this->kernelDescriptor.kernelMetadata.kernelName;
|
auto kernelName = this->kernelDescriptor.kernelMetadata.kernelName;
|
||||||
|
@ -74,11 +81,11 @@ bool KernelInfo::createKernelAllocation(const Device &device, bool internalIsa)
|
||||||
device, kernelAllocation, 0, heapInfo.pKernelHeap,
|
device, kernelAllocation, 0, heapInfo.pKernelHeap,
|
||||||
static_cast<size_t>(kernelIsaSize));
|
static_cast<size_t>(kernelIsaSize));
|
||||||
} else {
|
} else {
|
||||||
kernelAllocation = device.getMemoryManager()->allocateGraphicsMemoryWithProperties({device.getRootDeviceIndex(), kernelIsaSize, allocType, device.getDeviceBitfield()});
|
kernelAllocation = device.getMemoryManager()->allocateGraphicsMemoryWithProperties(properties);
|
||||||
storedAllocations.insert(std::make_pair(kernelName, MemoryManager::KernelAllocationInfo(kernelAllocation, 1u)));
|
storedAllocations.insert(std::make_pair(kernelName, MemoryManager::KernelAllocationInfo(kernelAllocation, 1u)));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
kernelAllocation = device.getMemoryManager()->allocateGraphicsMemoryWithProperties({device.getRootDeviceIndex(), kernelIsaSize, allocType, device.getDeviceBitfield()});
|
kernelAllocation = device.getMemoryManager()->allocateGraphicsMemoryWithProperties(properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!kernelAllocation) {
|
if (!kernelAllocation) {
|
||||||
|
|
Loading…
Reference in New Issue