Skip to content

Commit 4924a2e

Browse files
Allocate Sip kernel in front window
Signed-off-by: Mateusz Hoppe <[email protected]>
1 parent 330ee3d commit 4924a2e

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

opencl/test/unit_test/built_ins/built_in_tests.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2119,6 +2119,28 @@ TEST_F(BuiltInTests, WhenGettingSipKernelThenReturnProgramCreatedFromIsaAcquired
21192119
mockCompilerInterface->releaseDummyGenBinary();
21202120
}
21212121

2122+
TEST_F(BuiltInTests, WhenGettingSipKernelThenItIsAllocatedInFrontWindow) {
2123+
auto mockCompilerInterface = new MockCompilerInterface();
2124+
pDevice->getExecutionEnvironment()->rootDeviceEnvironments[rootDeviceIndex]->compilerInterface.reset(mockCompilerInterface);
2125+
auto builtins = new BuiltIns;
2126+
pDevice->getExecutionEnvironment()->rootDeviceEnvironments[rootDeviceIndex]->builtins.reset(builtins);
2127+
mockCompilerInterface->sipKernelBinaryOverride = mockCompilerInterface->getDummyGenBinary();
2128+
2129+
const SipKernel &sipKernel = builtins->getSipKernel(SipKernelType::Csr, *pDevice);
2130+
2131+
HeapAssigner heapAssigner;
2132+
bool useLocalMem = heapAssigner.useExternal32BitHeap(sipKernel.getSipAllocation()->getAllocationType()) ? HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily).heapInLocalMem(*defaultHwInfo) : false;
2133+
auto heap = heapAssigner.get32BitHeapIndex(sipKernel.getSipAllocation()->getAllocationType(), useLocalMem, *defaultHwInfo, true);
2134+
2135+
auto base = pDevice->getMemoryManager()->getGfxPartition(rootDeviceIndex)->getHeapBase(heap);
2136+
auto limit = pDevice->getMemoryManager()->getGfxPartition(rootDeviceIndex)->getHeapLimit(heap);
2137+
2138+
EXPECT_LE(base, GmmHelper::decanonize(sipKernel.getSipAllocation()->getGpuAddress()));
2139+
EXPECT_GT(limit, GmmHelper::decanonize(sipKernel.getSipAllocation()->getGpuAddress()));
2140+
2141+
mockCompilerInterface->releaseDummyGenBinary();
2142+
}
2143+
21222144
TEST_F(BuiltInTests, givenSipKernelWhenItIsCreatedThenItHasGraphicsAllocationForKernel) {
21232145
const SipKernel &sipKern = pDevice->getBuiltIns()->getSipKernel(SipKernelType::Csr, pContext->getDevice(0)->getDevice());
21242146
auto sipAllocation = sipKern.getSipAllocation();

shared/source/built_ins/built_ins.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const SipKernel &BuiltIns::getSipKernel(SipKernelType type, Device &device) {
4949
const auto allocType = GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL;
5050

5151
AllocationProperties properties = {device.getRootDeviceIndex(), sipBinary.size(), allocType, device.getDeviceBitfield()};
52-
properties.flags.use32BitFrontWindow = false;
52+
properties.flags.use32BitFrontWindow = true;
5353

5454
auto sipAllocation = device.getMemoryManager()->allocateGraphicsMemoryWithProperties(properties);
5555

0 commit comments

Comments
 (0)