From 01b324953e8844036e57461f4502e20562da03a6 Mon Sep 17 00:00:00 2001 From: Mateusz Hoppe Date: Thu, 18 Aug 2022 13:02:46 +0000 Subject: [PATCH] L0Debug - allocate per-tile ISA when tileAttach is enabled Related-To: NEO-5784 Signed-off-by: Mateusz Hoppe --- .../definitions/storage_info.cpp | 2 +- .../unit_test/debugger/test_l0_debugger.cpp | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/shared/source/memory_manager/definitions/storage_info.cpp b/shared/source/memory_manager/definitions/storage_info.cpp index fe3a76dad6..e7e58bc5b6 100644 --- a/shared/source/memory_manager/definitions/storage_info.cpp +++ b/shared/source/memory_manager/definitions/storage_info.cpp @@ -47,7 +47,7 @@ StorageInfo MemoryManager::createStorageInfoFromProperties(const AllocationPrope case AllocationType::DEBUG_MODULE_AREA: { auto placeIsaOnMultiTile = (properties.subDevicesBitfield.count() != 1); - if (executionEnvironment.isDebuggingEnabled()) { + if (executionEnvironment.isDebuggingEnabled() && !DebugManager.flags.ExperimentalEnableTileAttach.get()) { placeIsaOnMultiTile = false; } diff --git a/shared/test/unit_test/debugger/test_l0_debugger.cpp b/shared/test/unit_test/debugger/test_l0_debugger.cpp index 5e6d6fd3e7..f926e65cdf 100644 --- a/shared/test/unit_test/debugger/test_l0_debugger.cpp +++ b/shared/test/unit_test/debugger/test_l0_debugger.cpp @@ -120,6 +120,34 @@ TEST(Debugger, givenDebuggingEnabledInExecEnvWhenAllocatingIsaThenSingleBankIsUs neoDevice->getMemoryManager()->freeGraphicsMemory(allocation); } +TEST(Debugger, givenTileAttachAndDebuggingEnabledInExecEnvWhenAllocatingIsaThenMultipleBanksAreUsed) { + DebugManagerStateRestore restorer; + NEO::DebugManager.flags.ExperimentalEnableTileAttach.set(1); + + auto executionEnvironment = new NEO::ExecutionEnvironment(); + executionEnvironment->prepareRootDeviceEnvironments(1); + executionEnvironment->setDebuggingEnabled(); + + auto hwInfo = *NEO::defaultHwInfo.get(); + hwInfo.featureTable.flags.ftrLocalMemory = true; + executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(&hwInfo); + executionEnvironment->rootDeviceEnvironments[0]->initGmm(); + executionEnvironment->initializeMemoryManager(); + + std::unique_ptr neoDevice(NEO::MockDevice::create(executionEnvironment, 0u)); + + auto allocation = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( + {neoDevice->getRootDeviceIndex(), 4096, NEO::AllocationType::KERNEL_ISA, DeviceBitfield{3}}); + + if (allocation->getMemoryPool() == MemoryPool::LocalMemory) { + EXPECT_EQ(3u, allocation->storageInfo.getMemoryBanks()); + } else { + EXPECT_EQ(0u, allocation->storageInfo.getMemoryBanks()); + } + + neoDevice->getMemoryManager()->freeGraphicsMemory(allocation); +} + TEST(Debugger, WhenInitializingDebuggerL0ThenCapabilitiesAreAdjustedAndDebuggerIsCreated) { auto executionEnvironment = new NEO::ExecutionEnvironment(); executionEnvironment->incRefInternal();