Skip to content

Commit 6ead86f

Browse files
jabradCompute-Runtime-Automation
authored andcommitted
performance: enable PreferredAllocationMethod by KMD on PTL
Related-To: NEO-10526 Signed-off-by: Radoslaw Jablonski <[email protected]>
1 parent 68f9300 commit 6ead86f

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed

shared/source/xe3_core/ptl/os_agnostic_product_helper_ptl.inl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,10 @@ template <>
1818
bool ProductHelperHw<gfxProduct>::isBufferPoolAllocatorSupported() const {
1919
return false;
2020
}
21+
22+
template <>
23+
std::optional<GfxMemoryAllocationMethod> ProductHelperHw<gfxProduct>::getPreferredAllocationMethod(AllocationType allocationType) const {
24+
return GfxMemoryAllocationMethod::allocateByKmd;
25+
}
26+
2127
} // namespace NEO

shared/test/unit_test/xe3_core/ptl/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
if(TESTS_PTL)
88
target_sources(neo_shared_tests PRIVATE
99
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
10+
${CMAKE_CURRENT_SOURCE_DIR}/excludes_xe3_core_ptl.cpp
1011
${CMAKE_CURRENT_SOURCE_DIR}/hw_aot_config_tests_ptl.cpp
1112
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_tests_ptl.cpp
1213
${CMAKE_CURRENT_SOURCE_DIR}/product_helper_tests_ptl.cpp
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
* Copyright (C) 2025 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*
6+
*/
7+
8+
#include "shared/test/common/test_macros/hw_test_base.h"
9+
10+
HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, whenGettingPreferredAllocationMethodThenNoPreferenceIsReturned, IGFX_PTL);

shared/test/unit_test/xe3_core/ptl/product_helper_tests_ptl.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
#include "shared/source/helpers/compiler_product_helper.h"
9+
#include "shared/source/memory_manager/allocation_type.h"
910
#include "shared/source/os_interface/product_helper.h"
1011
#include "shared/source/xe3_core/hw_info_xe3_core.h"
1112
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
@@ -18,6 +19,15 @@ using namespace NEO;
1819

1920
using PtlProductHelper = ProductHelperTest;
2021

22+
PTLTEST_F(PtlProductHelper, whenGettingPreferredAllocationMethodThenAllocateByKmdIsReturned) {
23+
for (auto i = 0; i < static_cast<int>(AllocationType::count); i++) {
24+
auto allocationType = static_cast<AllocationType>(i);
25+
auto preferredAllocationMethod = productHelper->getPreferredAllocationMethod(allocationType);
26+
EXPECT_TRUE(preferredAllocationMethod.has_value());
27+
EXPECT_EQ(GfxMemoryAllocationMethod::allocateByKmd, preferredAllocationMethod.value());
28+
}
29+
}
30+
2131
PTLTEST_F(PtlProductHelper, givenCompilerProductHelperWhenGetDefaultHwIpVersionThenCorrectValueIsSet) {
2232
EXPECT_EQ(compilerProductHelper->getDefaultHwIpVersion(), AOT::PTL_H_A0);
2333
}

0 commit comments

Comments
 (0)