From 625575209a6325faeca0acf1a9518324c379e26d Mon Sep 17 00:00:00 2001 From: Zbigniew Zdanowicz Date: Mon, 17 Jan 2022 15:00:06 +0000 Subject: [PATCH] Add new test matcher Related-To: NEO-6589 Signed-off-by: Zbigniew Zdanowicz --- .../test/unit_tests/sources/kernel/test_kernel.cpp | 2 +- .../test/common/test_macros/header/common_matchers.h | 4 +++- shared/test/common/test_macros/test.h | 10 +++++++++- .../encoders/command_encoder_tests_xehp_and_later.cpp | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp b/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp index 67fadaae40..418e5e7561 100644 --- a/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp +++ b/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp @@ -2330,7 +2330,7 @@ TEST_F(KernelImplicitArgTests, givenKernelWithoutImplicitArgsWhenPatchingImplici using MultiTileModuleTest = Test; -HWTEST2_F(MultiTileModuleTest, GivenMultiTileDeviceWhenSettingKernelArgAndSurfaceStateThenMultiTileFlagsAreSetCorrectly, IsXEHP) { +HWTEST2_F(MultiTileModuleTest, GivenMultiTileDeviceWhenSettingKernelArgAndSurfaceStateThenMultiTileFlagsAreSetCorrectly, isXeHpOrXeHpcCore) { using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; ze_kernel_desc_t desc = {}; desc.pKernelName = kernelName.c_str(); diff --git a/shared/test/common/test_macros/header/common_matchers.h b/shared/test/common/test_macros/header/common_matchers.h index 607f0e0422..7e2f937299 100644 --- a/shared/test/common/test_macros/header/common_matchers.h +++ b/shared/test/common/test_macros/header/common_matchers.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -32,6 +32,8 @@ using IsAtMostXeHpgCore = IsAtMostGfxCore; using IsAtLeastXeHpcCore = IsAtLeastGfxCore; +using isXeHpOrXeHpcCore = IsAnyGfxCores; + using IsSKL = IsProduct; using IsKBL = IsProduct; using IsCFL = IsProduct; diff --git a/shared/test/common/test_macros/test.h b/shared/test/common/test_macros/test.h index 0c758f84aa..43c04f3f44 100644 --- a/shared/test/common/test_macros/test.h +++ b/shared/test/common/test_macros/test.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -809,6 +809,14 @@ struct IsWithinGfxCore { } }; +template +struct IsAnyGfxCores { + template + static constexpr bool isMatched() { + return (... || IsGfxCore::template isMatched()); + } +}; + template struct IsProduct { template diff --git a/shared/test/unit_test/encoders/command_encoder_tests_xehp_and_later.cpp b/shared/test/unit_test/encoders/command_encoder_tests_xehp_and_later.cpp index e51f1689e0..6e3e029fe6 100644 --- a/shared/test/unit_test/encoders/command_encoder_tests_xehp_and_later.cpp +++ b/shared/test/unit_test/encoders/command_encoder_tests_xehp_and_later.cpp @@ -97,7 +97,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterHardwareCommandsTest, givenPartitionArg } HWTEST2_F(XeHPAndLaterCommandEncoderTest, - GivenImplicitAndAtomicsFlagsTrueWhenProgrammingSurfaceStateThenExpectMultiTileCorrectlySet, IsXEHP) { + GivenImplicitAndAtomicsFlagsTrueWhenProgrammingSurfaceStateThenExpectMultiTileCorrectlySet, isXeHpOrXeHpcCore) { using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get();