From c3eec70a97303a8a910fb1cacb80e7319d453bde Mon Sep 17 00:00:00 2001 From: Michal Mrozek Date: Wed, 7 May 2025 09:09:37 +0000 Subject: [PATCH] refactor: remove not needed hw info member - it is false on all platforms. Signed-off-by: Michal Mrozek --- shared/source/gen12lp/hw_info_adln.cpp | 1 - shared/source/gen12lp/hw_info_adlp.cpp | 1 - shared/source/gen12lp/hw_info_adls.cpp | 1 - shared/source/gen12lp/hw_info_dg1.cpp | 1 - shared/source/gen12lp/hw_info_rkl.cpp | 1 - shared/source/gen12lp/hw_info_tgllp.cpp | 1 - shared/source/helpers/hw_info.h | 2 - .../source/memory_manager/memory_manager.cpp | 2 +- shared/source/xe2_hpg_core/hw_info_bmg.cpp | 1 - shared/source/xe2_hpg_core/hw_info_lnl.cpp | 1 - shared/source/xe3_core/hw_info_ptl.cpp | 1 - shared/source/xe_hpc_core/hw_info_pvc.cpp | 1 - shared/source/xe_hpg_core/hw_info_arl.cpp | 1 - shared/source/xe_hpg_core/hw_info_dg2.cpp | 1 - shared/source/xe_hpg_core/hw_info_mtl.cpp | 1 - ...nager_allocate_in_preferred_pool_tests.cpp | 4 +- .../memory_manager/memory_manager_tests.cpp | 42 +++---------------- 17 files changed, 8 insertions(+), 55 deletions(-) diff --git a/shared/source/gen12lp/hw_info_adln.cpp b/shared/source/gen12lp/hw_info_adln.cpp index 59d35e59dc..cf6a447002 100644 --- a/shared/source/gen12lp/hw_info_adln.cpp +++ b/shared/source/gen12lp/hw_info_adln.cpp @@ -66,7 +66,6 @@ const RuntimeCapabilityTable ADLN::capabilityTable{ true, // supportsOcl21Features false, // supportsOnDemandPageFaults false, // supportsIndependentForwardProgress - false, // hostPtrTrackingEnabled true, // isIntegratedDevice true, // supportsMediaBlock false, // p2pAccessSupported diff --git a/shared/source/gen12lp/hw_info_adlp.cpp b/shared/source/gen12lp/hw_info_adlp.cpp index d4d66e6e8b..f876b8d2be 100644 --- a/shared/source/gen12lp/hw_info_adlp.cpp +++ b/shared/source/gen12lp/hw_info_adlp.cpp @@ -66,7 +66,6 @@ const RuntimeCapabilityTable ADLP::capabilityTable{ true, // supportsOcl21Features false, // supportsOnDemandPageFaults false, // supportsIndependentForwardProgress - false, // hostPtrTrackingEnabled true, // isIntegratedDevice true, // supportsMediaBlock false, // p2pAccessSupported diff --git a/shared/source/gen12lp/hw_info_adls.cpp b/shared/source/gen12lp/hw_info_adls.cpp index 2db9a337e5..8d4f17e170 100644 --- a/shared/source/gen12lp/hw_info_adls.cpp +++ b/shared/source/gen12lp/hw_info_adls.cpp @@ -66,7 +66,6 @@ const RuntimeCapabilityTable ADLS::capabilityTable{ true, // supportsOcl21Features false, // supportsOnDemandPageFaults false, // supportsIndependentForwardProgress - false, // hostPtrTrackingEnabled true, // isIntegratedDevice true, // supportsMediaBlock false, // p2pAccessSupported diff --git a/shared/source/gen12lp/hw_info_dg1.cpp b/shared/source/gen12lp/hw_info_dg1.cpp index 82863e5d62..3ce92f4735 100644 --- a/shared/source/gen12lp/hw_info_dg1.cpp +++ b/shared/source/gen12lp/hw_info_dg1.cpp @@ -66,7 +66,6 @@ const RuntimeCapabilityTable DG1::capabilityTable{ true, // supportsOcl21Features false, // supportsOnDemandPageFaults false, // supportsIndependentForwardProgress - false, // hostPtrTrackingEnabled false, // isIntegratedDevice true, // supportsMediaBlock true, // p2pAccessSupported diff --git a/shared/source/gen12lp/hw_info_rkl.cpp b/shared/source/gen12lp/hw_info_rkl.cpp index 62cb8c65fc..239c6d528c 100644 --- a/shared/source/gen12lp/hw_info_rkl.cpp +++ b/shared/source/gen12lp/hw_info_rkl.cpp @@ -66,7 +66,6 @@ const RuntimeCapabilityTable RKL::capabilityTable{ true, // supportsOcl21Features false, // supportsOnDemandPageFaults false, // supportsIndependentForwardProgress - false, // hostPtrTrackingEnabled true, // isIntegratedDevice true, // supportsMediaBlock false, // p2pAccessSupported diff --git a/shared/source/gen12lp/hw_info_tgllp.cpp b/shared/source/gen12lp/hw_info_tgllp.cpp index 2c3fb06862..f27bc34170 100644 --- a/shared/source/gen12lp/hw_info_tgllp.cpp +++ b/shared/source/gen12lp/hw_info_tgllp.cpp @@ -66,7 +66,6 @@ const RuntimeCapabilityTable TGLLP::capabilityTable{ true, // supportsOcl21Features false, // supportsOnDemandPageFaults false, // supportsIndependentForwardProgress - false, // hostPtrTrackingEnabled true, // isIntegratedDevice true, // supportsMediaBlock false, // p2pAccessSupported diff --git a/shared/source/helpers/hw_info.h b/shared/source/helpers/hw_info.h index d837d5691f..9f35e13b1e 100644 --- a/shared/source/helpers/hw_info.h +++ b/shared/source/helpers/hw_info.h @@ -53,7 +53,6 @@ struct RuntimeCapabilityTable { bool supportsOcl21Features; bool supportsOnDemandPageFaults; bool supportsIndependentForwardProgress; - bool hostPtrTrackingEnabled; bool isIntegratedDevice; bool supportsMediaBlock; bool p2pAccessSupported; @@ -114,7 +113,6 @@ inline bool operator==(const RuntimeCapabilityTable &lhs, const RuntimeCapabilit result &= (lhs.supportsOcl21Features == rhs.supportsOcl21Features); result &= (lhs.supportsOnDemandPageFaults == rhs.supportsOnDemandPageFaults); result &= (lhs.supportsIndependentForwardProgress == rhs.supportsIndependentForwardProgress); - result &= (lhs.hostPtrTrackingEnabled == rhs.hostPtrTrackingEnabled); result &= (lhs.isIntegratedDevice == rhs.isIntegratedDevice); result &= (lhs.supportsMediaBlock == rhs.supportsMediaBlock); result &= (lhs.fusedEuEnabled == rhs.fusedEuEnabled); diff --git a/shared/source/memory_manager/memory_manager.cpp b/shared/source/memory_manager/memory_manager.cpp index 31f0cb8b6f..2d314c5a6d 100644 --- a/shared/source/memory_manager/memory_manager.cpp +++ b/shared/source/memory_manager/memory_manager.cpp @@ -1012,7 +1012,7 @@ bool MemoryManager::isHostPointerTrackingEnabled(uint32_t rootDeviceIndex) { if (debugManager.flags.EnableHostPtrTracking.get() != -1) { return !!debugManager.flags.EnableHostPtrTracking.get(); } - return (peekExecutionEnvironment().rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo()->capabilityTable.hostPtrTrackingEnabled | is32bit); + return is32bit; } bool MemoryManager::useNonSvmHostPtrAlloc(AllocationType allocationType, uint32_t rootDeviceIndex) { diff --git a/shared/source/xe2_hpg_core/hw_info_bmg.cpp b/shared/source/xe2_hpg_core/hw_info_bmg.cpp index 2dd9ea5faa..65d815358b 100644 --- a/shared/source/xe2_hpg_core/hw_info_bmg.cpp +++ b/shared/source/xe2_hpg_core/hw_info_bmg.cpp @@ -69,7 +69,6 @@ const RuntimeCapabilityTable BMG::capabilityTable{ true, // supportsOcl21Features true, // supportsOnDemandPageFaults true, // supportsIndependentForwardProgress - false, // hostPtrTrackingEnabled false, // isIntegratedDevice false, // supportsMediaBlock false, // p2pAccessSupported diff --git a/shared/source/xe2_hpg_core/hw_info_lnl.cpp b/shared/source/xe2_hpg_core/hw_info_lnl.cpp index 2caf75d952..48e8982b5e 100644 --- a/shared/source/xe2_hpg_core/hw_info_lnl.cpp +++ b/shared/source/xe2_hpg_core/hw_info_lnl.cpp @@ -67,7 +67,6 @@ const RuntimeCapabilityTable LNL::capabilityTable{ true, // supportsOcl21Features true, // supportsOnDemandPageFaults true, // supportsIndependentForwardProgress - false, // hostPtrTrackingEnabled true, // isIntegratedDevice false, // supportsMediaBlock false, // p2pAccessSupported diff --git a/shared/source/xe3_core/hw_info_ptl.cpp b/shared/source/xe3_core/hw_info_ptl.cpp index 9e9ddabbaa..aeb01f4551 100644 --- a/shared/source/xe3_core/hw_info_ptl.cpp +++ b/shared/source/xe3_core/hw_info_ptl.cpp @@ -67,7 +67,6 @@ const RuntimeCapabilityTable PTL::capabilityTable{ true, // supportsOcl21Features true, // supportsOnDemandPageFaults true, // supportsIndependentForwardProgress - false, // hostPtrTrackingEnabled true, // isIntegratedDevice false, // supportsMediaBlock false, // p2pAccessSupported diff --git a/shared/source/xe_hpc_core/hw_info_pvc.cpp b/shared/source/xe_hpc_core/hw_info_pvc.cpp index 8268ec64a1..2f6c1361aa 100644 --- a/shared/source/xe_hpc_core/hw_info_pvc.cpp +++ b/shared/source/xe_hpc_core/hw_info_pvc.cpp @@ -79,7 +79,6 @@ const RuntimeCapabilityTable PVC::capabilityTable{ true, // supportsOcl21Features true, // supportsOnDemandPageFaults true, // supportsIndependentForwardProgress - false, // hostPtrTrackingEnabled false, // isIntegratedDevice false, // supportsMediaBlock true, // p2pAccessSupported diff --git a/shared/source/xe_hpg_core/hw_info_arl.cpp b/shared/source/xe_hpg_core/hw_info_arl.cpp index 28d2bace76..fd13dbcca7 100644 --- a/shared/source/xe_hpg_core/hw_info_arl.cpp +++ b/shared/source/xe_hpg_core/hw_info_arl.cpp @@ -64,7 +64,6 @@ const RuntimeCapabilityTable ARL::capabilityTable{ true, // supportsOcl21Features false, // supportsOnDemandPageFaults false, // supportsIndependentForwardProgress - false, // hostPtrTrackingEnabled true, // isIntegratedDevice true, // supportsMediaBlock false, // p2pAccessSupported diff --git a/shared/source/xe_hpg_core/hw_info_dg2.cpp b/shared/source/xe_hpg_core/hw_info_dg2.cpp index 1ad3aadb50..a3ee334072 100644 --- a/shared/source/xe_hpg_core/hw_info_dg2.cpp +++ b/shared/source/xe_hpg_core/hw_info_dg2.cpp @@ -69,7 +69,6 @@ const RuntimeCapabilityTable DG2::capabilityTable{ true, // supportsOcl21Features false, // supportsOnDemandPageFaults false, // supportsIndependentForwardProgress - false, // hostPtrTrackingEnabled false, // isIntegratedDevice true, // supportsMediaBlock true, // p2pAccessSupported diff --git a/shared/source/xe_hpg_core/hw_info_mtl.cpp b/shared/source/xe_hpg_core/hw_info_mtl.cpp index 54010e8ecc..64ea790c90 100644 --- a/shared/source/xe_hpg_core/hw_info_mtl.cpp +++ b/shared/source/xe_hpg_core/hw_info_mtl.cpp @@ -65,7 +65,6 @@ const RuntimeCapabilityTable MTL::capabilityTable{ true, // supportsOcl21Features false, // supportsOnDemandPageFaults false, // supportsIndependentForwardProgress - false, // hostPtrTrackingEnabled true, // isIntegratedDevice true, // supportsMediaBlock false, // p2pAccessSupported diff --git a/shared/test/unit_test/memory_manager/memory_manager_allocate_in_preferred_pool_tests.cpp b/shared/test/unit_test/memory_manager/memory_manager_allocate_in_preferred_pool_tests.cpp index 8c23640df6..e1c6bb3de7 100644 --- a/shared/test/unit_test/memory_manager/memory_manager_allocate_in_preferred_pool_tests.cpp +++ b/shared/test/unit_test/memory_manager/memory_manager_allocate_in_preferred_pool_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2024 Intel Corporation + * Copyright (C) 2018-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -433,7 +433,7 @@ TEST(MemoryManagerTest, givenEnabled64kbPagesWhenGraphicsMemoryIsAllocatedWithHo auto allocation = memoryManager.allocateGraphicsMemory(allocData); ASSERT_NE(nullptr, allocation); - EXPECT_EQ((executionEnvironment.rootDeviceEnvironments[0u]->getHardwareInfo()->capabilityTable.hostPtrTrackingEnabled || is32bit), allocation->fragmentsStorage.fragmentCount); + EXPECT_EQ(is32bit, allocation->fragmentsStorage.fragmentCount); EXPECT_EQ(MemoryPool::system4KBPages, allocation->getMemoryPool()); memoryManager.freeGraphicsMemory(allocation); diff --git a/shared/test/unit_test/memory_manager/memory_manager_tests.cpp b/shared/test/unit_test/memory_manager/memory_manager_tests.cpp index c58c10fdf9..760db4f076 100644 --- a/shared/test/unit_test/memory_manager/memory_manager_tests.cpp +++ b/shared/test/unit_test/memory_manager/memory_manager_tests.cpp @@ -1693,7 +1693,7 @@ TEST(OsAgnosticMemoryManager, GivenEnabled64kbPagesWhenHostMemoryAllocationIsCre galloc = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize64k, AllocationType::bufferHostMemory, mockDeviceBitfield}); EXPECT_NE(nullptr, galloc); EXPECT_NE(nullptr, galloc->getUnderlyingBuffer()); - size_t size = (executionEnvironment.rootDeviceEnvironments[0u]->getHardwareInfo()->capabilityTable.hostPtrTrackingEnabled) ? MemoryConstants::pageSize64k : MemoryConstants::pageSize; + size_t size = MemoryConstants::pageSize; EXPECT_EQ(0u, (uintptr_t)galloc->getUnderlyingBuffer() % size); EXPECT_NE(0u, galloc->getGpuAddress()); @@ -1746,26 +1746,6 @@ TEST_P(OsAgnosticMemoryManagerWithParams, givenReducedGpuAddressSpaceWhenAllocat memoryManager.freeGraphicsMemory(allocation); } -TEST_P(OsAgnosticMemoryManagerWithParams, givenFullGpuAddressSpaceWhenAllocateGraphicsMemoryForHostPtrIsCalledThenAllocationWithFragmentsIsCreated) { - bool requiresL3Flush = GetParam(); - MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); - executionEnvironment.rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get()); - if ((!executionEnvironment.rootDeviceEnvironments[0]->isFullRangeSvm()) || !defaultHwInfo->capabilityTable.hostPtrTrackingEnabled) { - GTEST_SKIP(); - } - OsAgnosticMemoryManager memoryManager(executionEnvironment); - auto hostPtr = reinterpret_cast(0x5001); - AllocationProperties properties{0, false, 13, AllocationType::externalHostPtr, false, mockDeviceBitfield}; - properties.flags.flushL3RequiredForRead = properties.flags.flushL3RequiredForWrite = requiresL3Flush; - auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(properties, hostPtr); - EXPECT_NE(nullptr, allocation); - EXPECT_EQ(1u, allocation->fragmentsStorage.fragmentCount); - EXPECT_EQ(requiresL3Flush, allocation->isFlushL3Required()); - EXPECT_EQ(AllocationType::externalHostPtr, allocation->getAllocationType()); - - memoryManager.freeGraphicsMemory(allocation); -} - TEST_P(OsAgnosticMemoryManagerWithParams, givenDisabledHostPtrTrackingWhenAllocateGraphicsMemoryForHostPtrIsCalledThenAllocationWithoutFragmentsIsCreated) { if (is32bit) { GTEST_SKIP(); @@ -2009,10 +1989,9 @@ TEST(MemoryManager, givenBufferAndLimitedGPUWhenAllocatingGraphicsMemoryThenAllo memoryManager.freeGraphicsMemory(bufferAllocation); } -TEST(MemoryManager, givenBufferHostMemoryAndHostPtrTrackingDisabledWhenAllocatingGraphicsMemoryThenAllocateGraphicsMemoryForNonSvmHostPtrIsCalled) { +TEST(MemoryManager, givenBufferHostMemoryWhenAllocatingGraphicsMemoryThenAllocateGraphicsMemoryForNonSvmHostPtrIsCalled) { MockExecutionEnvironment executionEnvironment{}; HardwareInfo hwInfoLocal = *defaultHwInfo; - hwInfoLocal.capabilityTable.hostPtrTrackingEnabled = false; executionEnvironment.rootDeviceEnvironments[0u]->setHwInfoAndInitHelpers(&hwInfoLocal); executionEnvironment.rootDeviceEnvironments[0u]->initGmm(); @@ -2032,10 +2011,9 @@ TEST(MemoryManager, givenBufferHostMemoryAndHostPtrTrackingDisabledWhenAllocatin memoryManager.freeGraphicsMemory(bufferAllocation); } -TEST(MemoryManager, givenBufferHostMemoryAndHostPtrTrackingDisabledAndForce32bitAllocationsWhenAllocatingGraphicsMemoryThenAllocateGraphicsMemoryForNonSvmHostPtrIsNotCalled) { +TEST(MemoryManager, givenBufferHostMemoryAndForce32bitAllocationsWhenAllocatingGraphicsMemoryThenAllocateGraphicsMemoryForNonSvmHostPtrIsNotCalled) { MockExecutionEnvironment executionEnvironment{}; HardwareInfo hwInfoLocal = *defaultHwInfo; - hwInfoLocal.capabilityTable.hostPtrTrackingEnabled = false; executionEnvironment.rootDeviceEnvironments[0u]->setHwInfoAndInitHelpers(&hwInfoLocal); executionEnvironment.rootDeviceEnvironments[0u]->initGmm(); @@ -2891,7 +2869,7 @@ HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhenEnableHostPtrTrackingFlagIsS if (is32bit) { EXPECT_TRUE(memoryManager->isHostPointerTrackingEnabled(0u)); } else { - EXPECT_EQ(device->getHardwareInfo().capabilityTable.hostPtrTrackingEnabled, memoryManager->isHostPointerTrackingEnabled(0u)); + EXPECT_FALSE(memoryManager->isHostPointerTrackingEnabled(0u)); } } @@ -2918,18 +2896,8 @@ HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhenHostPtrTrackingModeThenNonSv EXPECT_EQ(false, result); } -HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhenHostPtrTrackingModeThenNonSvmBufferIsNotSet) { +HWTEST_F(MemoryAllocatorTest, givenMemoryManagerThenNonSvmBufferIsSetForBufferHostMemory) { HardwareInfo hwInfoLocal = *defaultHwInfo; - hwInfoLocal.capabilityTable.hostPtrTrackingEnabled = true; - memoryManager->peekExecutionEnvironment().rootDeviceEnvironments[0u]->setHwInfoAndInitHelpers(&hwInfoLocal); - int buffer = 0; - EXPECT_FALSE(memoryManager->isNonSvmBuffer(&buffer, AllocationType::externalHostPtr, 0u)); - EXPECT_FALSE(memoryManager->isNonSvmBuffer(&buffer, AllocationType::bufferHostMemory, 0u)); -} - -HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhenHostPtrTrackingDisabledAnd64bitsThenNonSvmBufferIsSetForBufferHostMemory) { - HardwareInfo hwInfoLocal = *defaultHwInfo; - hwInfoLocal.capabilityTable.hostPtrTrackingEnabled = false; memoryManager->peekExecutionEnvironment().rootDeviceEnvironments[0u]->setHwInfoAndInitHelpers(&hwInfoLocal); int buffer = 0; EXPECT_FALSE(memoryManager->isNonSvmBuffer(&buffer, AllocationType::externalHostPtr, 0u));