Add padding for ISA allocations

Related-To: NEO-5771
Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
Dominik Dabek
2021-04-23 14:09:03 +00:00
committed by Compute-Runtime-Automation
parent 0d05ef2a3c
commit bb9d902899
11 changed files with 72 additions and 14 deletions

View File

@ -45,7 +45,8 @@ TEST(KernelInfoTest, givenKernelInfoWhenCreateKernelAllocationThenCopyWholeKerne
EXPECT_TRUE(retVal);
auto allocation = kernelInfo.kernelAllocation;
EXPECT_EQ(0, memcmp(allocation->getUnderlyingBuffer(), heap, heapSize));
EXPECT_EQ(heapSize, allocation->getUnderlyingBufferSize());
size_t isaPadding = HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily).getPaddingForISAAllocation();
EXPECT_EQ(allocation->getUnderlyingBufferSize(), heapSize + isaPadding);
device->getMemoryManager()->checkGpuUsageAndDestroyGraphicsAllocations(allocation);
}

View File

@ -579,7 +579,9 @@ TEST_F(ProgramFromBinaryTest, givenProgramWhenItIsBeingBuildThenItContainsGraphi
auto graphicsAllocation = kernelInfo->getGraphicsAllocation();
ASSERT_NE(nullptr, graphicsAllocation);
EXPECT_TRUE(graphicsAllocation->is32BitAllocation());
EXPECT_EQ(graphicsAllocation->getUnderlyingBufferSize(), kernelInfo->heapInfo.KernelHeapSize);
auto &hwHelper = NEO::HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily);
size_t isaPadding = hwHelper.getPaddingForISAAllocation();
EXPECT_EQ(graphicsAllocation->getUnderlyingBufferSize(), kernelInfo->heapInfo.KernelHeapSize + isaPadding);
auto kernelIsa = graphicsAllocation->getUnderlyingBuffer();
EXPECT_NE(kernelInfo->heapInfo.pKernelHeap, kernelIsa);