From c8746638c9aebbe97b2bd8327966bd84b420f588 Mon Sep 17 00:00:00 2001 From: Jack Myers Date: Fri, 2 Aug 2024 23:29:15 +0000 Subject: [PATCH] feature: implements 2d block load/store helpers Implemented the product helper specializations for querying device support for 2D block load/store operations. The desired support matrix is both load and store is supported for PVC and up, and unsupported forall else. The interface for querying 2d block load/storecapabilities was implemented in a previous PR. Related-To: NEO-11592 Signed-off-by: Jack Myers --- shared/source/os_interface/CMakeLists.txt | 1 + .../product_helper_pvc_and_later.inl | 22 +++++++++++++++++++ ...s_agnostic_product_helper_xe2_hpg_core.inl | 2 ++ ...os_agnostic_product_helper_xe_hpc_core.inl | 2 ++ .../os_agnostic_product_helper_xe_lpg.inl | 1 + .../test_macros/header/common_matchers.h | 1 + .../os_interface/product_helper_tests.cpp | 14 ++++++++++-- 7 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 shared/source/os_interface/product_helper_pvc_and_later.inl diff --git a/shared/source/os_interface/CMakeLists.txt b/shared/source/os_interface/CMakeLists.txt index 5caf1a3c99..c3106da2a6 100644 --- a/shared/source/os_interface/CMakeLists.txt +++ b/shared/source/os_interface/CMakeLists.txt @@ -27,6 +27,7 @@ set(NEO_CORE_OS_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/product_helper.inl ${CMAKE_CURRENT_SOURCE_DIR}/product_helper_bdw_and_later.inl ${CMAKE_CURRENT_SOURCE_DIR}/product_helper_xe2_and_later.inl + ${CMAKE_CURRENT_SOURCE_DIR}/product_helper_pvc_and_later.inl ${CMAKE_CURRENT_SOURCE_DIR}/metrics_library.cpp ${CMAKE_CURRENT_SOURCE_DIR}/os_context.cpp ${CMAKE_CURRENT_SOURCE_DIR}/os_context.h diff --git a/shared/source/os_interface/product_helper_pvc_and_later.inl b/shared/source/os_interface/product_helper_pvc_and_later.inl new file mode 100644 index 0000000000..ea2bc6c877 --- /dev/null +++ b/shared/source/os_interface/product_helper_pvc_and_later.inl @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/os_interface/product_helper.h" + +namespace NEO { + +template <> +bool ProductHelperHw::supports2DBlockLoad() const { + return true; +} + +template <> +bool ProductHelperHw::supports2DBlockStore() const { + return true; +} + +} // namespace NEO diff --git a/shared/source/xe2_hpg_core/os_agnostic_product_helper_xe2_hpg_core.inl b/shared/source/xe2_hpg_core/os_agnostic_product_helper_xe2_hpg_core.inl index 79d8288549..74bd72d3b5 100644 --- a/shared/source/xe2_hpg_core/os_agnostic_product_helper_xe2_hpg_core.inl +++ b/shared/source/xe2_hpg_core/os_agnostic_product_helper_xe2_hpg_core.inl @@ -5,6 +5,8 @@ * */ +#include "shared/source/os_interface/product_helper_pvc_and_later.inl" + namespace NEO { template <> diff --git a/shared/source/xe_hpc_core/os_agnostic_product_helper_xe_hpc_core.inl b/shared/source/xe_hpc_core/os_agnostic_product_helper_xe_hpc_core.inl index 9f79200c51..6c505ea3e3 100644 --- a/shared/source/xe_hpc_core/os_agnostic_product_helper_xe_hpc_core.inl +++ b/shared/source/xe_hpc_core/os_agnostic_product_helper_xe_hpc_core.inl @@ -5,6 +5,8 @@ * */ +#include "shared/source/os_interface/product_helper_pvc_and_later.inl" + namespace NEO { template <> std::string ProductHelperHw::getDeviceMemoryName() const { diff --git a/shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl b/shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl index 6aacf129c5..7749ecb80e 100644 --- a/shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl +++ b/shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl @@ -11,6 +11,7 @@ #include "shared/source/memory_manager/allocation_type.h" #include "shared/source/os_interface/product_helper.h" #include "shared/source/os_interface/product_helper.inl" +#include "shared/source/os_interface/product_helper_pvc_and_later.inl" #include "shared/source/os_interface/product_helper_xe_hpg_and_xe_hpc.inl" #include "aubstream/product_family.h" diff --git a/shared/test/common/test_macros/header/common_matchers.h b/shared/test/common/test_macros/header/common_matchers.h index f22e3eab16..e1697149ef 100644 --- a/shared/test/common/test_macros/header/common_matchers.h +++ b/shared/test/common/test_macros/header/common_matchers.h @@ -86,6 +86,7 @@ using IsAtLeastSkl = IsAtLeastProduct; using IsAtLeastMtl = IsAtLeastProduct; using IsAtMostDg2 = IsAtMostProduct; +using IsAtLeastPVC = IsAtLeastProduct; using IsAtMostPVC = IsAtMostProduct; using IsNotPVC = IsNotWithinProducts; using IsNotPvcOrDg2 = IsNotWithinProducts; diff --git a/shared/test/unit_test/os_interface/product_helper_tests.cpp b/shared/test/unit_test/os_interface/product_helper_tests.cpp index d1be57e6e7..36528fa6e1 100644 --- a/shared/test/unit_test/os_interface/product_helper_tests.cpp +++ b/shared/test/unit_test/os_interface/product_helper_tests.cpp @@ -1016,12 +1016,22 @@ TEST_F(ProductHelperTest, whenGettingMaxSubSliceSpaceThenValueIsNotSmallerThanMa EXPECT_EQ(maxSupportedSubSlices, productHelper->computeMaxNeededSubSliceSpace(hwInfo)); } -HWTEST_F(ProductHelperTest, givenDefaultProductHelperWhenQuery2DBlockLoadThenReturnFalse) { +HWTEST2_F(ProductHelperTest, givenProductHelperWhenQuery2DBlockLoadThenReturnFalse, IsAtMostDg2) { EXPECT_FALSE(productHelper->supports2DBlockLoad()); } -HWTEST_F(ProductHelperTest, givenDefaultProductHelperWhenQuery2DBlockStoreThenReturnFalse) { +HWTEST2_F(ProductHelperTest, givenProductHelperWhenQuery2DBlockStoreThenReturnFalse, IsAtMostDg2) { EXPECT_FALSE(productHelper->supports2DBlockStore()); } + +HWTEST2_F(ProductHelperTest, givenProductHelperWhenQuery2DBlockLoadThenReturnTrue, IsAtLeastPVC) { + + EXPECT_TRUE(productHelper->supports2DBlockLoad()); +} + +HWTEST2_F(ProductHelperTest, givenProductHelperWhenQuery2DBlockStoreThenReturnTrue, IsAtLeastPVC) { + + EXPECT_TRUE(productHelper->supports2DBlockStore()); +}