From 39eab81c831b08a0e2802918f2b6e922da1500d9 Mon Sep 17 00:00:00 2001 From: Mateusz Jablonski Date: Tue, 14 Mar 2023 13:18:34 +0000 Subject: [PATCH] refactor: add separate helper for extension support cl_intel_subgroup_split_matrix_multiply_accumulate Related-To: NEO-7800 Signed-off-by: Mateusz Jablonski --- .../gen11/enable_compiler_product_helper_ehl.cpp | 1 + .../enable_compiler_product_helper_icllp.cpp | 1 + .../gen11/enable_compiler_product_helper_lkf.cpp | 1 + .../enable_compiler_product_helper_adln.cpp | 1 + .../enable_compiler_product_helper_adlp.cpp | 1 + .../enable_compiler_product_helper_adls.cpp | 1 + .../enable_compiler_product_helper_dg1.cpp | 1 + .../enable_compiler_product_helper_rkl.cpp | 1 + .../enable_compiler_product_helper_tgllp.cpp | 1 + .../gen8/enable_compiler_product_helper_bdw.cpp | 1 + .../gen9/enable_compiler_product_helper_bxt.cpp | 1 + .../gen9/enable_compiler_product_helper_cfl.cpp | 1 + .../gen9/enable_compiler_product_helper_glk.cpp | 1 + .../gen9/enable_compiler_product_helper_kbl.cpp | 1 + .../gen9/enable_compiler_product_helper_skl.cpp | 1 + shared/source/helpers/CMakeLists.txt | 2 ++ shared/source/helpers/compiler_product_helper.h | 2 ++ .../helpers/compiler_product_helper_base.inl | 3 +++ ..._disable_split_matrix_multiply_accumulate.inl | 16 ++++++++++++++++ ...r_enable_split_matrix_multiply_accumulate.inl | 16 ++++++++++++++++ shared/source/helpers/gfx_core_helper_base.inl | 1 - .../enable_compiler_product_helper_xe_hp_sdv.cpp | 1 + .../enable_compiler_product_helper_pvc.cpp | 1 + .../enable_compiler_product_helper_dg2.cpp | 1 + .../enable_compiler_product_helper_mtl.cpp | 5 +++++ .../common/test_macros/header/common_matchers.h | 1 + .../helpers/compiler_product_helper_tests.cpp | 12 ++++++++++++ .../xe_hpg_core/mtl/excludes_xe_hpg_core_mtl.cpp | 1 + .../mtl/gfx_core_helper_tests_mtl.cpp | 1 + 29 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl create mode 100644 shared/source/helpers/compiler_product_helper_enable_split_matrix_multiply_accumulate.inl diff --git a/shared/source/gen11/enable_compiler_product_helper_ehl.cpp b/shared/source/gen11/enable_compiler_product_helper_ehl.cpp index 8c81a1e96a..3d17263312 100644 --- a/shared/source/gen11/enable_compiler_product_helper_ehl.cpp +++ b/shared/source/gen11/enable_compiler_product_helper_ehl.cpp @@ -11,6 +11,7 @@ #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" +#include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" namespace NEO { diff --git a/shared/source/gen11/enable_compiler_product_helper_icllp.cpp b/shared/source/gen11/enable_compiler_product_helper_icllp.cpp index 0a8efb24af..977a46ba10 100644 --- a/shared/source/gen11/enable_compiler_product_helper_icllp.cpp +++ b/shared/source/gen11/enable_compiler_product_helper_icllp.cpp @@ -11,6 +11,7 @@ #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" +#include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" namespace NEO { diff --git a/shared/source/gen11/enable_compiler_product_helper_lkf.cpp b/shared/source/gen11/enable_compiler_product_helper_lkf.cpp index bcd2afaa2c..c49584855c 100644 --- a/shared/source/gen11/enable_compiler_product_helper_lkf.cpp +++ b/shared/source/gen11/enable_compiler_product_helper_lkf.cpp @@ -11,6 +11,7 @@ #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" +#include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" namespace NEO { diff --git a/shared/source/gen12lp/enable_compiler_product_helper_adln.cpp b/shared/source/gen12lp/enable_compiler_product_helper_adln.cpp index 4134da85d8..3913f35d08 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_adln.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_adln.cpp @@ -11,6 +11,7 @@ #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" +#include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" #include "compiler_product_helper_adln.inl" diff --git a/shared/source/gen12lp/enable_compiler_product_helper_adlp.cpp b/shared/source/gen12lp/enable_compiler_product_helper_adlp.cpp index fb8f1cccc6..416f439890 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_adlp.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_adlp.cpp @@ -11,6 +11,7 @@ #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" +#include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" #include "compiler_product_helper_adlp.inl" diff --git a/shared/source/gen12lp/enable_compiler_product_helper_adls.cpp b/shared/source/gen12lp/enable_compiler_product_helper_adls.cpp index 7e9efca85e..480d652737 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_adls.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_adls.cpp @@ -11,6 +11,7 @@ #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" +#include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" namespace NEO { diff --git a/shared/source/gen12lp/enable_compiler_product_helper_dg1.cpp b/shared/source/gen12lp/enable_compiler_product_helper_dg1.cpp index f5269952fc..32570b5894 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_dg1.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_dg1.cpp @@ -11,6 +11,7 @@ #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" +#include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" namespace NEO { diff --git a/shared/source/gen12lp/enable_compiler_product_helper_rkl.cpp b/shared/source/gen12lp/enable_compiler_product_helper_rkl.cpp index 407c56ae7b..c162e438f3 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_rkl.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_rkl.cpp @@ -11,6 +11,7 @@ #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" +#include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" namespace NEO { diff --git a/shared/source/gen12lp/enable_compiler_product_helper_tgllp.cpp b/shared/source/gen12lp/enable_compiler_product_helper_tgllp.cpp index 4bce396d32..8b8d8e6599 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_tgllp.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_tgllp.cpp @@ -11,6 +11,7 @@ #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" +#include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" namespace NEO { diff --git a/shared/source/gen8/enable_compiler_product_helper_bdw.cpp b/shared/source/gen8/enable_compiler_product_helper_bdw.cpp index e0f5156409..293ffe3318 100644 --- a/shared/source/gen8/enable_compiler_product_helper_bdw.cpp +++ b/shared/source/gen8/enable_compiler_product_helper_bdw.cpp @@ -11,6 +11,7 @@ #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" +#include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_disable_subgroup_local_block_io.inl" namespace NEO { diff --git a/shared/source/gen9/enable_compiler_product_helper_bxt.cpp b/shared/source/gen9/enable_compiler_product_helper_bxt.cpp index 45fbd5b27e..29847e4eb6 100644 --- a/shared/source/gen9/enable_compiler_product_helper_bxt.cpp +++ b/shared/source/gen9/enable_compiler_product_helper_bxt.cpp @@ -11,6 +11,7 @@ #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" +#include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_disable_subgroup_local_block_io.inl" namespace NEO { diff --git a/shared/source/gen9/enable_compiler_product_helper_cfl.cpp b/shared/source/gen9/enable_compiler_product_helper_cfl.cpp index 14a72f8c73..5a1ea6c164 100644 --- a/shared/source/gen9/enable_compiler_product_helper_cfl.cpp +++ b/shared/source/gen9/enable_compiler_product_helper_cfl.cpp @@ -11,6 +11,7 @@ #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" +#include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_disable_subgroup_local_block_io.inl" namespace NEO { diff --git a/shared/source/gen9/enable_compiler_product_helper_glk.cpp b/shared/source/gen9/enable_compiler_product_helper_glk.cpp index 7f82960e7d..a22b6c0c2c 100644 --- a/shared/source/gen9/enable_compiler_product_helper_glk.cpp +++ b/shared/source/gen9/enable_compiler_product_helper_glk.cpp @@ -11,6 +11,7 @@ #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" +#include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_disable_subgroup_local_block_io.inl" namespace NEO { diff --git a/shared/source/gen9/enable_compiler_product_helper_kbl.cpp b/shared/source/gen9/enable_compiler_product_helper_kbl.cpp index 6142a84767..b579d8da03 100644 --- a/shared/source/gen9/enable_compiler_product_helper_kbl.cpp +++ b/shared/source/gen9/enable_compiler_product_helper_kbl.cpp @@ -11,6 +11,7 @@ #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" +#include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_disable_subgroup_local_block_io.inl" namespace NEO { diff --git a/shared/source/gen9/enable_compiler_product_helper_skl.cpp b/shared/source/gen9/enable_compiler_product_helper_skl.cpp index 018d323d77..8cc2d38f62 100644 --- a/shared/source/gen9/enable_compiler_product_helper_skl.cpp +++ b/shared/source/gen9/enable_compiler_product_helper_skl.cpp @@ -11,6 +11,7 @@ #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" +#include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_disable_subgroup_local_block_io.inl" namespace NEO { diff --git a/shared/source/helpers/CMakeLists.txt b/shared/source/helpers/CMakeLists.txt index b044f0fbb5..4419babd00 100644 --- a/shared/source/helpers/CMakeLists.txt +++ b/shared/source/helpers/CMakeLists.txt @@ -45,7 +45,9 @@ set(NEO_CORE_HELPERS ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_bdw_and_later.inl ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_before_xe_hp.inl ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_before_xe_hpc.inl + ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_disable_subgroup_local_block_io.inl + ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_enable_split_matrix_multiply_accumulate.inl ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_enable_subgroup_local_block_io.inl ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_xe_hp_and_later.inl ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_xe_hpc_and_later.inl diff --git a/shared/source/helpers/compiler_product_helper.h b/shared/source/helpers/compiler_product_helper.h index 8c6e32845e..411599df62 100644 --- a/shared/source/helpers/compiler_product_helper.h +++ b/shared/source/helpers/compiler_product_helper.h @@ -37,6 +37,7 @@ class CompilerProductHelper { virtual bool isForceEmuInt32DivRemSPRequired() const = 0; virtual bool isStatelessToStatefulBufferOffsetSupported() const = 0; virtual bool isMatrixMultiplyAccumulateSupported(const HardwareInfo &hwInfo) const = 0; + virtual bool isSplitMatrixMultiplyAccumulateSupported(const HardwareInfo &hwInfo) const = 0; virtual bool isBFloat16ConversionSupported(const HardwareInfo &hwInfo) const = 0; virtual bool isSubgroupLocalBlockIoSupported() const = 0; virtual bool isDotAccumulateSupported() const = 0; @@ -69,6 +70,7 @@ class CompilerProductHelperHw : public CompilerProductHelper { bool isForceEmuInt32DivRemSPRequired() const override; bool isStatelessToStatefulBufferOffsetSupported() const override; bool isMatrixMultiplyAccumulateSupported(const HardwareInfo &hwInfo) const override; + bool isSplitMatrixMultiplyAccumulateSupported(const HardwareInfo &hwInfo) const override; bool isBFloat16ConversionSupported(const HardwareInfo &hwInfo) const override; bool isSubgroupLocalBlockIoSupported() const override; bool isDotAccumulateSupported() const override; diff --git a/shared/source/helpers/compiler_product_helper_base.inl b/shared/source/helpers/compiler_product_helper_base.inl index bb7f7b15b8..95f88e5f58 100644 --- a/shared/source/helpers/compiler_product_helper_base.inl +++ b/shared/source/helpers/compiler_product_helper_base.inl @@ -50,6 +50,9 @@ std::string CompilerProductHelperHw::getExtensions(const HardwareInf if (isMatrixMultiplyAccumulateSupported(hwInfo)) { extensions += "cl_intel_subgroup_matrix_multiply_accumulate "; + } + + if (isSplitMatrixMultiplyAccumulateSupported(hwInfo)) { extensions += "cl_intel_subgroup_split_matrix_multiply_accumulate "; } diff --git a/shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl b/shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl new file mode 100644 index 0000000000..110cb9cb60 --- /dev/null +++ b/shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/helpers/compiler_product_helper.h" + +namespace NEO { +template +bool CompilerProductHelperHw::isSplitMatrixMultiplyAccumulateSupported(const HardwareInfo &hwInfo) const { + return false; +} + +} // namespace NEO diff --git a/shared/source/helpers/compiler_product_helper_enable_split_matrix_multiply_accumulate.inl b/shared/source/helpers/compiler_product_helper_enable_split_matrix_multiply_accumulate.inl new file mode 100644 index 0000000000..e5bcfbcfbd --- /dev/null +++ b/shared/source/helpers/compiler_product_helper_enable_split_matrix_multiply_accumulate.inl @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/helpers/compiler_product_helper.h" + +namespace NEO { +template +bool CompilerProductHelperHw::isSplitMatrixMultiplyAccumulateSupported(const HardwareInfo &hwInfo) const { + return true; +} + +} // namespace NEO diff --git a/shared/source/helpers/gfx_core_helper_base.inl b/shared/source/helpers/gfx_core_helper_base.inl index 831fb19402..a992d18a53 100644 --- a/shared/source/helpers/gfx_core_helper_base.inl +++ b/shared/source/helpers/gfx_core_helper_base.inl @@ -12,7 +12,6 @@ #include "shared/source/gmm_helper/gmm_helper.h" #include "shared/source/helpers/aligned_memory.h" #include "shared/source/helpers/basic_math.h" -#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/constants.h" #include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/helpers/hw_info.h" diff --git a/shared/source/xe_hp_core/enable_compiler_product_helper_xe_hp_sdv.cpp b/shared/source/xe_hp_core/enable_compiler_product_helper_xe_hp_sdv.cpp index d4c4343d19..d252d29352 100644 --- a/shared/source/xe_hp_core/enable_compiler_product_helper_xe_hp_sdv.cpp +++ b/shared/source/xe_hp_core/enable_compiler_product_helper_xe_hp_sdv.cpp @@ -10,6 +10,7 @@ #include "shared/source/helpers/compiler_product_helper_base.inl" #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" +#include "shared/source/helpers/compiler_product_helper_enable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" #include "shared/source/helpers/compiler_product_helper_xe_hp_and_later.inl" diff --git a/shared/source/xe_hpc_core/enable_compiler_product_helper_pvc.cpp b/shared/source/xe_hpc_core/enable_compiler_product_helper_pvc.cpp index b9fcf9e483..4d5388fbf5 100644 --- a/shared/source/xe_hpc_core/enable_compiler_product_helper_pvc.cpp +++ b/shared/source/xe_hpc_core/enable_compiler_product_helper_pvc.cpp @@ -9,6 +9,7 @@ #include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/compiler_product_helper_base.inl" #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" +#include "shared/source/helpers/compiler_product_helper_enable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" #include "shared/source/helpers/compiler_product_helper_xe_hp_and_later.inl" #include "shared/source/helpers/compiler_product_helper_xe_hpc_and_later.inl" diff --git a/shared/source/xe_hpg_core/enable_compiler_product_helper_dg2.cpp b/shared/source/xe_hpg_core/enable_compiler_product_helper_dg2.cpp index 2903914ee2..9cd9a9267c 100644 --- a/shared/source/xe_hpg_core/enable_compiler_product_helper_dg2.cpp +++ b/shared/source/xe_hpg_core/enable_compiler_product_helper_dg2.cpp @@ -10,6 +10,7 @@ #include "shared/source/helpers/compiler_product_helper_base.inl" #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" +#include "shared/source/helpers/compiler_product_helper_enable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" #include "shared/source/helpers/compiler_product_helper_xe_hp_and_later.inl" diff --git a/shared/source/xe_hpg_core/enable_compiler_product_helper_mtl.cpp b/shared/source/xe_hpg_core/enable_compiler_product_helper_mtl.cpp index f994ac15de..bf424ff7dd 100644 --- a/shared/source/xe_hpg_core/enable_compiler_product_helper_mtl.cpp +++ b/shared/source/xe_hpg_core/enable_compiler_product_helper_mtl.cpp @@ -25,6 +25,11 @@ bool CompilerProductHelperHw::isMatrixMultiplyAccumulateSupported(co return (MTL::isLpg(hwInfo) == false); } +template <> +bool CompilerProductHelperHw::isSplitMatrixMultiplyAccumulateSupported(const HardwareInfo &hwInfo) const { + return (MTL::isLpg(hwInfo) == false); +} + template <> bool CompilerProductHelperHw::isBFloat16ConversionSupported(const HardwareInfo &hwInfo) const { return (MTL::isLpg(hwInfo) == false); diff --git a/shared/test/common/test_macros/header/common_matchers.h b/shared/test/common/test_macros/header/common_matchers.h index 889edf6f1f..e410778968 100644 --- a/shared/test/common/test_macros/header/common_matchers.h +++ b/shared/test/common/test_macros/header/common_matchers.h @@ -29,6 +29,7 @@ using IsAtMostGen12lp = IsAtMostGfxCore; using IsAtLeastGen12lp = IsAtLeastGfxCore; using IsWithinXeGfxFamily = IsWithinGfxCore; +using IsNotWithinXeGfxFamily = IsNotAnyGfxCores; using IsAtLeastXeHpCore = IsAtLeastGfxCore; using IsAtMostXeHpCore = IsAtMostGfxCore; diff --git a/shared/test/unit_test/helpers/compiler_product_helper_tests.cpp b/shared/test/unit_test/helpers/compiler_product_helper_tests.cpp index bd6fa2eaed..6aa50b3927 100644 --- a/shared/test/unit_test/helpers/compiler_product_helper_tests.cpp +++ b/shared/test/unit_test/helpers/compiler_product_helper_tests.cpp @@ -122,6 +122,18 @@ HWTEST2_F(CompilerProductHelperFixture, GivenXeHpAndLaterThenMatrixMultiplyAccum EXPECT_TRUE(compilerProductHelper.isMatrixMultiplyAccumulateSupported(pDevice->getHardwareInfo())); } +HWTEST2_F(CompilerProductHelperFixture, GivenXeFamilyThenSplitMatrixMultiplyAccumulateIsSupported, IsWithinXeGfxFamily) { + auto &compilerProductHelper = pDevice->getCompilerProductHelper(); + + EXPECT_TRUE(compilerProductHelper.isSplitMatrixMultiplyAccumulateSupported(pDevice->getHardwareInfo())); +} + +HWTEST2_F(CompilerProductHelperFixture, GivenNotXeFamilyThenSplitMatrixMultiplyAccumulateIsNotSupported, IsNotWithinXeGfxFamily) { + auto &compilerProductHelper = pDevice->getCompilerProductHelper(); + + EXPECT_FALSE(compilerProductHelper.isSplitMatrixMultiplyAccumulateSupported(pDevice->getHardwareInfo())); +} + HWTEST2_F(CompilerProductHelperFixture, GivenPreXeHpThenBFloat16ConversionIsNotSupported, IsAtMostGen12lp) { auto &compilerProductHelper = pDevice->getCompilerProductHelper(); diff --git a/shared/test/unit_test/xe_hpg_core/mtl/excludes_xe_hpg_core_mtl.cpp b/shared/test/unit_test/xe_hpg_core/mtl/excludes_xe_hpg_core_mtl.cpp index f4ab09035e..32746f77fa 100644 --- a/shared/test/unit_test/xe_hpg_core/mtl/excludes_xe_hpg_core_mtl.cpp +++ b/shared/test/unit_test/xe_hpg_core/mtl/excludes_xe_hpg_core_mtl.cpp @@ -23,3 +23,4 @@ HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenIsAdjustWalkOrde HWTEST_EXCLUDE_PRODUCT(ProductHelperCommonTest, givenPatIndexAndAllocationTypeWhenCallOverridePatIndexThenSameIndexIsReturned, IGFX_METEORLAKE); HWTEST_EXCLUDE_PRODUCT(CompilerProductHelperFixture, GivenXeHpAndLaterThenBFloat16ConversionIsSupported_IsAtLeastXeHpCore, IGFX_METEORLAKE); HWTEST_EXCLUDE_PRODUCT(CompilerProductHelperFixture, GivenXeHpAndLaterThenMatrixMultiplyAccumulateIsSupported_IsAtLeastXeHpCore, IGFX_METEORLAKE); +HWTEST_EXCLUDE_PRODUCT(CompilerProductHelperFixture, GivenXeFamilyThenSplitMatrixMultiplyAccumulateIsSupported_IsWithinXeGfxFamily, IGFX_METEORLAKE); diff --git a/shared/test/unit_test/xe_hpg_core/mtl/gfx_core_helper_tests_mtl.cpp b/shared/test/unit_test/xe_hpg_core/mtl/gfx_core_helper_tests_mtl.cpp index f0d64cb62a..94549dc2b3 100644 --- a/shared/test/unit_test/xe_hpg_core/mtl/gfx_core_helper_tests_mtl.cpp +++ b/shared/test/unit_test/xe_hpg_core/mtl/gfx_core_helper_tests_mtl.cpp @@ -38,6 +38,7 @@ MTLTEST_F(GfxCoreHelperTestMtl, givenVariousMtlReleasesWhenGetExtensionsIsCalled EXPECT_EQ(!MTL::isLpg(hwInfo), hasSubstr(extensions, std::string("cl_intel_subgroup_matrix_multiply_accumulate"))); EXPECT_EQ(!MTL::isLpg(hwInfo), hasSubstr(extensions, std::string("cl_intel_subgroup_split_matrix_multiply_accumulate"))); EXPECT_EQ(!MTL::isLpg(hwInfo), compilerProductHelper.isMatrixMultiplyAccumulateSupported(hwInfo)); + EXPECT_EQ(!MTL::isLpg(hwInfo), compilerProductHelper.isSplitMatrixMultiplyAccumulateSupported(hwInfo)); } }