fix: add missing residency management in heapless mode

Related-To: NEO-7824

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe 2024-05-06 10:14:48 +00:00 committed by Compute-Runtime-Automation
parent 6bcf3eb41d
commit 0a59a26a2c
2 changed files with 32 additions and 0 deletions

View File

@ -156,6 +156,15 @@ ze_result_t CommandQueueHw<gfxCoreFamily>::executeCommandListsRegularHeapless(
return ret;
}
this->getGlobalFenceAndMakeItResident();
this->getWorkPartitionAndMakeItResident();
this->getGlobalStatelessHeapAndMakeItResident(ctx);
this->makePreemptionAllocationResidentForModeMidThread(ctx.isDevicePreemptionModeMidThread);
this->makeSipIsaResidentIfSipKernelUsed(ctx);
this->makeDebugSurfaceResidentIfNEODebuggerActive(ctx.isNEODebuggerActive(this->device));
this->makeRayTracingBufferResident(neoDevice->getRTMemoryBackedBuffer());
this->makeSbaTrackingBufferResidentIfL0DebuggerEnabled(ctx.isDebugEnabled);
this->makeCsrTagAllocationResident();
if (instructionCacheFlushRequired) {

View File

@ -2868,5 +2868,28 @@ HWTEST2_F(CommandListStateBaseAddressGlobalStatelessTest,
otherCommandQueue->destroy();
}
HWTEST2_F(CommandListStateBaseAddressGlobalStatelessTest, givenGlobalStatelessAndHeaplessModeWhenExecutingCommandListThenMakeAllocationResident, IsAtLeastXeHpCore) {
EXPECT_EQ(NEO::HeapAddressModel::globalStateless, commandList->cmdListHeapAddressModel);
EXPECT_EQ(NEO::HeapAddressModel::globalStateless, commandListImmediate->cmdListHeapAddressModel);
EXPECT_EQ(NEO::HeapAddressModel::globalStateless, commandQueue->cmdListHeapAddressModel);
commandQueue->heaplessModeEnabled = true;
ASSERT_EQ(commandListImmediate->csr, commandQueue->getCsr());
auto globalStatelessAlloc = commandListImmediate->csr->getGlobalStatelessHeapAllocation();
EXPECT_NE(nullptr, globalStatelessAlloc);
auto ultCsr = static_cast<UltCommandStreamReceiver<FamilyType> *>(commandListImmediate->csr);
ultCsr->storeMakeResidentAllocations = true;
commandList->close();
ze_command_list_handle_t cmdListHandle = commandList->toHandle();
auto result = commandQueue->executeCommandLists(1, &cmdListHandle, nullptr, true, nullptr, 0, nullptr);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_TRUE(ultCsr->isMadeResident(globalStatelessAlloc));
}
} // namespace ult
} // namespace L0