Refactor: Change decanonize method accessing point

Accessing decanonize method as a member of GmmHelper class object

Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
This commit is contained in:
Krzysztof Gibala
2022-04-25 19:34:32 +00:00
committed by Compute-Runtime-Automation
parent 7bb3bcbc05
commit 2fcda0a528
35 changed files with 147 additions and 91 deletions

View File

@@ -802,7 +802,8 @@ ze_result_t DebugSessionImp::readSbaRegisters(ze_device_thread_t thread, uint32_
auto scratchSpacePTSize = hwHelper.getRenderSurfaceStatePitch(renderSurfaceState.data());
auto threadOffset = getPerThreadScratchOffset(scratchSpacePTSize, convertToThreadId(thread));
auto scratchAllocationBase = NEO::GmmHelper::decanonize(hwHelper.getRenderSurfaceStateBaseAddress(renderSurfaceState.data()));
auto gmmHelper = connectedDevice->getNEODevice()->getGmmHelper();
auto scratchAllocationBase = gmmHelper->decanonize(hwHelper.getRenderSurfaceStateBaseAddress(renderSurfaceState.data()));
if (scratchAllocationBase != 0) {
ScratchSpaceBaseAddress = threadOffset + scratchAllocationBase;
}
@@ -987,9 +988,9 @@ ze_result_t DebugSessionImp::writeRegistersImp(ze_device_thread_t thread, uint32
}
bool DebugSessionImp::isValidGpuAddress(uint64_t address) {
auto decanonizedAddress = NEO::GmmHelper::decanonize(address);
auto gmm = connectedDevice->getNEODevice()->getGmmHelper();
bool validAddress = gmm->isValidCanonicalGpuAddress(address);
auto gmmHelper = connectedDevice->getNEODevice()->getGmmHelper();
auto decanonizedAddress = gmmHelper->decanonize(address);
bool validAddress = gmmHelper->isValidCanonicalGpuAddress(address);
if (address == decanonizedAddress || validAddress) {
return true;

View File

@@ -2044,7 +2044,8 @@ TEST(DebugSessionTest, givenCanonicalOrDecanonizedAddressWhenCheckingValidAddres
EXPECT_TRUE(sessionMock->isValidGpuAddress(address));
auto decanonized = NEO::GmmHelper::decanonize(address);
auto gmmHelper = neoDevice->getGmmHelper();
auto decanonized = gmmHelper->decanonize(address);
EXPECT_TRUE(sessionMock->isValidGpuAddress(decanonized));
}