fix: osAgnostic path for allocate with alignment

Resolves: NEO-9334
Signed-off-by: Katarzyna Cencelewska <katarzyna.cencelewska@intel.com>
This commit is contained in:
Katarzyna Cencelewska
2024-01-25 10:09:26 +00:00
committed by Compute-Runtime-Automation
parent fdb5a53f85
commit 67b0b18be3
11 changed files with 63 additions and 50 deletions

View File

@@ -361,8 +361,8 @@ HWCMDTEST_P(IGFX_GEN8_CORE, EnqueueScratchSpaceTests, GivenKernelRequiringScratc
EXPECT_EQ(gsHaddress + ScratchSpaceConstants::scratchSpaceOffsetFor64Bit, graphicsAllocation->getGpuAddress());
}
auto allocationSize = scratchSize * pDevice->getDeviceInfo().computeUnitsUsedForScratch;
EXPECT_EQ(graphicsAllocation->getUnderlyingBufferSize(), allocationSize);
auto allocationSize = alignUp(scratchSize * pDevice->getDeviceInfo().computeUnitsUsedForScratch, MemoryConstants::pageMask);
EXPECT_EQ(allocationSize, graphicsAllocation->getUnderlyingBufferSize());
// Generically validate this command
Parse::template validateCommand<MEDIA_VFE_STATE *>(cmdList.begin(), itorCmd);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2023 Intel Corporation
* Copyright (C) 2018-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -140,7 +140,7 @@ HWTEST_P(EnqueueSvmMemFillTest, givenEnqueueSVMMemFillWhenUsingFillBufferBuilder
}
void validateInput(const BuiltinOpParams &conf) const override {
auto patternAllocation = conf.srcMemObj->getMultiGraphicsAllocation().getDefaultGraphicsAllocation();
EXPECT_EQ(patternSize, patternAllocation->getUnderlyingBufferSize());
EXPECT_EQ(MemoryConstants::pageSize, patternAllocation->getUnderlyingBufferSize());
EXPECT_EQ(0, memcmp(pattern, patternAllocation->getUnderlyingBuffer(), patternSize));
};
const void *pattern;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2023 Intel Corporation
* Copyright (C) 2018-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -91,12 +91,12 @@ TEST_F(CommandStreamReceiverMultiRootDeviceTest, WhenCreatingCommandStreamGraphi
commandStreamReceiver->ensureCommandBufferAllocation(commandStream, 100u, 0u);
EXPECT_EQ(allocation, commandStream.getGraphicsAllocation());
EXPECT_EQ(128u, commandStream.getMaxAvailableSpace());
EXPECT_EQ(MemoryConstants::pageSize, commandStream.getMaxAvailableSpace());
EXPECT_EQ(expectedRootDeviceIndex, commandStream.getGraphicsAllocation()->getRootDeviceIndex());
commandStreamReceiver->ensureCommandBufferAllocation(commandStream, 1024u, 0u);
commandStreamReceiver->ensureCommandBufferAllocation(commandStream, MemoryConstants::pageSize64k, 0u);
EXPECT_NE(allocation, commandStream.getGraphicsAllocation());
EXPECT_EQ(0u, commandStream.getMaxAvailableSpace() % MemoryConstants::pageSize64k);
EXPECT_EQ(0u, commandStream.getMaxAvailableSpace() % MemoryConstants::pageSize);
EXPECT_EQ(expectedRootDeviceIndex, commandStream.getGraphicsAllocation()->getRootDeviceIndex());
mockMemoryManager->freeGraphicsMemory(commandStream.getGraphicsAllocation());