fix: separate isUsmPoolAllocatorSupported for host and device
Related-To: NEO-12287, HSD-18041505773 Signed-off-by: Fabian Zwoliński <fabian.zwolinski@intel.com>
This commit is contained in:
parent
855581d03d
commit
ad968550e8
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2024 Intel Corporation
|
||||
* Copyright (C) 2024-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -39,7 +39,7 @@ struct AllocUsmPoolMemoryTest : public ::testing::Test {
|
|||
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(NEO::defaultHwInfo.get());
|
||||
executionEnvironment->rootDeviceEnvironments[i]->initGmm();
|
||||
if (1 == deviceUsmPoolFlag) {
|
||||
mockProductHelpers[i]->isUsmPoolAllocatorSupportedResult = true;
|
||||
mockProductHelpers[i]->isDeviceUsmPoolAllocatorSupportedResult = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -553,7 +553,7 @@ void Context::initializeUsmAllocationPools() {
|
|||
}
|
||||
|
||||
auto &productHelper = getDevices()[0]->getProductHelper();
|
||||
bool enabled = ApiSpecificConfig::isDeviceUsmPoolingEnabled() && productHelper.isUsmPoolAllocatorSupported();
|
||||
bool enabled = ApiSpecificConfig::isDeviceUsmPoolingEnabled() && productHelper.isDeviceUsmPoolAllocatorSupported();
|
||||
|
||||
auto usmDevicePoolParams = getUsmDevicePoolParams();
|
||||
if (debugManager.flags.EnableDeviceUsmAllocationPool.get() != -1) {
|
||||
|
@ -570,7 +570,7 @@ void Context::initializeUsmAllocationPools() {
|
|||
usmDeviceMemAllocPool.initialize(svmMemoryManager, memoryProperties, usmDevicePoolParams.poolSize, usmDevicePoolParams.minServicedSize, usmDevicePoolParams.maxServicedSize);
|
||||
}
|
||||
|
||||
enabled = ApiSpecificConfig::isHostUsmPoolingEnabled() && productHelper.isUsmPoolAllocatorSupported();
|
||||
enabled = ApiSpecificConfig::isHostUsmPoolingEnabled() && productHelper.isHostUsmPoolAllocatorSupported();
|
||||
auto usmHostPoolParams = getUsmHostPoolParams();
|
||||
if (debugManager.flags.EnableHostUsmAllocationPool.get() != -1) {
|
||||
enabled = debugManager.flags.EnableHostUsmAllocationPool.get() > 0;
|
||||
|
|
|
@ -904,7 +904,8 @@ TEST_F(ContextUsmPoolParamsTest, GivenEnabled2MBLocalMemAlignmentWhenGettingUsmP
|
|||
}
|
||||
|
||||
TEST_F(ContextUsmPoolParamsTest, GivenUsmPoolAllocatorSupportedWhenInitializingUsmPoolsThenPoolsAreInitializedWithCorrectParams) {
|
||||
mockProductHelper->isUsmPoolAllocatorSupportedResult = true;
|
||||
mockProductHelper->isHostUsmPoolAllocatorSupportedResult = true;
|
||||
mockProductHelper->isDeviceUsmPoolAllocatorSupportedResult = true;
|
||||
|
||||
cl_device_id devices[] = {device};
|
||||
context.reset(Context::create<MockContext>(nullptr, ClDeviceVector(devices, 1), nullptr, nullptr, retVal));
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2023-2024 Intel Corporation
|
||||
* Copyright (C) 2023-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -110,8 +110,8 @@ TEST_F(ContextUsmPoolEnabledFlagsTestDefault, givenDefaultDebugSettingsThenPoolI
|
|||
clMemFreeINTEL(mockContext.get(), pooledHostAlloc);
|
||||
|
||||
auto &productHelper = mockContext->getDevice(0u)->getProductHelper();
|
||||
bool enabledDevice = ApiSpecificConfig::isDeviceUsmPoolingEnabled() && productHelper.isUsmPoolAllocatorSupported();
|
||||
bool enabledHost = ApiSpecificConfig::isHostUsmPoolingEnabled() && productHelper.isUsmPoolAllocatorSupported();
|
||||
bool enabledDevice = ApiSpecificConfig::isDeviceUsmPoolingEnabled() && productHelper.isDeviceUsmPoolAllocatorSupported();
|
||||
bool enabledHost = ApiSpecificConfig::isHostUsmPoolingEnabled() && productHelper.isHostUsmPoolAllocatorSupported();
|
||||
|
||||
EXPECT_EQ(enabledDevice, mockDeviceUsmMemAllocPool->isInitialized());
|
||||
EXPECT_EQ(enabledHost, mockHostUsmMemAllocPool->isInitialized());
|
||||
|
|
|
@ -200,7 +200,7 @@ void Device::initializeCommonResources() {
|
|||
}
|
||||
|
||||
if (ApiSpecificConfig::isDeviceUsmPoolingEnabled() &&
|
||||
getProductHelper().isUsmPoolAllocatorSupported() &&
|
||||
getProductHelper().isDeviceUsmPoolAllocatorSupported() &&
|
||||
NEO::debugManager.flags.ExperimentalUSMAllocationReuseVersion.get() == 2) {
|
||||
|
||||
RootDeviceIndicesContainer rootDeviceIndices;
|
||||
|
|
|
@ -180,7 +180,8 @@ class ProductHelper {
|
|||
virtual bool isNonBlockingGpuSubmissionSupported() const = 0;
|
||||
virtual bool isResolveDependenciesByPipeControlsSupported(const HardwareInfo &hwInfo, bool isOOQ, TaskCountType queueTaskCount, const CommandStreamReceiver &queueCsr) const = 0;
|
||||
virtual bool isBufferPoolAllocatorSupported() const = 0;
|
||||
virtual bool isUsmPoolAllocatorSupported() const = 0;
|
||||
virtual bool isHostUsmPoolAllocatorSupported() const = 0;
|
||||
virtual bool isDeviceUsmPoolAllocatorSupported() const = 0;
|
||||
virtual bool isDeviceUsmAllocationReuseSupported() const = 0;
|
||||
virtual bool isHostUsmAllocationReuseSupported() const = 0;
|
||||
virtual bool useLocalPreferredForCacheableBuffers() const = 0;
|
||||
|
|
|
@ -122,7 +122,8 @@ class ProductHelperHw : public ProductHelper {
|
|||
bool isNonBlockingGpuSubmissionSupported() const override;
|
||||
bool isResolveDependenciesByPipeControlsSupported(const HardwareInfo &hwInfo, bool isOOQ, TaskCountType queueTaskCount, const CommandStreamReceiver &queueCsr) const override;
|
||||
bool isBufferPoolAllocatorSupported() const override;
|
||||
bool isUsmPoolAllocatorSupported() const override;
|
||||
bool isHostUsmPoolAllocatorSupported() const override;
|
||||
bool isDeviceUsmPoolAllocatorSupported() const override;
|
||||
bool isDeviceUsmAllocationReuseSupported() const override;
|
||||
bool isHostUsmAllocationReuseSupported() const override;
|
||||
bool useLocalPreferredForCacheableBuffers() const override;
|
||||
|
|
|
@ -99,7 +99,12 @@ bool ProductHelperHw<gfxProduct>::isBufferPoolAllocatorSupported() const {
|
|||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool ProductHelperHw<gfxProduct>::isUsmPoolAllocatorSupported() const {
|
||||
bool ProductHelperHw<gfxProduct>::isHostUsmPoolAllocatorSupported() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool ProductHelperHw<gfxProduct>::isDeviceUsmPoolAllocatorSupported() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -132,7 +132,12 @@ bool ProductHelperHw<gfxProduct>::isBufferPoolAllocatorSupported() const {
|
|||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool ProductHelperHw<gfxProduct>::isUsmPoolAllocatorSupported() const {
|
||||
bool ProductHelperHw<gfxProduct>::isHostUsmPoolAllocatorSupported() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool ProductHelperHw<gfxProduct>::isDeviceUsmPoolAllocatorSupported() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2022-2024 Intel Corporation
|
||||
* Copyright (C) 2022-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -60,7 +60,12 @@ bool ProductHelperHw<gfxProduct>::isBufferPoolAllocatorSupported() const {
|
|||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool ProductHelperHw<gfxProduct>::isUsmPoolAllocatorSupported() const {
|
||||
bool ProductHelperHw<gfxProduct>::isHostUsmPoolAllocatorSupported() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool ProductHelperHw<gfxProduct>::isDeviceUsmPoolAllocatorSupported() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2024 Intel Corporation
|
||||
* Copyright (C) 2021-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -205,7 +205,12 @@ bool ProductHelperHw<gfxProduct>::isBufferPoolAllocatorSupported() const {
|
|||
}
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<gfxProduct>::isUsmPoolAllocatorSupported() const {
|
||||
bool ProductHelperHw<gfxProduct>::isHostUsmPoolAllocatorSupported() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<gfxProduct>::isDeviceUsmPoolAllocatorSupported() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2022-2024 Intel Corporation
|
||||
* Copyright (C) 2022-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -63,7 +63,12 @@ bool ProductHelperHw<gfxProduct>::isBufferPoolAllocatorSupported() const {
|
|||
}
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<gfxProduct>::isUsmPoolAllocatorSupported() const {
|
||||
bool ProductHelperHw<gfxProduct>::isHostUsmPoolAllocatorSupported() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<gfxProduct>::isDeviceUsmPoolAllocatorSupported() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -438,7 +438,12 @@ bool ProductHelperHw<gfxProduct>::isBufferPoolAllocatorSupported() const {
|
|||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool ProductHelperHw<gfxProduct>::isUsmPoolAllocatorSupported() const {
|
||||
bool ProductHelperHw<gfxProduct>::isHostUsmPoolAllocatorSupported() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool ProductHelperHw<gfxProduct>::isDeviceUsmPoolAllocatorSupported() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,8 @@ struct MockProductHelper : ProductHelperHw<IGFX_UNKNOWN> {
|
|||
ADDMETHOD_CONST_NOBASE(isBlitCopyRequiredForLocalMemory, bool, true, (const RootDeviceEnvironment &rootDeviceEnvironment, const GraphicsAllocation &allocation));
|
||||
ADDMETHOD_CONST_NOBASE(isDeviceUsmAllocationReuseSupported, bool, false, ());
|
||||
ADDMETHOD_CONST_NOBASE(isHostUsmAllocationReuseSupported, bool, false, ());
|
||||
ADDMETHOD_CONST_NOBASE(isUsmPoolAllocatorSupported, bool, false, ());
|
||||
ADDMETHOD_CONST_NOBASE(isHostUsmPoolAllocatorSupported, bool, false, ());
|
||||
ADDMETHOD_CONST_NOBASE(isDeviceUsmPoolAllocatorSupported, bool, false, ());
|
||||
ADDMETHOD_CONST_NOBASE(is2MBLocalMemAlignmentEnabled, bool, false, ());
|
||||
ADDMETHOD_CONST_NOBASE(isDisableScratchPagesRequiredForDebugger, bool, true, ());
|
||||
};
|
||||
|
|
|
@ -2039,7 +2039,7 @@ TEST_F(DeviceTests, givenNewUsmPoolingEnabledWhenDeviceInitializedThenUsmMemAllo
|
|||
auto executionEnvironment = MockDevice::prepareExecutionEnvironment(defaultHwInfo.get(), 0u);
|
||||
auto mockProductHelper = new MockProductHelper;
|
||||
executionEnvironment->rootDeviceEnvironments[0]->productHelper.reset(mockProductHelper);
|
||||
mockProductHelper->isUsmPoolAllocatorSupportedResult = true;
|
||||
mockProductHelper->isDeviceUsmPoolAllocatorSupportedResult = true;
|
||||
UltDeviceFactory deviceFactory{1, 1, *executionEnvironment};
|
||||
auto device = deviceFactory.rootDevices[0];
|
||||
auto usmMemAllocPoolsManager = device->getUsmMemAllocPoolsManager();
|
||||
|
@ -2052,7 +2052,7 @@ TEST_F(DeviceTests, givenNewUsmPoolingEnabledWhenDeviceInitializedThenUsmMemAllo
|
|||
auto executionEnvironment = MockDevice::prepareExecutionEnvironment(defaultHwInfo.get(), 0u);
|
||||
auto mockProductHelper = new MockProductHelper;
|
||||
executionEnvironment->rootDeviceEnvironments[0]->productHelper.reset(mockProductHelper);
|
||||
mockProductHelper->isUsmPoolAllocatorSupportedResult = true;
|
||||
mockProductHelper->isDeviceUsmPoolAllocatorSupportedResult = true;
|
||||
UltDeviceFactory deviceFactory{1, 1, *executionEnvironment};
|
||||
auto device = deviceFactory.rootDevices[0];
|
||||
auto usmMemAllocPoolsManager = device->getUsmMemAllocPoolsManager();
|
||||
|
@ -2064,7 +2064,7 @@ TEST_F(DeviceTests, givenNewUsmPoolingEnabledWhenDeviceInitializedThenUsmMemAllo
|
|||
auto executionEnvironment = MockDevice::prepareExecutionEnvironment(defaultHwInfo.get(), 0u);
|
||||
auto mockProductHelper = new MockProductHelper;
|
||||
executionEnvironment->rootDeviceEnvironments[0]->productHelper.reset(mockProductHelper);
|
||||
mockProductHelper->isUsmPoolAllocatorSupportedResult = false;
|
||||
mockProductHelper->isDeviceUsmPoolAllocatorSupportedResult = false;
|
||||
UltDeviceFactory deviceFactory{1, 1, *executionEnvironment};
|
||||
auto device = deviceFactory.rootDevices[0];
|
||||
auto usmMemAllocPoolsManager = device->getUsmMemAllocPoolsManager();
|
||||
|
@ -2077,7 +2077,7 @@ TEST_F(DeviceTests, givenNewUsmPoolingEnabledWhenDeviceInitializedThenUsmMemAllo
|
|||
auto executionEnvironment = MockDevice::prepareExecutionEnvironment(defaultHwInfo.get(), 0u);
|
||||
auto mockProductHelper = new MockProductHelper;
|
||||
executionEnvironment->rootDeviceEnvironments[0]->productHelper.reset(mockProductHelper);
|
||||
mockProductHelper->isUsmPoolAllocatorSupportedResult = true;
|
||||
mockProductHelper->isDeviceUsmPoolAllocatorSupportedResult = true;
|
||||
UltDeviceFactory deviceFactory{1, 1, *executionEnvironment};
|
||||
auto device = deviceFactory.rootDevices[0];
|
||||
auto usmMemAllocPoolsManager = device->getUsmMemAllocPoolsManager();
|
||||
|
|
|
@ -810,16 +810,28 @@ HWTEST2_F(ProductHelperTest, givenProductHelperWhenCheckingIsBufferPoolAllocator
|
|||
EXPECT_TRUE(productHelper->isBufferPoolAllocatorSupported());
|
||||
}
|
||||
|
||||
HWTEST2_F(ProductHelperTest, givenProductHelperWhenCheckingIsUsmPoolAllocatorSupportedThenCorrectValueIsReturned, IsBeforeXeHpgCore) {
|
||||
EXPECT_FALSE(productHelper->isUsmPoolAllocatorSupported());
|
||||
HWTEST2_F(ProductHelperTest, givenProductHelperWhenCheckingIsHostUsmPoolAllocatorSupportedThenCorrectValueIsReturned, IsBeforeXeHpgCore) {
|
||||
EXPECT_FALSE(productHelper->isHostUsmPoolAllocatorSupported());
|
||||
}
|
||||
|
||||
HWTEST2_F(ProductHelperTest, givenProductHelperWhenCheckingIsUsmPoolAllocatorSupportedThenCorrectValueIsReturned, IsXeHpcCore) {
|
||||
EXPECT_FALSE(productHelper->isUsmPoolAllocatorSupported());
|
||||
HWTEST2_F(ProductHelperTest, givenProductHelperWhenCheckingIsDeviceUsmPoolAllocatorSupportedThenCorrectValueIsReturned, IsBeforeXeHpgCore) {
|
||||
EXPECT_FALSE(productHelper->isDeviceUsmPoolAllocatorSupported());
|
||||
}
|
||||
|
||||
HWTEST2_F(ProductHelperTest, givenProductHelperWhenCheckingIsUsmPoolAllocatorSupportedThenCorrectValueIsReturned, IsXeHpgCore) {
|
||||
EXPECT_TRUE(productHelper->isUsmPoolAllocatorSupported());
|
||||
HWTEST2_F(ProductHelperTest, givenProductHelperWhenCheckingIsHostUsmPoolAllocatorSupportedThenCorrectValueIsReturned, IsXeHpcCore) {
|
||||
EXPECT_FALSE(productHelper->isHostUsmPoolAllocatorSupported());
|
||||
}
|
||||
|
||||
HWTEST2_F(ProductHelperTest, givenProductHelperWhenCheckingIsDeviceUsmPoolAllocatorSupportedThenCorrectValueIsReturned, IsXeHpcCore) {
|
||||
EXPECT_FALSE(productHelper->isDeviceUsmPoolAllocatorSupported());
|
||||
}
|
||||
|
||||
HWTEST2_F(ProductHelperTest, givenProductHelperWhenCheckingIsHostUsmPoolAllocatorSupportedThenCorrectValueIsReturned, IsXeHpgCore) {
|
||||
EXPECT_TRUE(productHelper->isHostUsmPoolAllocatorSupported());
|
||||
}
|
||||
|
||||
HWTEST2_F(ProductHelperTest, givenProductHelperWhenCheckingIsDeviceUsmPoolAllocatorSupportedThenCorrectValueIsReturned, IsXeHpgCore) {
|
||||
EXPECT_TRUE(productHelper->isDeviceUsmPoolAllocatorSupported());
|
||||
}
|
||||
|
||||
HWTEST2_F(ProductHelperTest, givenProductHelperWhenCheckingIsDeviceUsmAllocationReuseSupportedThenCorrectValueIsReturned, IsAtMostDg2) {
|
||||
|
|
Loading…
Reference in New Issue