performance: enable PreferredAllocationMethod by KMD on PTL

Related-To: NEO-10526

Signed-off-by: Radoslaw Jablonski <radoslaw.jablonski@intel.com>
This commit is contained in:
Radoslaw Jablonski
2025-01-27 22:11:30 +00:00
committed by Compute-Runtime-Automation
parent 68f9300597
commit 6ead86f0e1
4 changed files with 27 additions and 0 deletions

View File

@@ -18,4 +18,10 @@ template <>
bool ProductHelperHw<gfxProduct>::isBufferPoolAllocatorSupported() const {
return false;
}
template <>
std::optional<GfxMemoryAllocationMethod> ProductHelperHw<gfxProduct>::getPreferredAllocationMethod(AllocationType allocationType) const {
return GfxMemoryAllocationMethod::allocateByKmd;
}
} // namespace NEO

View File

@@ -7,6 +7,7 @@
if(TESTS_PTL)
target_sources(neo_shared_tests PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/excludes_xe3_core_ptl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/hw_aot_config_tests_ptl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_tests_ptl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/product_helper_tests_ptl.cpp

View File

@@ -0,0 +1,10 @@
/*
* Copyright (C) 2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/test/common/test_macros/hw_test_base.h"
HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, whenGettingPreferredAllocationMethodThenNoPreferenceIsReturned, IGFX_PTL);

View File

@@ -6,6 +6,7 @@
*/
#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/memory_manager/allocation_type.h"
#include "shared/source/os_interface/product_helper.h"
#include "shared/source/xe3_core/hw_info_xe3_core.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
@@ -18,6 +19,15 @@ using namespace NEO;
using PtlProductHelper = ProductHelperTest;
PTLTEST_F(PtlProductHelper, whenGettingPreferredAllocationMethodThenAllocateByKmdIsReturned) {
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());
}
}
PTLTEST_F(PtlProductHelper, givenCompilerProductHelperWhenGetDefaultHwIpVersionThenCorrectValueIsSet) {
EXPECT_EQ(compilerProductHelper->getDefaultHwIpVersion(), AOT::PTL_H_A0);
}