WSL - fixing allocation alignment

Signed-off-by: Jaroslaw Chodor <jaroslaw.chodor@intel.com>
This commit is contained in:
Jaroslaw Chodor
2021-08-20 03:56:09 +02:00
committed by Compute-Runtime-Automation
parent 2fab8ccf05
commit 766d56e300
4 changed files with 49 additions and 3 deletions

View File

@@ -199,7 +199,9 @@ GraphicsAllocation *WddmMemoryManager::allocateUSMHostGraphicsMemory(const Alloc
}
GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemoryWithAlignment(const AllocationData &allocationData) {
if (preferredAllocationMethod == GfxMemoryAllocationMethod::UseUmdSystemPtr) {
auto pageSize = NEO::OSInterface::osEnabled64kbPages ? MemoryConstants::pageSize64k : MemoryConstants::pageSize;
bool requiresNonStandardAlignment = allocationData.alignment > pageSize;
if ((preferredAllocationMethod == GfxMemoryAllocationMethod::UseUmdSystemPtr) || requiresNonStandardAlignment) {
return allocateSystemMemoryAndCreateGraphicsAllocationFromIt(allocationData);
} else {
return allocateGraphicsMemoryUsingKmdAndMapItToCpuVA(allocationData, NEO::OSInterface::osEnabled64kbPages);