Disable GEM_WAIT when new residency model available

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2021-04-29 08:58:16 +00:00
committed by Compute-Runtime-Automation
parent 3dbe37c423
commit 8e1e213bcf
23 changed files with 119 additions and 45 deletions

View File

@ -730,6 +730,27 @@ TEST(OsAgnosticMemoryManager, givenDefaultMemoryManagerWhenAllocateGraphicsMemor
memoryManager.freeGraphicsMemory(imageAllocation);
}
TEST(OsAgnosticMemoryManager, givenDestroyedTagAllocationWhenWaitForCompletiionThenWaitForTaskCountIsNotCalled) {
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
auto memoryManager = new OsAgnosticMemoryManager(executionEnvironment);
DeviceBitfield deviceBitfield(1);
std::unique_ptr<CommandStreamReceiver> csr(createCommandStream(executionEnvironment, 0u, deviceBitfield));
executionEnvironment.memoryManager.reset(memoryManager);
auto osContext = memoryManager->createAndRegisterOsContext(csr.get(),
HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[0],
deviceBitfield,
PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo),
false);
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{0, MemoryConstants::pageSize});
allocation->updateTaskCount(10, osContext->getContextId());
EXPECT_GT(allocation->getTaskCount(osContext->getContextId()), csr->peekTaskCount());
memoryManager->waitForEnginesCompletion(*allocation);
memoryManager->freeGraphicsMemory(allocation);
}
TEST(OsAgnosticMemoryManager, givenEnabledLocalMemoryWhenAllocateGraphicsMemoryForImageIsCalledThenUseLocalMemoryIsNotSet) {
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
MockMemoryManager memoryManager(false, true, *executionEnvironment);