Create getGmmHelper function in MemoryManager

Related-To: NEO-6523
Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
This commit is contained in:
Krzysztof Gibala
2022-05-09 12:51:13 +00:00
committed by Compute-Runtime-Automation
parent 518595dd97
commit 4f1e01d279
12 changed files with 37 additions and 33 deletions

View File

@ -1072,7 +1072,7 @@ TEST(MemoryManagerTest, givenEnabledLocalMemoryWhenAllocatingSharedResourceCopyT
EXPECT_EQ(MemoryPool::LocalMemory, allocation->getMemoryPool());
EXPECT_EQ(0u, allocation->getDefaultGmm()->resourceParams.Flags.Info.NonLocalOnly);
auto gmmHelper = executionEnvironment->rootDeviceEnvironments[allocation->getRootDeviceIndex()].get()->getGmmHelper();
auto gmmHelper = memoryManager.getGmmHelper(allocation->getRootDeviceIndex());
EXPECT_LT(gmmHelper->canonize(memoryManager.getGfxPartition(allocation->getRootDeviceIndex())->getHeapBase(HeapIndex::HEAP_STANDARD64KB)), allocation->getGpuAddress());
EXPECT_GT(gmmHelper->canonize(memoryManager.getGfxPartition(allocation->getRootDeviceIndex())->getHeapLimit(HeapIndex::HEAP_STANDARD64KB)), allocation->getGpuAddress());
EXPECT_EQ(0llu, allocation->getGpuBaseAddress());

View File

@ -1308,7 +1308,7 @@ TEST(OsAgnosticMemoryManager, givenDebugModuleAreaTypeWhenCreatingAllocationThen
EXPECT_LT(address64bit, MemoryConstants::max32BitAddress);
EXPECT_TRUE(moduleDebugArea->is32BitAllocation());
auto gmmHelper = executionEnvironment.rootDeviceEnvironments[moduleDebugArea->getRootDeviceIndex()].get()->getGmmHelper();
auto gmmHelper = memoryManager.getGmmHelper(moduleDebugArea->getRootDeviceIndex());
auto frontWindowBase = gmmHelper->canonize(memoryManager.getGfxPartition(moduleDebugArea->getRootDeviceIndex())->getHeapBase(memoryManager.selectInternalHeap(moduleDebugArea->isAllocatedInLocalMemoryPool())));
EXPECT_EQ(frontWindowBase, moduleDebugArea->getGpuBaseAddress());
EXPECT_EQ(frontWindowBase, moduleDebugArea->getGpuAddress());
@ -1346,7 +1346,7 @@ TEST(OsAgnosticMemoryManager, givenLocalMemoryAndDebugModuleAreaTypeWhenCreating
EXPECT_LT(address64bit, MemoryConstants::max32BitAddress);
EXPECT_TRUE(moduleDebugArea->is32BitAllocation());
auto gmmHelper = executionEnvironment.rootDeviceEnvironments[moduleDebugArea->getRootDeviceIndex()].get()->getGmmHelper();
auto gmmHelper = memoryManager.getGmmHelper(moduleDebugArea->getRootDeviceIndex());
auto frontWindowBase = gmmHelper->canonize(memoryManager.getGfxPartition(moduleDebugArea->getRootDeviceIndex())->getHeapBase(memoryManager.selectInternalHeap(moduleDebugArea->isAllocatedInLocalMemoryPool())));
EXPECT_EQ(frontWindowBase, moduleDebugArea->getGpuBaseAddress());
EXPECT_EQ(frontWindowBase, moduleDebugArea->getGpuAddress());