From 615688336f722051e2954e65d124294cf676877f Mon Sep 17 00:00:00 2001 From: Maciej Plewka Date: Mon, 20 Dec 2021 16:09:41 +0000 Subject: [PATCH] Program all fields in SCM Related-To: NEO-6432 This change applies WA that always programs all fields in SCM for gen12lp. Also for those platforms Force Non-Coherent is set to 0x2. Signed-off-by: Maciej Plewka --- level_zero/core/source/gen12lp/CMakeLists.txt | 1 + .../core/source/gen12lp/adlp/cmdlist_adlp.cpp | 8 --- .../core/source/gen12lp/adls/cmdlist_adls.cpp | 7 -- .../core/source/gen12lp/cmdlist_gen12lp.cpp | 27 ++++++++ .../core/source/gen12lp/cmdlist_gen12lp.h | 4 +- .../core/source/gen12lp/dg1/cmdlist_dg1.cpp | 12 ---- .../core/source/gen12lp/rkl/cmdlist_rkl.cpp | 8 --- .../source/gen12lp/tgllp/cmdlist_tgllp.cpp | 12 ---- .../core/source/xe_hpg_core/CMakeLists.txt | 3 + .../xe_hpg_core/cmdlist_xe_hpg_core.cpp | 26 ++++++++ .../cmdlist_dg2.h => cmdlist_xe_hpg_core.h} | 21 +++--- .../xe_hpg_core/cmdlist_xe_hpg_core.inl | 17 +++++ .../source/xe_hpg_core/dg2/CMakeLists.txt | 1 - .../source/xe_hpg_core/dg2/cmdlist_dg2.cpp | 12 +--- .../core/test/unit_tests/mocks/mock_cmdlist.h | 1 + .../sources/cmdlist/test_cmdlist_4.cpp | 24 +++++++ .../xe_hpg_core/dg2/test_cmdlist_dg2.cpp | 26 +------- .../xe_hpg_core/test_cmdlist_xe_hpg_core.cpp | 66 +++++++++++++++++++ ...and_stream_receiver_flush_task_3_tests.cpp | 6 +- .../gen12lp/coherency_tests_gen12lp.inl | 16 +---- .../unit_test/helpers/hw_helper_tests.cpp | 30 +++++++++ .../command_stream_receiver_hw_base.inl | 6 +- shared/source/gen12lp/hw_helper_gen12lp.cpp | 5 ++ shared/source/helpers/hw_helper.h | 2 + shared/source/helpers/hw_helper_base.inl | 5 +- shared/test/common/gen11/test_traits_gen11.h | 1 + .../test/common/gen12lp/test_traits_gen12lp.h | 3 +- shared/test/common/gen8/test_traits_gen8.h | 1 + shared/test/common/gen9/test_traits_gen9.h | 1 + shared/test/common/helpers/CMakeLists.txt | 2 + .../includes/test_traits_platforms_common.h | 11 ++++ .../common/helpers/test_traits_platforms.h | 13 ++++ .../xe_hp_core/test_traits_xe_hp_core.h | 1 + .../xe_hpc_core/test_traits_xe_hpc_core.h | 1 + .../common/xe_hpg_core/dg2/CMakeLists.txt | 1 + .../common/xe_hpg_core/dg2/test_traits_dg2.h | 14 ++++ .../xe_hpg_core/test_traits_xe_hpg_core.h | 3 +- 37 files changed, 278 insertions(+), 120 deletions(-) create mode 100644 level_zero/core/source/gen12lp/cmdlist_gen12lp.cpp create mode 100644 level_zero/core/source/xe_hpg_core/cmdlist_xe_hpg_core.cpp rename level_zero/core/source/xe_hpg_core/{dg2/cmdlist_dg2.h => cmdlist_xe_hpg_core.h} (55%) create mode 100644 level_zero/core/source/xe_hpg_core/cmdlist_xe_hpg_core.inl create mode 100644 shared/test/common/helpers/includes/test_traits_platforms_common.h create mode 100644 shared/test/common/helpers/test_traits_platforms.h create mode 100644 shared/test/common/xe_hpg_core/dg2/test_traits_dg2.h diff --git a/level_zero/core/source/gen12lp/CMakeLists.txt b/level_zero/core/source/gen12lp/CMakeLists.txt index d299c1b505..9084b0f07f 100644 --- a/level_zero/core/source/gen12lp/CMakeLists.txt +++ b/level_zero/core/source/gen12lp/CMakeLists.txt @@ -7,6 +7,7 @@ if(SUPPORT_GEN12LP) set(HW_SOURCES_GEN12LP ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_SOURCE_DIR}/cmdlist_gen12lp.cpp ${CMAKE_CURRENT_SOURCE_DIR}/cmdlist_gen12lp.h ${CMAKE_CURRENT_SOURCE_DIR}/debugger_gen12lp.cpp ${CMAKE_CURRENT_SOURCE_DIR}/definitions/cache_flush_gen12lp.inl diff --git a/level_zero/core/source/gen12lp/adlp/cmdlist_adlp.cpp b/level_zero/core/source/gen12lp/adlp/cmdlist_adlp.cpp index d6e5daebb8..8fda993d1f 100644 --- a/level_zero/core/source/gen12lp/adlp/cmdlist_adlp.cpp +++ b/level_zero/core/source/gen12lp/adlp/cmdlist_adlp.cpp @@ -5,17 +5,9 @@ * */ -#include "level_zero/core/source/cmdlist/cmdlist_hw.inl" -#include "level_zero/core/source/cmdlist/cmdlist_hw_base.inl" -#include "level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl" #include "level_zero/core/source/gen12lp/cmdlist_gen12lp.h" -#include "cache_flush_gen12lp.inl" -#include "cmdlist_extended.inl" - namespace L0 { -template struct CommandListCoreFamily; - static CommandListPopulateFactory> populateADLP; diff --git a/level_zero/core/source/gen12lp/adls/cmdlist_adls.cpp b/level_zero/core/source/gen12lp/adls/cmdlist_adls.cpp index 240ac56902..80c200bd82 100644 --- a/level_zero/core/source/gen12lp/adls/cmdlist_adls.cpp +++ b/level_zero/core/source/gen12lp/adls/cmdlist_adls.cpp @@ -5,16 +5,9 @@ * */ -#include "level_zero/core/source/cmdlist/cmdlist_hw.inl" -#include "level_zero/core/source/cmdlist/cmdlist_hw_base.inl" -#include "level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl" #include "level_zero/core/source/gen12lp/cmdlist_gen12lp.h" -#include "level_zero/core/source/gen12lp/definitions/cache_flush_gen12lp.inl" - -#include "cmdlist_extended.inl" namespace L0 { -template struct CommandListCoreFamily; static CommandListPopulateFactory> populateADLS; diff --git a/level_zero/core/source/gen12lp/cmdlist_gen12lp.cpp b/level_zero/core/source/gen12lp/cmdlist_gen12lp.cpp new file mode 100644 index 0000000000..47b43172c9 --- /dev/null +++ b/level_zero/core/source/gen12lp/cmdlist_gen12lp.cpp @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2020-2021 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/core/source/cmdlist/cmdlist_hw.h" +#include "level_zero/core/source/cmdlist/cmdlist_hw.inl" +#include "level_zero/core/source/cmdlist/cmdlist_hw_base.inl" +#include "level_zero/core/source/cmdlist/cmdlist_hw_immediate.h" +#include "level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl" + +#include "cache_flush_gen12lp.inl" +#include "cmdlist_extended.inl" + +namespace L0 { +template <> +void CommandListCoreFamily::clearComputeModePropertiesIfNeeded(bool requiresCoherency, uint32_t numGrfRequired, uint32_t threadArbitrationPolicy) { + finalStreamState.stateComputeMode = {}; + finalStreamState.stateComputeMode.setProperties(false, numGrfRequired, threadArbitrationPolicy); +} + +template struct CommandListCoreFamily; +template struct CommandListCoreFamilyImmediate; + +} // namespace L0 \ No newline at end of file diff --git a/level_zero/core/source/gen12lp/cmdlist_gen12lp.h b/level_zero/core/source/gen12lp/cmdlist_gen12lp.h index 0f67ffe325..ddeb70d3b7 100644 --- a/level_zero/core/source/gen12lp/cmdlist_gen12lp.h +++ b/level_zero/core/source/gen12lp/cmdlist_gen12lp.h @@ -6,12 +6,10 @@ */ #pragma once - #include "level_zero/core/source/cmdlist/cmdlist_hw.h" #include "level_zero/core/source/cmdlist/cmdlist_hw_immediate.h" namespace L0 { - template struct CommandListProductFamily : public CommandListCoreFamily { using CommandListCoreFamily::CommandListCoreFamily; @@ -21,4 +19,4 @@ template struct CommandListImmediateProductFamily : public CommandListCoreFamilyImmediate { using CommandListCoreFamilyImmediate::CommandListCoreFamilyImmediate; }; -} // namespace L0 +} // namespace L0 \ No newline at end of file diff --git a/level_zero/core/source/gen12lp/dg1/cmdlist_dg1.cpp b/level_zero/core/source/gen12lp/dg1/cmdlist_dg1.cpp index 818f31ae75..ffde1e407a 100644 --- a/level_zero/core/source/gen12lp/dg1/cmdlist_dg1.cpp +++ b/level_zero/core/source/gen12lp/dg1/cmdlist_dg1.cpp @@ -5,21 +5,9 @@ * */ -#include "shared/source/gen12lp/hw_cmds.h" -#include "shared/source/gen12lp/hw_info.h" - -#include "level_zero/core/source/cmdlist/cmdlist_hw.inl" -#include "level_zero/core/source/cmdlist/cmdlist_hw_base.inl" -#include "level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl" #include "level_zero/core/source/gen12lp/cmdlist_gen12lp.h" -#include "cache_flush_gen12lp.inl" -#include "cmdlist_extended.inl" -#include "igfxfmid.h" - namespace L0 { -template struct CommandListCoreFamily; - static CommandListPopulateFactory> populateDG1; diff --git a/level_zero/core/source/gen12lp/rkl/cmdlist_rkl.cpp b/level_zero/core/source/gen12lp/rkl/cmdlist_rkl.cpp index 0ca24e3568..e3fc7dd925 100644 --- a/level_zero/core/source/gen12lp/rkl/cmdlist_rkl.cpp +++ b/level_zero/core/source/gen12lp/rkl/cmdlist_rkl.cpp @@ -5,17 +5,9 @@ * */ -#include "level_zero/core/source/cmdlist/cmdlist_hw.inl" -#include "level_zero/core/source/cmdlist/cmdlist_hw_base.inl" -#include "level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl" #include "level_zero/core/source/gen12lp/cmdlist_gen12lp.h" -#include "cache_flush_gen12lp.inl" -#include "cmdlist_extended.inl" - namespace L0 { -template struct CommandListCoreFamily; - static CommandListPopulateFactory> populateRKL; diff --git a/level_zero/core/source/gen12lp/tgllp/cmdlist_tgllp.cpp b/level_zero/core/source/gen12lp/tgllp/cmdlist_tgllp.cpp index 716a010011..7fe6a16882 100644 --- a/level_zero/core/source/gen12lp/tgllp/cmdlist_tgllp.cpp +++ b/level_zero/core/source/gen12lp/tgllp/cmdlist_tgllp.cpp @@ -5,21 +5,9 @@ * */ -#include "shared/source/gen12lp/hw_cmds.h" -#include "shared/source/gen12lp/hw_info.h" - -#include "level_zero/core/source/cmdlist/cmdlist_hw.inl" -#include "level_zero/core/source/cmdlist/cmdlist_hw_base.inl" -#include "level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl" #include "level_zero/core/source/gen12lp/cmdlist_gen12lp.h" -#include "cache_flush_gen12lp.inl" -#include "cmdlist_extended.inl" -#include "igfxfmid.h" - namespace L0 { -template struct CommandListCoreFamily; - static CommandListPopulateFactory> populateTGLLP; diff --git a/level_zero/core/source/xe_hpg_core/CMakeLists.txt b/level_zero/core/source/xe_hpg_core/CMakeLists.txt index ba618b19f9..2a59c47e67 100644 --- a/level_zero/core/source/xe_hpg_core/CMakeLists.txt +++ b/level_zero/core/source/xe_hpg_core/CMakeLists.txt @@ -7,6 +7,9 @@ if(SUPPORT_XE_HPG_CORE) set(HW_SOURCES_XE_HPG_CORE ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_SOURCE_DIR}/cmdlist_xe_hpg_core.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/cmdlist_xe_hpg_core.h + ${CMAKE_CURRENT_SOURCE_DIR}/cmdlist_xe_hpg_core.inl ${CMAKE_CURRENT_SOURCE_DIR}/debugger_xe_hpg_core.cpp ${CMAKE_CURRENT_SOURCE_DIR}/image_xe_hpg_core.inl ${CMAKE_CURRENT_SOURCE_DIR}/sampler_xe_hpg_core.inl diff --git a/level_zero/core/source/xe_hpg_core/cmdlist_xe_hpg_core.cpp b/level_zero/core/source/xe_hpg_core/cmdlist_xe_hpg_core.cpp new file mode 100644 index 0000000000..48fe07443f --- /dev/null +++ b/level_zero/core/source/xe_hpg_core/cmdlist_xe_hpg_core.cpp @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2021 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/core/source/cmdlist/cmdlist_hw.h" +#include "level_zero/core/source/cmdlist/cmdlist_hw.inl" +#include "level_zero/core/source/cmdlist/cmdlist_hw_immediate.h" +#include "level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl" +#include "level_zero/core/source/cmdlist/cmdlist_hw_xehp_and_later.inl" + +#include "cmdlist_extended.inl" + +namespace L0 { +template <> +void CommandListCoreFamily::clearComputeModePropertiesIfNeeded(bool requiresCoherency, uint32_t numGrfRequired, uint32_t threadArbitrationPolicy) { + finalStreamState.stateComputeMode = {}; + finalStreamState.stateComputeMode.setProperties(requiresCoherency, numGrfRequired, threadArbitrationPolicy); +} + +template struct CommandListCoreFamily; +template struct CommandListCoreFamilyImmediate; + +} // namespace L0 \ No newline at end of file diff --git a/level_zero/core/source/xe_hpg_core/dg2/cmdlist_dg2.h b/level_zero/core/source/xe_hpg_core/cmdlist_xe_hpg_core.h similarity index 55% rename from level_zero/core/source/xe_hpg_core/dg2/cmdlist_dg2.h rename to level_zero/core/source/xe_hpg_core/cmdlist_xe_hpg_core.h index 96662eba06..f9fb9206e7 100644 --- a/level_zero/core/source/xe_hpg_core/dg2/cmdlist_dg2.h +++ b/level_zero/core/source/xe_hpg_core/cmdlist_xe_hpg_core.h @@ -5,21 +5,20 @@ * */ +#pragma once + #include "level_zero/core/source/cmdlist/cmdlist_hw.h" #include "level_zero/core/source/cmdlist/cmdlist_hw_immediate.h" namespace L0 { -template <> -struct CommandListImmediateProductFamily : public CommandListCoreFamilyImmediate { + +template +struct CommandListProductFamily : public CommandListCoreFamily { + using CommandListCoreFamily::CommandListCoreFamily; + void clearComputeModePropertiesIfNeeded(bool requiresCoherency, uint32_t numGrfRequired, uint32_t threadArbitrationPolicy) override; +}; +template +struct CommandListImmediateProductFamily : public CommandListCoreFamilyImmediate { using CommandListCoreFamilyImmediate::CommandListCoreFamilyImmediate; }; -template <> -struct CommandListProductFamily : public CommandListCoreFamily { - using CommandListCoreFamily::CommandListCoreFamily; - void clearComputeModePropertiesIfNeeded(bool requiresCoherency, uint32_t numGrfRequired, uint32_t threadArbitrationPolicy) override { - finalStreamState.stateComputeMode = {}; - finalStreamState.stateComputeMode.setProperties(requiresCoherency, numGrfRequired, threadArbitrationPolicy); - } -}; - } // namespace L0 diff --git a/level_zero/core/source/xe_hpg_core/cmdlist_xe_hpg_core.inl b/level_zero/core/source/xe_hpg_core/cmdlist_xe_hpg_core.inl new file mode 100644 index 0000000000..ec2cb1b062 --- /dev/null +++ b/level_zero/core/source/xe_hpg_core/cmdlist_xe_hpg_core.inl @@ -0,0 +1,17 @@ +/* + * Copyright (C) 2021 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#pragma once + +#include "level_zero/core/source/cmdlist/cmdlist_hw.h" + +namespace L0 { +template +void CommandListProductFamily::clearComputeModePropertiesIfNeeded(bool requiresCoherency, uint32_t numGrfRequired, uint32_t threadArbitrationPolicy) { + CommandListCoreFamily::clearComputeModePropertiesIfNeeded(requiresCoherency, numGrfRequired, threadArbitrationPolicy); +} +} // namespace L0 \ No newline at end of file diff --git a/level_zero/core/source/xe_hpg_core/dg2/CMakeLists.txt b/level_zero/core/source/xe_hpg_core/dg2/CMakeLists.txt index e7adb797b1..6b1f6d9708 100644 --- a/level_zero/core/source/xe_hpg_core/dg2/CMakeLists.txt +++ b/level_zero/core/source/xe_hpg_core/dg2/CMakeLists.txt @@ -9,7 +9,6 @@ if(SUPPORT_DG2) ${HW_SOURCES_XE_HPG_CORE} ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/cmdlist_dg2.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/cmdlist_dg2.h ${CMAKE_CURRENT_SOURCE_DIR}/cmdqueue_dg2.cpp ${CMAKE_CURRENT_SOURCE_DIR}/kernel_dg2.cpp ${CMAKE_CURRENT_SOURCE_DIR}/image_dg2.cpp diff --git a/level_zero/core/source/xe_hpg_core/dg2/cmdlist_dg2.cpp b/level_zero/core/source/xe_hpg_core/dg2/cmdlist_dg2.cpp index e74384fd03..bf06c758a3 100644 --- a/level_zero/core/source/xe_hpg_core/dg2/cmdlist_dg2.cpp +++ b/level_zero/core/source/xe_hpg_core/dg2/cmdlist_dg2.cpp @@ -5,18 +5,10 @@ * */ -#include "cmdlist_dg2.h" - -#include "level_zero/core/source/cmdlist/cmdlist_hw.inl" -#include "level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl" -#include "level_zero/core/source/cmdlist/cmdlist_hw_xehp_and_later.inl" - -#include "cmdlist_extended.inl" +#include "level_zero/core/source/xe_hpg_core/cmdlist_xe_hpg_core.h" +#include "level_zero/core/source/xe_hpg_core/cmdlist_xe_hpg_core.inl" namespace L0 { - -template struct CommandListCoreFamily; - static CommandListPopulateFactory> populateDG2; diff --git a/level_zero/core/test/unit_tests/mocks/mock_cmdlist.h b/level_zero/core/test/unit_tests/mocks/mock_cmdlist.h index 83afecfbfe..057c558098 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_cmdlist.h +++ b/level_zero/core/test/unit_tests/mocks/mock_cmdlist.h @@ -40,6 +40,7 @@ struct WhiteBox<::L0::CommandListCoreFamily> using BaseClass::appendWriteKernelTimestamp; using BaseClass::applyMemoryRangesBarrier; using BaseClass::clearCommandsToPatch; + using BaseClass::clearComputeModePropertiesIfNeeded; using BaseClass::cmdQImmediate; using BaseClass::commandContainer; using BaseClass::commandListPerThreadScratchSize; 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 811c3033c7..42f5cb44d2 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 @@ -218,6 +218,30 @@ HWTEST2_F(CommandListAppendLaunchKernel, GivenComputeModeTraitsSetToFalsePropert EXPECT_TRUE(pCommandList->finalStreamState.stateComputeMode.isCoherencyRequired.isDirty); } +struct ForceNonCoherentMode { + template + static constexpr bool isMatched() { + if (productFamily == IGFX_BROADWELL) + return false; + return TestTraits::get()>::forceGpuNonCoherent; + } +}; + +HWTEST2_F(CommandListCreate, GivenComputeModePropertiesWhenClearComputeModePropertiesIfNeededIsCalledThenCoherencyFieldIsSetToFalse, ForceNonCoherentMode) { + DebugManagerStateRestore restorer; + Mock<::L0::Kernel> kernel; + auto pMockModule = std::unique_ptr(new Mock(device, nullptr)); + kernel.module = pMockModule.get(); + auto commandList = std::make_unique>>(); + auto result = commandList->initialize(device, NEO::EngineGroupType::Compute, 0u); + ASSERT_EQ(ZE_RESULT_SUCCESS, result); + const_cast(&kernel.getKernelDescriptor())->kernelAttributes.numGrfRequired = 0x100; + commandList->clearComputeModePropertiesIfNeeded(false, 0, 0); + EXPECT_EQ(commandList->finalStreamState.stateComputeMode.isCoherencyRequired.value, 0); + commandList->clearComputeModePropertiesIfNeeded(true, 0, 0); + EXPECT_EQ(commandList->finalStreamState.stateComputeMode.isCoherencyRequired.value, 0); +} + HWTEST2_F(CommandListAppendLaunchKernel, GivenComputeModePropertiesWhenPropertesNotChangedThenAllFieldsAreNotDirty, IsAtLeastSkl) { DebugManagerStateRestore restorer; diff --git a/level_zero/core/test/unit_tests/xe_hpg_core/dg2/test_cmdlist_dg2.cpp b/level_zero/core/test/unit_tests/xe_hpg_core/dg2/test_cmdlist_dg2.cpp index 56cca337a8..e559306171 100644 --- a/level_zero/core/test/unit_tests/xe_hpg_core/dg2/test_cmdlist_dg2.cpp +++ b/level_zero/core/test/unit_tests/xe_hpg_core/dg2/test_cmdlist_dg2.cpp @@ -10,7 +10,7 @@ #include "shared/test/common/test_macros/test.h" #include "level_zero/core/source/cmdlist/cmdlist_hw.h" -#include "level_zero/core/source/xe_hpg_core/dg2/cmdlist_dg2.h" +#include "level_zero/core/source/xe_hpg_core/cmdlist_xe_hpg_core.h" #include "level_zero/core/test/unit_tests/fixtures/device_fixture.h" #include "level_zero/core/test/unit_tests/fixtures/module_fixture.h" #include "level_zero/core/test/unit_tests/mocks/mock_module.h" @@ -60,29 +60,5 @@ HWTEST2_F(CommandListTests, givenDG2WithBSteppingWhenCreatingCommandListThenAddi EXPECT_TRUE(cmdSba->getDynamicStateBaseAddressModifyEnable()); EXPECT_TRUE(cmdSba->getDynamicStateBufferSizeModifyEnable()); } - -template -struct CommandListAdjustStateComputeMode : public WhiteBox<::L0::CommandListProductFamily> { - CommandListAdjustStateComputeMode() : WhiteBox<::L0::CommandListProductFamily>(1) {} - using ::L0::CommandListProductFamily::updateStreamProperties; - using ::L0::CommandListProductFamily::finalStreamState; -}; -HWTEST2_F(CommandListTests, GivenComputeModePropertiesWhenUpdateStreamPropertiesIsCalledTwiceThenAllFieldsChanged, IsDG2) { - DebugManagerStateRestore restorer; - Mock<::L0::Kernel> kernel; - auto pMockModule = std::unique_ptr(new Mock(device, nullptr)); - kernel.module = pMockModule.get(); - auto pCommandList = std::make_unique>(); - auto result = pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u); - ASSERT_EQ(ZE_RESULT_SUCCESS, result); - const_cast(&kernel.getKernelDescriptor())->kernelAttributes.numGrfRequired = 0x100; - pCommandList->updateStreamProperties(kernel, false, false); - EXPECT_TRUE(pCommandList->finalStreamState.stateComputeMode.isCoherencyRequired.isDirty); - EXPECT_TRUE(pCommandList->finalStreamState.stateComputeMode.largeGrfMode.isDirty); - const_cast(&kernel.getKernelDescriptor())->kernelAttributes.numGrfRequired = 0x80; - pCommandList->updateStreamProperties(kernel, false, false); - EXPECT_TRUE(pCommandList->finalStreamState.stateComputeMode.largeGrfMode.isDirty); - EXPECT_TRUE(pCommandList->finalStreamState.stateComputeMode.isCoherencyRequired.isDirty); -} } // namespace ult } // namespace L0 diff --git a/level_zero/core/test/unit_tests/xe_hpg_core/test_cmdlist_xe_hpg_core.cpp b/level_zero/core/test/unit_tests/xe_hpg_core/test_cmdlist_xe_hpg_core.cpp index 15b36dcb20..76e92a1935 100644 --- a/level_zero/core/test/unit_tests/xe_hpg_core/test_cmdlist_xe_hpg_core.cpp +++ b/level_zero/core/test/unit_tests/xe_hpg_core/test_cmdlist_xe_hpg_core.cpp @@ -13,9 +13,13 @@ #include "shared/test/common/mocks/mock_graphics_allocation.h" #include "shared/test/common/test_macros/test.h" +#include "level_zero/core/source/xe_hpg_core/cmdlist_xe_hpg_core.h" #include "level_zero/core/test/unit_tests/fixtures/device_fixture.h" #include "level_zero/core/test/unit_tests/mocks/mock_cmdlist.h" #include "level_zero/core/test/unit_tests/mocks/mock_kernel.h" +#include "level_zero/core/test/unit_tests/mocks/mock_module.h" + +#include "test_traits_platforms_common.h" namespace L0 { namespace ult { @@ -311,5 +315,67 @@ HWTEST2_F(CommandListCreate, givenRangeBetweenTwoPagesWhenAppendRangesBarrierThe EXPECT_EQ(l3Ranges->getAddressMask(), NEO::L3Range::getMaskFromSize(2 * MemoryConstants::pageSize)); } +template +struct CommandListAdjustStateComputeMode : public WhiteBox<::L0::CommandListProductFamily> { + CommandListAdjustStateComputeMode() : WhiteBox<::L0::CommandListProductFamily>(1) {} + using ::L0::CommandListProductFamily::updateStreamProperties; + using ::L0::CommandListProductFamily::finalStreamState; +}; +struct ProgramAllFieldsInComputeMode { + template + static constexpr bool isMatched() { + if constexpr (NEO::ToGfxCoreFamily::get() != IGFX_XE_HPG_CORE) { + return false; + } else { + return !TestTraitsPlatforms::programOnlyChangedFieldsInComputeStateMode; + } + } +}; + +HWTEST2_F(CommandListCreate, GivenComputeModePropertiesWhenUpdateStreamPropertiesIsCalledTwiceThenFieldsChanged, ProgramAllFieldsInComputeMode) { + DebugManagerStateRestore restorer; + Mock<::L0::Kernel> kernel; + auto pMockModule = std::unique_ptr(new Mock(device, nullptr)); + kernel.module = pMockModule.get(); + auto pCommandList = std::make_unique>(); + auto result = pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u); + ASSERT_EQ(ZE_RESULT_SUCCESS, result); + const_cast(&kernel.getKernelDescriptor())->kernelAttributes.numGrfRequired = 0x100; + pCommandList->updateStreamProperties(kernel, false, false); + EXPECT_TRUE(pCommandList->finalStreamState.stateComputeMode.isCoherencyRequired.isDirty); + EXPECT_TRUE(pCommandList->finalStreamState.stateComputeMode.largeGrfMode.isDirty); + const_cast(&kernel.getKernelDescriptor())->kernelAttributes.numGrfRequired = 0x80; + pCommandList->updateStreamProperties(kernel, false, false); + EXPECT_TRUE(pCommandList->finalStreamState.stateComputeMode.largeGrfMode.isDirty); + EXPECT_TRUE(pCommandList->finalStreamState.stateComputeMode.isCoherencyRequired.isDirty); +} +struct ProgramDirtyFieldsInComputeMode { + template + static constexpr bool isMatched() { + if constexpr (NEO::ToGfxCoreFamily::get() != IGFX_XE_HPG_CORE) { + return false; + } else { + return TestTraitsPlatforms::programOnlyChangedFieldsInComputeStateMode; + } + } +}; + +HWTEST2_F(CommandListCreate, GivenComputeModePropertiesWhenUpdateStreamPropertiesIsCalledTwiceDirtyFieldsChanged, ProgramDirtyFieldsInComputeMode) { + DebugManagerStateRestore restorer; + Mock<::L0::Kernel> kernel; + auto pMockModule = std::unique_ptr(new Mock(device, nullptr)); + kernel.module = pMockModule.get(); + auto pCommandList = std::make_unique>(); + auto result = pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u); + ASSERT_EQ(ZE_RESULT_SUCCESS, result); + const_cast(&kernel.getKernelDescriptor())->kernelAttributes.numGrfRequired = 0x100; + pCommandList->updateStreamProperties(kernel, false, false); + EXPECT_TRUE(pCommandList->finalStreamState.stateComputeMode.isCoherencyRequired.isDirty); + EXPECT_TRUE(pCommandList->finalStreamState.stateComputeMode.largeGrfMode.isDirty); + const_cast(&kernel.getKernelDescriptor())->kernelAttributes.numGrfRequired = 0x80; + pCommandList->updateStreamProperties(kernel, false, false); + EXPECT_TRUE(pCommandList->finalStreamState.stateComputeMode.largeGrfMode.isDirty); + EXPECT_FALSE(pCommandList->finalStreamState.stateComputeMode.isCoherencyRequired.isDirty); +} } // namespace ult } // namespace L0 diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp index eca0c6c641..f6c91c9ee3 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp @@ -389,9 +389,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenCsrInBatch DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags(); dispatchFlags.preemptionMode = PreemptionHelper::getDefaultPreemptionMode(pDevice->getHardwareInfo()); dispatchFlags.guardCommandBufferWithPipeControl = true; - dispatchFlags.requiresCoherency = true; + dispatchFlags.requiresCoherency = false; - mockCsr->streamProperties.stateComputeMode.isCoherencyRequired.value = 1; + mockCsr->streamProperties.stateComputeMode.isCoherencyRequired.value = 0; commandStream.getSpace(4); @@ -430,7 +430,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenCsrInBatch mockCsr->flushBatchedSubmissions(); EXPECT_FALSE(mockCsr->recordedCommandBuffer->batchBuffer.low_priority); - EXPECT_TRUE(mockCsr->recordedCommandBuffer->batchBuffer.requiresCoherency); + EXPECT_FALSE(mockCsr->recordedCommandBuffer->batchBuffer.requiresCoherency); EXPECT_EQ(mockCsr->recordedCommandBuffer->batchBuffer.commandBufferAllocation, commandStream.getGraphicsAllocation()); EXPECT_EQ(4u, mockCsr->recordedCommandBuffer->batchBuffer.startOffset); EXPECT_EQ(1, mockCsr->flushCalledCount); diff --git a/opencl/test/unit_test/gen12lp/coherency_tests_gen12lp.inl b/opencl/test/unit_test/gen12lp/coherency_tests_gen12lp.inl index e89135a5d7..768870b692 100644 --- a/opencl/test/unit_test/gen12lp/coherency_tests_gen12lp.inl +++ b/opencl/test/unit_test/gen12lp/coherency_tests_gen12lp.inl @@ -221,7 +221,7 @@ GEN12LPTEST_F(Gen12LpCoherencyRequirements, givenCoherencyRequirementWithoutShar hwParser.parseCommands(csr->commandStream, startOffset); bool foundOne = false; - STATE_COMPUTE_MODE::FORCE_NON_COHERENT expectedCoherentValue = expectCoherent ? STATE_COMPUTE_MODE::FORCE_NON_COHERENT_FORCE_DISABLED : STATE_COMPUTE_MODE::FORCE_NON_COHERENT_FORCE_GPU_NON_COHERENT; + STATE_COMPUTE_MODE::FORCE_NON_COHERENT expectedCoherentValue = STATE_COMPUTE_MODE::FORCE_NON_COHERENT_FORCE_GPU_NON_COHERENT; uint32_t expectedCoherentMask = FamilyType::stateComputeModeForceNonCoherentMask; for (auto it = hwParser.cmdList.begin(); it != hwParser.cmdList.end(); it++) { @@ -254,17 +254,6 @@ GEN12LPTEST_F(Gen12LpCoherencyRequirements, givenCoherencyRequirementWithoutShar flushTask(false); findCmd(false, false, false); // not changed - flushTask(true); - findCmd(true, true, false); // changed - - flushTask(true); - findCmd(false, true, false); // not changed - - flushTask(false); - findCmd(true, false, false); // changed - - flushTask(false); - findCmd(false, false, false); // not changed csr->getMemoryManager()->freeGraphicsMemory(graphicAlloc); } @@ -286,8 +275,7 @@ GEN12LPTEST_F(Gen12LpCoherencyRequirements, givenCoherencyRequirementWithSharedH HardwareParse hwParser; hwParser.parseCommands(csr->commandStream, startOffset); bool foundOne = false; - - STATE_COMPUTE_MODE::FORCE_NON_COHERENT expectedCoherentValue = expectCoherent ? STATE_COMPUTE_MODE::FORCE_NON_COHERENT_FORCE_DISABLED : STATE_COMPUTE_MODE::FORCE_NON_COHERENT_FORCE_GPU_NON_COHERENT; + STATE_COMPUTE_MODE::FORCE_NON_COHERENT expectedCoherentValue = STATE_COMPUTE_MODE::FORCE_NON_COHERENT_FORCE_GPU_NON_COHERENT; uint32_t expectedCoherentMask = FamilyType::stateComputeModeForceNonCoherentMask; for (auto it = hwParser.cmdList.begin(); it != hwParser.cmdList.end(); it++) { diff --git a/opencl/test/unit_test/helpers/hw_helper_tests.cpp b/opencl/test/unit_test/helpers/hw_helper_tests.cpp index 312ee428cf..c868486ce7 100644 --- a/opencl/test/unit_test/helpers/hw_helper_tests.cpp +++ b/opencl/test/unit_test/helpers/hw_helper_tests.cpp @@ -30,6 +30,8 @@ #include "opencl/test/unit_test/mocks/mock_buffer.h" #include "opencl/test/unit_test/mocks/mock_context.h" +#include "test_traits_common.h" + #include #include #include @@ -1418,4 +1420,32 @@ HWTEST2_F(HwHelperTest, givenAtsOrDg2WhenDisableL3ForDebugCalledThenTrueIsReturn HWTEST_F(HwHelperTest, givenHwHelperWhenGettingIfRevisionSpecificBinaryBuiltinIsRequiredThenFalseIsReturned) { auto &hwHelper = NEO::HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily); EXPECT_FALSE(hwHelper.isRevisionSpecificBinaryBuiltinRequired()); +} +struct CoherentWANotNeeded { + template + static constexpr bool isMatched() { + if (productFamily == IGFX_BROADWELL) + return false; + return !TestTraits::get()>::forceGpuNonCoherent; + } +}; +HWTEST2_F(HwHelperTest, givenHwInfoConfigWhenCheckingForceNonGpuCoherencyWAThenPassedValueReturned, CoherentWANotNeeded) { + const auto &hwHelper = HwHelper::get(renderCoreFamily); + EXPECT_TRUE(hwHelper.forceNonGpuCoherencyWA(true)); + EXPECT_FALSE(hwHelper.forceNonGpuCoherencyWA(false)); +} + +struct ForceNonCoherentMode { + template + static constexpr bool isMatched() { + if (productFamily == IGFX_BROADWELL) + return false; + return TestTraits::get()>::forceGpuNonCoherent; + } +}; + +HWTEST2_F(HwHelperTest, givenHwInfoConfigWhenCheckingForceNonGpuCoherencyWAThenFalseIsReturned, ForceNonCoherentMode) { + const auto &hwHelper = HwHelper::get(renderCoreFamily); + EXPECT_FALSE(hwHelper.forceNonGpuCoherencyWA(true)); + EXPECT_FALSE(hwHelper.forceNonGpuCoherencyWA(false)); } \ No newline at end of file diff --git a/shared/source/command_stream/command_stream_receiver_hw_base.inl b/shared/source/command_stream/command_stream_receiver_hw_base.inl index 7dbaee6fc2..3953c43d48 100644 --- a/shared/source/command_stream/command_stream_receiver_hw_base.inl +++ b/shared/source/command_stream/command_stream_receiver_hw_base.inl @@ -254,15 +254,16 @@ CompletionStamp CommandStreamReceiverHw::flushTask( dispatchFlags.pipelineSelectArgs.specialPipelineSelectMode, hwInfo); + auto &hwHelper = HwHelper::get(peekHwInfo().platform.eRenderCoreFamily); if (dispatchFlags.threadArbitrationPolicy == ThreadArbitrationPolicy::NotPresent) { - auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); dispatchFlags.threadArbitrationPolicy = hwHelper.getDefaultThreadArbitrationPolicy(); } if (dispatchFlags.numGrfRequired == GrfConfig::NotApplicable) { dispatchFlags.numGrfRequired = lastSentNumGrfRequired; } - this->streamProperties.stateComputeMode.setProperties(dispatchFlags.requiresCoherency, dispatchFlags.numGrfRequired, + auto requiresCoherency = hwHelper.forceNonGpuCoherencyWA(dispatchFlags.requiresCoherency); + this->streamProperties.stateComputeMode.setProperties(requiresCoherency, dispatchFlags.numGrfRequired, dispatchFlags.threadArbitrationPolicy); csrSizeRequestFlags.l3ConfigChanged = this->lastSentL3Config != newL3Config; @@ -357,7 +358,6 @@ CompletionStamp CommandStreamReceiverHw::flushTask( auto isStateBaseAddressDirty = dshDirty || iohDirty || sshDirty || stateBaseAddressDirty; auto mocsIndex = latestSentStatelessMocsConfig; - auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); if (dispatchFlags.l3CacheSettings != L3CachingSettings::NotApplicable) { auto l3On = dispatchFlags.l3CacheSettings != L3CachingSettings::l3CacheOff; diff --git a/shared/source/gen12lp/hw_helper_gen12lp.cpp b/shared/source/gen12lp/hw_helper_gen12lp.cpp index 4e8dea087c..8fb09bc5f2 100644 --- a/shared/source/gen12lp/hw_helper_gen12lp.cpp +++ b/shared/source/gen12lp/hw_helper_gen12lp.cpp @@ -186,6 +186,11 @@ void HwHelperHw::setExtraAllocationData(AllocationData &allocationData, } } +template <> +bool HwHelperHw::forceNonGpuCoherencyWA(bool requiresCoherency) const { + return false; +} + template class HwHelperHw; template class FlatBatchBufferHelperHw; template struct MemorySynchronizationCommands; diff --git a/shared/source/helpers/hw_helper.h b/shared/source/helpers/hw_helper.h index 7ce2878a78..5dcd956db2 100644 --- a/shared/source/helpers/hw_helper.h +++ b/shared/source/helpers/hw_helper.h @@ -153,6 +153,7 @@ class HwHelper { virtual void encodeBufferSurfaceState(EncodeSurfaceStateArgs &args) = 0; virtual bool disableL3CacheForDebug() const = 0; virtual bool isRevisionSpecificBinaryBuiltinRequired() const = 0; + virtual bool forceNonGpuCoherencyWA(bool requiresCoherency) const = 0; protected: HwHelper() = default; @@ -388,6 +389,7 @@ class HwHelperHw : public HwHelper { void encodeBufferSurfaceState(EncodeSurfaceStateArgs &args) override; bool disableL3CacheForDebug() const override; bool isRevisionSpecificBinaryBuiltinRequired() const override; + bool forceNonGpuCoherencyWA(bool requiresCoherency) const override; protected: static const AuxTranslationMode defaultAuxTranslationMode; diff --git a/shared/source/helpers/hw_helper_base.inl b/shared/source/helpers/hw_helper_base.inl index 898d7cfbb9..cdbda53666 100644 --- a/shared/source/helpers/hw_helper_base.inl +++ b/shared/source/helpers/hw_helper_base.inl @@ -705,9 +705,12 @@ template bool HwHelperHw::disableL3CacheForDebug() const { return false; } - template bool HwHelperHw::isRevisionSpecificBinaryBuiltinRequired() const { return false; } +template +bool HwHelperHw::forceNonGpuCoherencyWA(bool requiresCoherency) const { + return requiresCoherency; +} } // namespace NEO diff --git a/shared/test/common/gen11/test_traits_gen11.h b/shared/test/common/gen11/test_traits_gen11.h index c6419dac41..cb0edf9b20 100644 --- a/shared/test/common/gen11/test_traits_gen11.h +++ b/shared/test/common/gen11/test_traits_gen11.h @@ -17,4 +17,5 @@ struct TestTraits { static constexpr bool isUsingNonDefaultIoctls = false; static constexpr bool deviceEnqueueSupport = true; static constexpr bool implementsPreambleThreadArbitration = true; + static constexpr bool forceGpuNonCoherent = false; }; diff --git a/shared/test/common/gen12lp/test_traits_gen12lp.h b/shared/test/common/gen12lp/test_traits_gen12lp.h index 2ac92fce03..2f03cca082 100644 --- a/shared/test/common/gen12lp/test_traits_gen12lp.h +++ b/shared/test/common/gen12lp/test_traits_gen12lp.h @@ -11,10 +11,11 @@ template <> struct TestTraits { static constexpr bool auxBuiltinsSupported = true; - static constexpr bool programOnlyChangedFieldsInComputeStateMode = true; + static constexpr bool programOnlyChangedFieldsInComputeStateMode = false; static constexpr bool iohInSbaSupported = true; static constexpr bool auxTranslationSupported = true; static constexpr bool isUsingNonDefaultIoctls = false; static constexpr bool deviceEnqueueSupport = false; static constexpr bool implementsPreambleThreadArbitration = false; + static constexpr bool forceGpuNonCoherent = true; }; diff --git a/shared/test/common/gen8/test_traits_gen8.h b/shared/test/common/gen8/test_traits_gen8.h index 760cd645c5..5d61fe60fa 100644 --- a/shared/test/common/gen8/test_traits_gen8.h +++ b/shared/test/common/gen8/test_traits_gen8.h @@ -16,4 +16,5 @@ struct TestTraits { static constexpr bool isUsingNonDefaultIoctls = false; static constexpr bool deviceEnqueueSupport = false; static constexpr bool implementsPreambleThreadArbitration = false; + static constexpr bool forceGpuNonCoherent = false; }; diff --git a/shared/test/common/gen9/test_traits_gen9.h b/shared/test/common/gen9/test_traits_gen9.h index 8cf6f6bf2b..d39a8e3518 100644 --- a/shared/test/common/gen9/test_traits_gen9.h +++ b/shared/test/common/gen9/test_traits_gen9.h @@ -16,4 +16,5 @@ struct TestTraits { static constexpr bool isUsingNonDefaultIoctls = false; static constexpr bool deviceEnqueueSupport = true; static constexpr bool implementsPreambleThreadArbitration = true; + static constexpr bool forceGpuNonCoherent = false; }; diff --git a/shared/test/common/helpers/CMakeLists.txt b/shared/test/common/helpers/CMakeLists.txt index 33c5986876..7563780458 100644 --- a/shared/test/common/helpers/CMakeLists.txt +++ b/shared/test/common/helpers/CMakeLists.txt @@ -31,7 +31,9 @@ set(NEO_CORE_HELPERS_TESTS ${CMAKE_CURRENT_SOURCE_DIR}/string_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/string_to_hash_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test_traits.h + ${CMAKE_CURRENT_SOURCE_DIR}/test_traits_platforms.h ${CMAKE_CURRENT_SOURCE_DIR}/includes${BRANCH_DIR_SUFFIX}test_traits_common.h + ${CMAKE_CURRENT_SOURCE_DIR}/includes${BRANCH_DIR_SUFFIX}test_traits_platforms_common.h ${CMAKE_CURRENT_SOURCE_DIR}/ult_hw_config.h ${CMAKE_CURRENT_SOURCE_DIR}/ult_hw_config.inl ${CMAKE_CURRENT_SOURCE_DIR}/ult_hw_helper.h diff --git a/shared/test/common/helpers/includes/test_traits_platforms_common.h b/shared/test/common/helpers/includes/test_traits_platforms_common.h new file mode 100644 index 0000000000..09a5f26a9d --- /dev/null +++ b/shared/test/common/helpers/includes/test_traits_platforms_common.h @@ -0,0 +1,11 @@ +/* + * Copyright (C) 2021 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#pragma once +#ifdef TESTS_DG2 +#include "shared/test/common/xe_hpg_core/dg2/test_traits_dg2.h" +#endif \ No newline at end of file diff --git a/shared/test/common/helpers/test_traits_platforms.h b/shared/test/common/helpers/test_traits_platforms.h new file mode 100644 index 0000000000..dc9fbbf29c --- /dev/null +++ b/shared/test/common/helpers/test_traits_platforms.h @@ -0,0 +1,13 @@ +/* + * Copyright (C) 2021 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#pragma once + +#include "igfxfmid.h" + +template +struct TestTraitsPlatforms; diff --git a/shared/test/common/xe_hp_core/test_traits_xe_hp_core.h b/shared/test/common/xe_hp_core/test_traits_xe_hp_core.h index 462bc6df60..e4b38c66e0 100644 --- a/shared/test/common/xe_hp_core/test_traits_xe_hp_core.h +++ b/shared/test/common/xe_hp_core/test_traits_xe_hp_core.h @@ -25,4 +25,5 @@ struct TestTraits { static constexpr bool deviceEnqueueSupport = false; static constexpr bool fusedEuDispatchSupported = true; static constexpr bool numberOfWalkersInCfeStateSupported = true; + static constexpr bool forceGpuNonCoherent = false; }; diff --git a/shared/test/common/xe_hpc_core/test_traits_xe_hpc_core.h b/shared/test/common/xe_hpc_core/test_traits_xe_hpc_core.h index db236bfae8..8a1a4ac6e5 100644 --- a/shared/test/common/xe_hpc_core/test_traits_xe_hpc_core.h +++ b/shared/test/common/xe_hpc_core/test_traits_xe_hpc_core.h @@ -25,4 +25,5 @@ struct TestTraits { static constexpr bool fusedEuDispatchSupported = true; static constexpr bool numberOfWalkersInCfeStateSupported = true; static constexpr bool isUsingNonDefaultIoctls = true; + static constexpr bool forceGpuNonCoherent = false; }; diff --git a/shared/test/common/xe_hpg_core/dg2/CMakeLists.txt b/shared/test/common/xe_hpg_core/dg2/CMakeLists.txt index d762a4ff01..ffb445d7b8 100644 --- a/shared/test/common/xe_hpg_core/dg2/CMakeLists.txt +++ b/shared/test/common/xe_hpg_core/dg2/CMakeLists.txt @@ -17,6 +17,7 @@ if(TESTS_DG2) ${CMAKE_CURRENT_SOURCE_DIR}/test_hw_info_config_dg2.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test_hw_helper_dg2.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test_encode_dg2.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test_traits_dg2.h ) target_sources(${TARGET_NAME} PRIVATE ${NEO_CORE_TESTS_XE_HPG_CORE_DG2}) diff --git a/shared/test/common/xe_hpg_core/dg2/test_traits_dg2.h b/shared/test/common/xe_hpg_core/dg2/test_traits_dg2.h new file mode 100644 index 0000000000..4684700b6c --- /dev/null +++ b/shared/test/common/xe_hpg_core/dg2/test_traits_dg2.h @@ -0,0 +1,14 @@ +/* + * Copyright (C) 2021 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#pragma once +#include "shared/test/common/helpers/test_traits_platforms.h" + +template <> +struct TestTraitsPlatforms { + static constexpr bool programOnlyChangedFieldsInComputeStateMode = false; +}; diff --git a/shared/test/common/xe_hpg_core/test_traits_xe_hpg_core.h b/shared/test/common/xe_hpg_core/test_traits_xe_hpg_core.h index e67bafd38c..cdc2e3cf89 100644 --- a/shared/test/common/xe_hpg_core/test_traits_xe_hpg_core.h +++ b/shared/test/common/xe_hpg_core/test_traits_xe_hpg_core.h @@ -18,11 +18,12 @@ struct TestTraits { static constexpr bool l3ControlSupported = true; static constexpr bool forceNonCoherentSupported = true; static constexpr bool threadPreemptionDisableBitMatcher = true; - static constexpr bool programOnlyChangedFieldsInComputeStateMode = true; + static constexpr bool programOnlyChangedFieldsInComputeStateMode = false; static constexpr bool iohInSbaSupported = false; static constexpr bool auxTranslationSupported = true; static constexpr bool deviceEnqueueSupport = false; static constexpr bool isUsingNonDefaultIoctls = true; static constexpr bool fusedEuDispatchSupported = true; static constexpr bool numberOfWalkersInCfeStateSupported = true; + static constexpr bool forceGpuNonCoherent = false; };