refactor: remove not needed hw info member

- it is false on all platforms.

Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
Michal Mrozek
2025-05-07 09:09:37 +00:00
committed by Compute-Runtime-Automation
parent 35926a5a18
commit c3eec70a97
17 changed files with 8 additions and 55 deletions

View File

@@ -66,7 +66,6 @@ const RuntimeCapabilityTable ADLN::capabilityTable{
true, // supportsOcl21Features
false, // supportsOnDemandPageFaults
false, // supportsIndependentForwardProgress
false, // hostPtrTrackingEnabled
true, // isIntegratedDevice
true, // supportsMediaBlock
false, // p2pAccessSupported

View File

@@ -66,7 +66,6 @@ const RuntimeCapabilityTable ADLP::capabilityTable{
true, // supportsOcl21Features
false, // supportsOnDemandPageFaults
false, // supportsIndependentForwardProgress
false, // hostPtrTrackingEnabled
true, // isIntegratedDevice
true, // supportsMediaBlock
false, // p2pAccessSupported

View File

@@ -66,7 +66,6 @@ const RuntimeCapabilityTable ADLS::capabilityTable{
true, // supportsOcl21Features
false, // supportsOnDemandPageFaults
false, // supportsIndependentForwardProgress
false, // hostPtrTrackingEnabled
true, // isIntegratedDevice
true, // supportsMediaBlock
false, // p2pAccessSupported

View File

@@ -66,7 +66,6 @@ const RuntimeCapabilityTable DG1::capabilityTable{
true, // supportsOcl21Features
false, // supportsOnDemandPageFaults
false, // supportsIndependentForwardProgress
false, // hostPtrTrackingEnabled
false, // isIntegratedDevice
true, // supportsMediaBlock
true, // p2pAccessSupported

View File

@@ -66,7 +66,6 @@ const RuntimeCapabilityTable RKL::capabilityTable{
true, // supportsOcl21Features
false, // supportsOnDemandPageFaults
false, // supportsIndependentForwardProgress
false, // hostPtrTrackingEnabled
true, // isIntegratedDevice
true, // supportsMediaBlock
false, // p2pAccessSupported

View File

@@ -66,7 +66,6 @@ const RuntimeCapabilityTable TGLLP::capabilityTable{
true, // supportsOcl21Features
false, // supportsOnDemandPageFaults
false, // supportsIndependentForwardProgress
false, // hostPtrTrackingEnabled
true, // isIntegratedDevice
true, // supportsMediaBlock
false, // p2pAccessSupported

View File

@@ -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);

View File

@@ -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) {

View File

@@ -69,7 +69,6 @@ const RuntimeCapabilityTable BMG::capabilityTable{
true, // supportsOcl21Features
true, // supportsOnDemandPageFaults
true, // supportsIndependentForwardProgress
false, // hostPtrTrackingEnabled
false, // isIntegratedDevice
false, // supportsMediaBlock
false, // p2pAccessSupported

View File

@@ -67,7 +67,6 @@ const RuntimeCapabilityTable LNL::capabilityTable{
true, // supportsOcl21Features
true, // supportsOnDemandPageFaults
true, // supportsIndependentForwardProgress
false, // hostPtrTrackingEnabled
true, // isIntegratedDevice
false, // supportsMediaBlock
false, // p2pAccessSupported

View File

@@ -67,7 +67,6 @@ const RuntimeCapabilityTable PTL::capabilityTable{
true, // supportsOcl21Features
true, // supportsOnDemandPageFaults
true, // supportsIndependentForwardProgress
false, // hostPtrTrackingEnabled
true, // isIntegratedDevice
false, // supportsMediaBlock
false, // p2pAccessSupported

View File

@@ -79,7 +79,6 @@ const RuntimeCapabilityTable PVC::capabilityTable{
true, // supportsOcl21Features
true, // supportsOnDemandPageFaults
true, // supportsIndependentForwardProgress
false, // hostPtrTrackingEnabled
false, // isIntegratedDevice
false, // supportsMediaBlock
true, // p2pAccessSupported

View File

@@ -64,7 +64,6 @@ const RuntimeCapabilityTable ARL::capabilityTable{
true, // supportsOcl21Features
false, // supportsOnDemandPageFaults
false, // supportsIndependentForwardProgress
false, // hostPtrTrackingEnabled
true, // isIntegratedDevice
true, // supportsMediaBlock
false, // p2pAccessSupported

View File

@@ -69,7 +69,6 @@ const RuntimeCapabilityTable DG2::capabilityTable{
true, // supportsOcl21Features
false, // supportsOnDemandPageFaults
false, // supportsIndependentForwardProgress
false, // hostPtrTrackingEnabled
false, // isIntegratedDevice
true, // supportsMediaBlock
true, // p2pAccessSupported

View File

@@ -65,7 +65,6 @@ const RuntimeCapabilityTable MTL::capabilityTable{
true, // supportsOcl21Features
false, // supportsOnDemandPageFaults
false, // supportsIndependentForwardProgress
false, // hostPtrTrackingEnabled
true, // isIntegratedDevice
true, // supportsMediaBlock
false, // p2pAccessSupported

View File

@@ -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);

View File

@@ -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<const void *>(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));