Skip to content

Commit 01b3249

Browse files
L0Debug - allocate per-tile ISA when tileAttach is enabled
Related-To: NEO-5784 Signed-off-by: Mateusz Hoppe <[email protected]>
1 parent 0011368 commit 01b3249

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

shared/source/memory_manager/definitions/storage_info.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ StorageInfo MemoryManager::createStorageInfoFromProperties(const AllocationPrope
4747
case AllocationType::DEBUG_MODULE_AREA: {
4848
auto placeIsaOnMultiTile = (properties.subDevicesBitfield.count() != 1);
4949

50-
if (executionEnvironment.isDebuggingEnabled()) {
50+
if (executionEnvironment.isDebuggingEnabled() && !DebugManager.flags.ExperimentalEnableTileAttach.get()) {
5151
placeIsaOnMultiTile = false;
5252
}
5353

shared/test/unit_test/debugger/test_l0_debugger.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,34 @@ TEST(Debugger, givenDebuggingEnabledInExecEnvWhenAllocatingIsaThenSingleBankIsUs
120120
neoDevice->getMemoryManager()->freeGraphicsMemory(allocation);
121121
}
122122

123+
TEST(Debugger, givenTileAttachAndDebuggingEnabledInExecEnvWhenAllocatingIsaThenMultipleBanksAreUsed) {
124+
DebugManagerStateRestore restorer;
125+
NEO::DebugManager.flags.ExperimentalEnableTileAttach.set(1);
126+
127+
auto executionEnvironment = new NEO::ExecutionEnvironment();
128+
executionEnvironment->prepareRootDeviceEnvironments(1);
129+
executionEnvironment->setDebuggingEnabled();
130+
131+
auto hwInfo = *NEO::defaultHwInfo.get();
132+
hwInfo.featureTable.flags.ftrLocalMemory = true;
133+
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(&hwInfo);
134+
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
135+
executionEnvironment->initializeMemoryManager();
136+
137+
std::unique_ptr<NEO::MockDevice> neoDevice(NEO::MockDevice::create<NEO::MockDevice>(executionEnvironment, 0u));
138+
139+
auto allocation = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(
140+
{neoDevice->getRootDeviceIndex(), 4096, NEO::AllocationType::KERNEL_ISA, DeviceBitfield{3}});
141+
142+
if (allocation->getMemoryPool() == MemoryPool::LocalMemory) {
143+
EXPECT_EQ(3u, allocation->storageInfo.getMemoryBanks());
144+
} else {
145+
EXPECT_EQ(0u, allocation->storageInfo.getMemoryBanks());
146+
}
147+
148+
neoDevice->getMemoryManager()->freeGraphicsMemory(allocation);
149+
}
150+
123151
TEST(Debugger, WhenInitializingDebuggerL0ThenCapabilitiesAreAdjustedAndDebuggerIsCreated) {
124152
auto executionEnvironment = new NEO::ExecutionEnvironment();
125153
executionEnvironment->incRefInternal();

0 commit comments

Comments
 (0)