fix: Use system ptr for 32 bit svm cpu

Resolves: HSD-14025543711

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2025-11-17 13:47:19 +00:00
committed by Compute-Runtime-Automation
parent 09981f7102
commit 0ec6f51e0e
2 changed files with 15 additions and 2 deletions

View File

@@ -29,6 +29,11 @@ std::optional<aub_stream::ProductFamily> ProductHelperHw<gfxProduct>::getAubStre
template <>
std::optional<GfxMemoryAllocationMethod> ProductHelperHw<gfxProduct>::getPreferredAllocationMethod(AllocationType allocationType) const {
if constexpr (is32bit) {
if (allocationType == AllocationType::svmCpu) { // no heap SVM in allocateByKmd on 32 bit
return GfxMemoryAllocationMethod::useUmdSystemPtr;
}
}
return GfxMemoryAllocationMethod::allocateByKmd;
}

View File

@@ -71,12 +71,20 @@ BMGTEST_F(BmgProductHelper, givenProductHelperWhenGetCommandsStreamPropertiesSup
EXPECT_FALSE(productHelper->getPipelineSelectPropertySystolicModeSupport());
}
BMGTEST_F(BmgProductHelper, whenCheckPreferredAllocationMethodThenAllocateByKmdIsReturnedExceptTagBufferAndTimestampPacketTagBuffer) {
BMGTEST_F(BmgProductHelper, whenCheckPreferredAllocationMethodThenAllocateByKmdIsReturnedExcept32bitSvmCpu) {
for (auto i = 0; i < static_cast<int>(AllocationType::count); i++) {
auto allocationType = static_cast<AllocationType>(i);
auto preferredAllocationMethod = productHelper->getPreferredAllocationMethod(allocationType);
EXPECT_TRUE(preferredAllocationMethod.has_value());
EXPECT_EQ(GfxMemoryAllocationMethod::allocateByKmd, preferredAllocationMethod.value());
if constexpr (is32bit) {
if (allocationType == AllocationType::svmCpu) {
EXPECT_EQ(GfxMemoryAllocationMethod::useUmdSystemPtr, preferredAllocationMethod.value());
} else {
EXPECT_EQ(GfxMemoryAllocationMethod::allocateByKmd, preferredAllocationMethod.value());
}
} else {
EXPECT_EQ(GfxMemoryAllocationMethod::allocateByKmd, preferredAllocationMethod.value());
}
}
}