mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Allocate Sip kernel in front window
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
330ee3d227
commit
4924a2e741
@ -2119,6 +2119,28 @@ TEST_F(BuiltInTests, WhenGettingSipKernelThenReturnProgramCreatedFromIsaAcquired
|
||||
mockCompilerInterface->releaseDummyGenBinary();
|
||||
}
|
||||
|
||||
TEST_F(BuiltInTests, WhenGettingSipKernelThenItIsAllocatedInFrontWindow) {
|
||||
auto mockCompilerInterface = new MockCompilerInterface();
|
||||
pDevice->getExecutionEnvironment()->rootDeviceEnvironments[rootDeviceIndex]->compilerInterface.reset(mockCompilerInterface);
|
||||
auto builtins = new BuiltIns;
|
||||
pDevice->getExecutionEnvironment()->rootDeviceEnvironments[rootDeviceIndex]->builtins.reset(builtins);
|
||||
mockCompilerInterface->sipKernelBinaryOverride = mockCompilerInterface->getDummyGenBinary();
|
||||
|
||||
const SipKernel &sipKernel = builtins->getSipKernel(SipKernelType::Csr, *pDevice);
|
||||
|
||||
HeapAssigner heapAssigner;
|
||||
bool useLocalMem = heapAssigner.useExternal32BitHeap(sipKernel.getSipAllocation()->getAllocationType()) ? HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily).heapInLocalMem(*defaultHwInfo) : false;
|
||||
auto heap = heapAssigner.get32BitHeapIndex(sipKernel.getSipAllocation()->getAllocationType(), useLocalMem, *defaultHwInfo, true);
|
||||
|
||||
auto base = pDevice->getMemoryManager()->getGfxPartition(rootDeviceIndex)->getHeapBase(heap);
|
||||
auto limit = pDevice->getMemoryManager()->getGfxPartition(rootDeviceIndex)->getHeapLimit(heap);
|
||||
|
||||
EXPECT_LE(base, GmmHelper::decanonize(sipKernel.getSipAllocation()->getGpuAddress()));
|
||||
EXPECT_GT(limit, GmmHelper::decanonize(sipKernel.getSipAllocation()->getGpuAddress()));
|
||||
|
||||
mockCompilerInterface->releaseDummyGenBinary();
|
||||
}
|
||||
|
||||
TEST_F(BuiltInTests, givenSipKernelWhenItIsCreatedThenItHasGraphicsAllocationForKernel) {
|
||||
const SipKernel &sipKern = pDevice->getBuiltIns()->getSipKernel(SipKernelType::Csr, pContext->getDevice(0)->getDevice());
|
||||
auto sipAllocation = sipKern.getSipAllocation();
|
||||
|
Reference in New Issue
Block a user