Allocate single Isa instance when debugging enabled

- Related-To: NEO-6221

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2021-09-08 07:44:06 +00:00
committed by Compute-Runtime-Automation
parent ae6d58bcb0
commit 8d3438a5fb
2 changed files with 25 additions and 2 deletions

View File

@@ -108,6 +108,30 @@ TEST(Debugger, givenL0DebuggerOFFWhenGettingStateSaveAreaHeaderThenValidSipTypeI
}
}
TEST(Debugger, givenDebuggingEnabledInExecEnvWhenAllocatingIsaThenSingleBankIsUsed) {
auto executionEnvironment = new NEO::ExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->setDebuggingEnabled();
auto hwInfo = *NEO::defaultHwInfo.get();
hwInfo.featureTable.ftrLocalMemory = true;
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(&hwInfo);
executionEnvironment->initializeMemoryManager();
std::unique_ptr<NEO::MockDevice> neoDevice(NEO::MockDevice::create<NEO::MockDevice>(executionEnvironment, 0u));
auto allocation = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(
{neoDevice->getRootDeviceIndex(), 4096, NEO::GraphicsAllocation::AllocationType::KERNEL_ISA, neoDevice->getDeviceBitfield()});
if (allocation->getMemoryPool() == MemoryPool::LocalMemory) {
EXPECT_EQ(1u, allocation->storageInfo.getMemoryBanks());
} else {
EXPECT_EQ(0u, allocation->storageInfo.getMemoryBanks());
}
neoDevice->getMemoryManager()->freeGraphicsMemory(allocation);
}
HWTEST_F(L0DebuggerTest, givenL0DebuggerWhenCreatedThenPerContextSbaTrackingBuffersAreAllocated) {
auto debugger = device->getL0Debugger();
ASSERT_NE(nullptr, debugger);