From 783df81a4489994b62096ebbee7a13330d28a03f Mon Sep 17 00:00:00 2001 From: Zbigniew Zdanowicz Date: Thu, 9 Feb 2023 10:00:59 +0000 Subject: [PATCH] Unify flush task getter implementation of product and core helpers Signed-off-by: Zbigniew Zdanowicz --- .../sources/cmdlist/test_cmdlist_4.cpp | 35 +------------------ ...os_agnostic_hw_info_config_xe_hpc_core.inl | 5 --- .../dg2/os_agnostic_hw_info_config_dg2.inl | 5 --- .../mtl/os_agnostic_hw_info_config_mtl.inl | 5 --- .../helpers/gfx_core_helper_tests.cpp | 14 +------- 5 files changed, 2 insertions(+), 62 deletions(-) diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_4.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_4.cpp index dd45da517a..b1a61faad1 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_4.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_4.cpp @@ -252,40 +252,7 @@ class CommandListImmediateFlushTaskTests : public DeviceFixture { }; using CommandListImmediateFlushTaskComputeTests = Test; -HWTEST2_F(CommandListImmediateFlushTaskComputeTests, givenDG2CommandListIsInititalizedThenByDefaultFlushTaskSubmissionEnabled, IsDG2) { - ze_command_queue_desc_t queueDesc = {}; - ze_result_t returnValue; - std::unique_ptr commandList(CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::Compute, returnValue)); - - EXPECT_EQ(true, commandList->isFlushTaskSubmissionEnabled); -} - -HWTEST2_F(CommandListImmediateFlushTaskComputeTests, givenMTLCommandListIsInititalizedThenByDefaultFlushTaskSubmissionDisabled, IsMTL) { - ze_command_queue_desc_t queueDesc = {}; - ze_result_t returnValue; - std::unique_ptr commandList(CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::Compute, returnValue)); - - EXPECT_EQ(false, commandList->isFlushTaskSubmissionEnabled); -} - -HWTEST2_F(CommandListImmediateFlushTaskComputeTests, givenXeHPCommandListIsInititalizedThenByDefaultFlushTaskSubmissionEnabled, IsXEHP) { - ze_command_queue_desc_t queueDesc = {}; - ze_result_t returnValue; - std::unique_ptr commandList(CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::Compute, returnValue)); - - EXPECT_EQ(true, commandList->isFlushTaskSubmissionEnabled); -} - -using MatchXeHpc = IsGfxCore; -HWTEST2_F(CommandListImmediateFlushTaskComputeTests, givenXeHPCCommandListIsInititalizedThenByDefaultFlushTaskSubmissionEnabled, MatchXeHpc) { - ze_command_queue_desc_t queueDesc = {}; - ze_result_t returnValue; - std::unique_ptr commandList(CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::Compute, returnValue)); - - EXPECT_EQ(true, commandList->isFlushTaskSubmissionEnabled); -} - -HWTEST2_F(CommandListImmediateFlushTaskComputeTests, givenCommandListIsInititalizedThenByDefaultFlushTaskSubmissionDisabled, IsAtMostGen12lp) { +HWTEST_F(CommandListImmediateFlushTaskComputeTests, givenImmediateCommandListIsInititalizedThenByDefaultFlushTaskSubmissionEnabled) { ze_command_queue_desc_t queueDesc = {}; ze_result_t returnValue; std::unique_ptr commandList(CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::Compute, returnValue)); diff --git a/shared/source/xe_hpc_core/os_agnostic_hw_info_config_xe_hpc_core.inl b/shared/source/xe_hpc_core/os_agnostic_hw_info_config_xe_hpc_core.inl index 44ef5e1773..fdf878d91a 100644 --- a/shared/source/xe_hpc_core/os_agnostic_hw_info_config_xe_hpc_core.inl +++ b/shared/source/xe_hpc_core/os_agnostic_hw_info_config_xe_hpc_core.inl @@ -21,11 +21,6 @@ bool ProductHelperHw::isDcFlushAllowed() const { return false; } -template <> -bool ProductHelperHw::isFlushTaskAllowed() const { - return true; -} - template <> bool ProductHelperHw::isTimestampWaitSupportedForEvents() const { return true; diff --git a/shared/source/xe_hpg_core/dg2/os_agnostic_hw_info_config_dg2.inl b/shared/source/xe_hpg_core/dg2/os_agnostic_hw_info_config_dg2.inl index 133a25bfba..51f81216b2 100644 --- a/shared/source/xe_hpg_core/dg2/os_agnostic_hw_info_config_dg2.inl +++ b/shared/source/xe_hpg_core/dg2/os_agnostic_hw_info_config_dg2.inl @@ -181,11 +181,6 @@ uint32_t ProductHelperHw::computeMaxNeededSubSliceSpace(const Hardwa return maxSubSlice; } -template <> -bool ProductHelperHw::isFlushTaskAllowed() const { - return true; -} - template <> bool ProductHelperHw::programAllStateComputeCommandFields() const { return true; diff --git a/shared/source/xe_hpg_core/mtl/os_agnostic_hw_info_config_mtl.inl b/shared/source/xe_hpg_core/mtl/os_agnostic_hw_info_config_mtl.inl index df82ff5162..bf4820b37a 100644 --- a/shared/source/xe_hpg_core/mtl/os_agnostic_hw_info_config_mtl.inl +++ b/shared/source/xe_hpg_core/mtl/os_agnostic_hw_info_config_mtl.inl @@ -124,9 +124,4 @@ uint64_t ProductHelperHw::overridePatIndex(AllocationType allocation return patIndex; } -template <> -bool ProductHelperHw::isFlushTaskAllowed() const { - return false; -} - } // namespace NEO diff --git a/shared/test/unit_test/helpers/gfx_core_helper_tests.cpp b/shared/test/unit_test/helpers/gfx_core_helper_tests.cpp index 31ef2f708e..2d4ea8a06e 100644 --- a/shared/test/unit_test/helpers/gfx_core_helper_tests.cpp +++ b/shared/test/unit_test/helpers/gfx_core_helper_tests.cpp @@ -1278,19 +1278,7 @@ HWTEST_F(GfxCoreHelperTest, givenGfxCoreHelperWhenGettingIfRevisionSpecificBinar EXPECT_FALSE(gfxCoreHelper.isRevisionSpecificBinaryBuiltinRequired()); } -HWTEST2_F(GfxCoreHelperTest, givenDG2GfxCoreHelperWhenGettingIsPlatformFlushTaskEnabledThenTrueIsReturned, IsDG2) { - const auto &gfxCoreHelper = getHelper(); - auto &productHelper = getHelper(); - EXPECT_TRUE(gfxCoreHelper.isPlatformFlushTaskEnabled(productHelper)); -} - -HWTEST2_F(GfxCoreHelperTest, givenPvcGfxCoreHelperWhenGettingIsPlatformFlushTaskEnabledThenTrueIsReturned, IsPVC) { - const auto &gfxCoreHelper = getHelper(); - auto &productHelper = getHelper(); - EXPECT_TRUE(gfxCoreHelper.isPlatformFlushTaskEnabled(productHelper)); -} - -HWTEST2_F(GfxCoreHelperTest, givenAtMostGen12lpGfxCoreHelperWhenGettingIsPlatformFlushTaskEnabledThenFalseIsReturned, IsAtMostGen12lp) { +HWTEST_F(GfxCoreHelperTest, givenGfxCoreHelperWhenGettingIsPlatformFlushTaskEnabledThenTrueIsReturned) { const auto &gfxCoreHelper = getHelper(); auto &productHelper = getHelper(); EXPECT_TRUE(gfxCoreHelper.isPlatformFlushTaskEnabled(productHelper));