From 2c853adac348456730d374bba2022fcabd02c938 Mon Sep 17 00:00:00 2001 From: Bartosz Dunajski Date: Thu, 23 Jun 2022 15:25:10 +0000 Subject: [PATCH] Use LogicalStateHelper to program ComputeMode Signed-off-by: Bartosz Dunajski --- level_zero/core/source/cmdlist/cmdlist_hw.h | 6 ++- level_zero/core/source/cmdlist/cmdlist_hw.inl | 11 ++++-- level_zero/core/source/gen11/cmdlist_gen11.h | 1 + .../core/source/gen12lp/cmdlist_gen12lp.h | 1 + level_zero/core/source/gen9/cmdlist_gen9.h | 1 + .../source/xe_hp_core/cmdlist_xe_hp_core.h | 1 + .../source/xe_hpc_core/cmdlist_xe_hpc_core.h | 1 + .../source/xe_hpg_core/cmdlist_xe_hpg_core.h | 1 + .../core/test/unit_tests/mocks/mock_cmdlist.h | 1 + ...and_stream_receiver_flush_task_1_tests.cpp | 6 +-- ...and_stream_receiver_flush_task_2_tests.cpp | 2 +- ...stream_receiver_hw_tests_dg2_and_later.cpp | 2 +- .../ult_command_stream_receiver_fixture.h | 2 +- .../unit_test/helpers/hw_helper_tests.cpp | 6 +++ .../command_container/command_encoder.h | 5 ++- .../command_encoder_xehp_and_later.inl | 2 +- .../encode_compute_mode_bdw_and_later.inl | 4 +- .../encode_compute_mode_tgllp_and_later.inl | 5 ++- .../command_stream_receiver_hw_base.inl | 4 +- .../definitions/stream_properties.inl | 3 +- .../command_stream/stream_properties.cpp | 12 ++++-- shared/source/gen11/command_encoder_gen11.cpp | 2 +- .../gen12lp/command_encoder_gen12lp.cpp | 2 +- shared/source/gen8/command_encoder_gen8.cpp | 2 +- shared/source/gen9/command_encoder_gen9.cpp | 2 +- shared/source/helpers/hw_helper.h | 2 + shared/source/helpers/hw_helper_base.inl | 5 +++ .../command_encoder_xe_hpc_core.cpp | 2 +- .../command_encoder_xe_hpg_core.cpp | 2 +- .../test/common/gen11/test_preamble_gen11.cpp | 2 +- .../gen12lp/test_command_encoder_gen12lp.cpp | 4 +- .../common/gen12lp/test_encode_gen12lp.cpp | 4 +- .../test/common/gen8/test_preamble_gen8.cpp | 2 +- .../test/common/gen9/preamble_tests_gen9.cpp | 2 +- .../xe_hp_core/test_encode_xe_hp_core.cpp | 12 +++--- .../xe_hpg_core/dg2/test_encode_dg2.cpp | 4 +- .../stream_properties_tests_common.cpp | 37 +++++++++++++------ ...t_encode_dispatch_kernel_pvc_and_later.cpp | 4 +- ..._encode_dispatch_kernel_xehp_and_later.cpp | 6 +-- .../test_encode_grf_mode_xe_hp_and_later.cpp | 16 ++++---- .../unit_test/encoders/test_encode_states.cpp | 6 +-- .../compute_mode_tests_xe_hpc_core.cpp | 2 +- .../xe_hpc_core/test_encode_xe_hpc_core.cpp | 22 +++++------ .../compute_mode_tests_xe_hpg_core.cpp | 4 +- 44 files changed, 136 insertions(+), 87 deletions(-) diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.h b/level_zero/core/source/cmdlist/cmdlist_hw.h index a36e0fd165..d173589fca 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.h +++ b/level_zero/core/source/cmdlist/cmdlist_hw.h @@ -16,9 +16,12 @@ #include "igfxfmid.h" +#include + namespace NEO { enum class ImageType; -} +class LogicalStateHelper; +} // namespace NEO namespace L0 { #pragma pack(1) @@ -251,6 +254,7 @@ struct CommandListCoreFamily : CommandListImp { ze_result_t addEventsToCmdList(uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents); void addFlushRequiredCommand(bool flushOperationRequired, Event *signalEvent); + std::unique_ptr logicalStateHelper; size_t cmdListCurrentStartOffset = 0; bool containsAnyKernel = false; }; diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.inl b/level_zero/core/source/cmdlist/cmdlist_hw.inl index f49511fcbd..2ece08f7ab 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw.inl @@ -16,6 +16,7 @@ #include "shared/source/helpers/heap_helper.h" #include "shared/source/helpers/hw_helper.h" #include "shared/source/helpers/hw_info.h" +#include "shared/source/helpers/logical_state_helper.h" #include "shared/source/helpers/pipe_control_args.h" #include "shared/source/helpers/preamble.h" #include "shared/source/helpers/register_offsets.h" @@ -142,6 +143,8 @@ ze_result_t CommandListCoreFamily::initialize(Device *device, NEO } } + this->logicalStateHelper.reset(NEO::LogicalStateHelper::create(true)); + return returnType; } @@ -2280,7 +2283,7 @@ void CommandListCoreFamily::updateStreamProperties(Kernel &kernel if (!containsAnyKernel) { requiredStreamState.frontEndState.setProperties(isCooperative, kernelAttributes.flags.requiresDisabledEUFusion, disableOverdispatch, -1, hwInfo); finalStreamState = requiredStreamState; - requiredStreamState.stateComputeMode.setProperties(false, kernelAttributes.numGrfRequired, kernel.getSchedulingHintExp(), hwInfo); + requiredStreamState.stateComputeMode.setProperties(false, kernelAttributes.numGrfRequired, kernel.getSchedulingHintExp(), device->getDevicePreemptionMode(), hwInfo); containsAnyKernel = true; } @@ -2293,12 +2296,12 @@ void CommandListCoreFamily::updateStreamProperties(Kernel &kernel commandsToPatch.push_back({pVfeStateAddress, pVfeState, CommandToPatch::FrontEndState}); } - finalStreamState.stateComputeMode.setProperties(false, kernelAttributes.numGrfRequired, kernel.getSchedulingHintExp(), hwInfo); + finalStreamState.stateComputeMode.setProperties(false, kernelAttributes.numGrfRequired, kernel.getSchedulingHintExp(), device->getDevicePreemptionMode(), hwInfo); - if (finalStreamState.stateComputeMode.isDirty()) { + if (finalStreamState.stateComputeMode.isDirty() && !logicalStateHelper) { bool isRcs = (this->engineGroupType == NEO::EngineGroupType::RenderCompute); NEO::EncodeComputeMode::programComputeModeCommandWithSynchronization( - *commandContainer.getCommandStream(), finalStreamState.stateComputeMode, {}, false, hwInfo, isRcs); + *commandContainer.getCommandStream(), finalStreamState.stateComputeMode, {}, false, hwInfo, isRcs, nullptr); } } diff --git a/level_zero/core/source/gen11/cmdlist_gen11.h b/level_zero/core/source/gen11/cmdlist_gen11.h index c8dbf7bf12..d189df141a 100644 --- a/level_zero/core/source/gen11/cmdlist_gen11.h +++ b/level_zero/core/source/gen11/cmdlist_gen11.h @@ -7,6 +7,7 @@ #pragma once #include "shared/source/gen11/hw_cmds_base.h" +#include "shared/source/helpers/logical_state_helper.h" #include "level_zero/core/source/cmdlist/cmdlist_hw.h" #include "level_zero/core/source/cmdlist/cmdlist_hw_immediate.h" diff --git a/level_zero/core/source/gen12lp/cmdlist_gen12lp.h b/level_zero/core/source/gen12lp/cmdlist_gen12lp.h index 08ec54ca44..f06b03deb4 100644 --- a/level_zero/core/source/gen12lp/cmdlist_gen12lp.h +++ b/level_zero/core/source/gen12lp/cmdlist_gen12lp.h @@ -7,6 +7,7 @@ #pragma once #include "shared/source/gen12lp/hw_cmds_base.h" +#include "shared/source/helpers/logical_state_helper.h" #include "level_zero/core/source/cmdlist/cmdlist_hw.h" #include "level_zero/core/source/cmdlist/cmdlist_hw_immediate.h" diff --git a/level_zero/core/source/gen9/cmdlist_gen9.h b/level_zero/core/source/gen9/cmdlist_gen9.h index e98e48577a..0966fa8796 100644 --- a/level_zero/core/source/gen9/cmdlist_gen9.h +++ b/level_zero/core/source/gen9/cmdlist_gen9.h @@ -9,6 +9,7 @@ #include "shared/source/gen9/hw_cmds.h" #include "shared/source/gen9/hw_info.h" +#include "shared/source/helpers/logical_state_helper.h" #include "level_zero/core/source/cmdlist/cmdlist_hw.h" #include "level_zero/core/source/cmdlist/cmdlist_hw_immediate.h" diff --git a/level_zero/core/source/xe_hp_core/cmdlist_xe_hp_core.h b/level_zero/core/source/xe_hp_core/cmdlist_xe_hp_core.h index 21d12e5826..36f37b599e 100644 --- a/level_zero/core/source/xe_hp_core/cmdlist_xe_hp_core.h +++ b/level_zero/core/source/xe_hp_core/cmdlist_xe_hp_core.h @@ -6,6 +6,7 @@ */ #pragma once +#include "shared/source/helpers/logical_state_helper.h" #include "shared/source/xe_hp_core/hw_cmds_base.h" #include "level_zero/core/source/cmdlist/cmdlist_hw.h" diff --git a/level_zero/core/source/xe_hpc_core/cmdlist_xe_hpc_core.h b/level_zero/core/source/xe_hpc_core/cmdlist_xe_hpc_core.h index 1a3936c63f..624c9c9fd5 100644 --- a/level_zero/core/source/xe_hpc_core/cmdlist_xe_hpc_core.h +++ b/level_zero/core/source/xe_hpc_core/cmdlist_xe_hpc_core.h @@ -6,6 +6,7 @@ */ #pragma once +#include "shared/source/helpers/logical_state_helper.h" #include "shared/source/xe_hpc_core/hw_cmds_base.h" #include "level_zero/core/source/cmdlist/cmdlist_hw.h" diff --git a/level_zero/core/source/xe_hpg_core/cmdlist_xe_hpg_core.h b/level_zero/core/source/xe_hpg_core/cmdlist_xe_hpg_core.h index d336e2b04b..f0a2b04713 100644 --- a/level_zero/core/source/xe_hpg_core/cmdlist_xe_hpg_core.h +++ b/level_zero/core/source/xe_hpg_core/cmdlist_xe_hpg_core.h @@ -7,6 +7,7 @@ #pragma once +#include "shared/source/helpers/logical_state_helper.h" #include "shared/source/xe_hpg_core/hw_cmds_base.h" #include "level_zero/core/source/cmdlist/cmdlist_hw.h" 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 b68ca51620..e392c58820 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_cmdlist.h +++ b/level_zero/core/test/unit_tests/mocks/mock_cmdlist.h @@ -6,6 +6,7 @@ */ #pragma once +#include "shared/source/helpers/logical_state_helper.h" #include "shared/test/common/test_macros/mock_method_macros.h" #include "level_zero/core/source/cmdlist/cmdlist_hw.h" diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_1_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_1_tests.cpp index 157a584700..219902a1a7 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_1_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_1_tests.cpp @@ -876,7 +876,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenEnoughMemoryOnlyForPreambleWh csrCS.getSpace(csrCS.getAvailableSpace() - sizeNeededForPreamble); commandStreamReceiver.streamProperties.stateComputeMode.setProperties(flushTaskFlags.requiresCoherency, flushTaskFlags.numGrfRequired, - flushTaskFlags.threadArbitrationPolicy, *defaultHwInfo); + flushTaskFlags.threadArbitrationPolicy, PreemptionMode::Disabled, *defaultHwInfo); flushTask(commandStreamReceiver); EXPECT_EQ(sizeNeeded, csrCS.getUsed()); @@ -910,7 +910,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenEnoughMemoryOnlyForPreambleAn csrCS.getSpace(csrCS.getAvailableSpace() - sizeNeededForPreamble - sizeNeededForStateBaseAddress); commandStreamReceiver.streamProperties.stateComputeMode.setProperties(flushTaskFlags.requiresCoherency, flushTaskFlags.numGrfRequired, - flushTaskFlags.threadArbitrationPolicy, *defaultHwInfo); + flushTaskFlags.threadArbitrationPolicy, PreemptionMode::Disabled, *defaultHwInfo); flushTask(commandStreamReceiver); EXPECT_EQ(sizeNeeded, csrCS.getUsed()); @@ -948,7 +948,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenEnoughMemoryOnlyForPreambleAn flushTaskFlags.preemptionMode = PreemptionHelper::getDefaultPreemptionMode(mockDevice->getHardwareInfo()); commandStreamReceiver.streamProperties.stateComputeMode.setProperties(flushTaskFlags.requiresCoherency, flushTaskFlags.numGrfRequired, - flushTaskFlags.threadArbitrationPolicy, *defaultHwInfo); + flushTaskFlags.threadArbitrationPolicy, PreemptionMode::Disabled, *defaultHwInfo); commandStreamReceiver.flushTask( commandStream, 0, diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp index 7c3fe2518e..c1ff8702ea 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp @@ -1016,7 +1016,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, GivenPreambleSe expectedUsed = alignUp(expectedUsed, MemoryConstants::cacheLineSize); commandStreamReceiver.streamProperties.stateComputeMode.setProperties(flushTaskFlags.requiresCoherency, flushTaskFlags.numGrfRequired, - flushTaskFlags.threadArbitrationPolicy, *defaultHwInfo); + flushTaskFlags.threadArbitrationPolicy, PreemptionMode::Disabled, *defaultHwInfo); commandStreamReceiver.flushTask(commandStream, 0, &dsh, &ioh, &ssh, taskLevel, flushTaskFlags, *pDevice); // Verify that we didn't grab a new CS buffer diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests_dg2_and_later.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests_dg2_and_later.cpp index ef7ebf68f6..40a539b586 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests_dg2_and_later.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests_dg2_and_later.cpp @@ -96,7 +96,7 @@ HWTEST2_F(CommandStreamReceiverFlushTaskDg2AndLaterTests, givenProgramExtendedPi dispatchFlags.threadArbitrationPolicy = hwHelper.getDefaultThreadArbitrationPolicy(); commandStreamReceiver.streamProperties.stateComputeMode.setProperties(dispatchFlags.requiresCoherency, dispatchFlags.numGrfRequired, - dispatchFlags.threadArbitrationPolicy, *defaultHwInfo); + dispatchFlags.threadArbitrationPolicy, PreemptionMode::Disabled, *defaultHwInfo); auto cmdSizeForAllCommands = commandStreamReceiver.getRequiredCmdStreamSize(dispatchFlags, *pDevice); commandStreamReceiver.flushTask(commandStream, 0, diff --git a/opencl/test/unit_test/fixtures/ult_command_stream_receiver_fixture.h b/opencl/test/unit_test/fixtures/ult_command_stream_receiver_fixture.h index 085952c3c2..9d06ae0d2b 100644 --- a/opencl/test/unit_test/fixtures/ult_command_stream_receiver_fixture.h +++ b/opencl/test/unit_test/fixtures/ult_command_stream_receiver_fixture.h @@ -151,7 +151,7 @@ struct UltCommandStreamReceiverTest commandStreamReceiver.lastMediaSamplerConfig = 0; commandStreamReceiver.lastSentUseGlobalAtomics = false; commandStreamReceiver.streamProperties.stateComputeMode.setProperties(0, GrfConfig::DefaultGrfNumber, - hwHelper.getDefaultThreadArbitrationPolicy(), *defaultHwInfo); + hwHelper.getDefaultThreadArbitrationPolicy(), pDevice->getPreemptionMode(), *defaultHwInfo); } template diff --git a/opencl/test/unit_test/helpers/hw_helper_tests.cpp b/opencl/test/unit_test/helpers/hw_helper_tests.cpp index f713a6f042..25212683eb 100644 --- a/opencl/test/unit_test/helpers/hw_helper_tests.cpp +++ b/opencl/test/unit_test/helpers/hw_helper_tests.cpp @@ -84,6 +84,12 @@ HWTEST_F(HwHelperTest, givenHwHelperWhenAskingForTimestampPacketAlignmentThenRet EXPECT_EQ(expectedAlignment, helper.getTimestampPacketAllocatorAlignment()); } +HWTEST_F(HwHelperTest, givenHwHelperWhenAskingForDevicePreemptionSupportInScmThenReturnFalse) { + auto &helper = HwHelper::get(renderCoreFamily); + + EXPECT_FALSE(helper.isDevicePreemptionModeTrackedInScm()); +} + HWTEST2_F(HwHelperTest, givenHwHelperWhenGettingISAPaddingThenCorrectValueIsReturned, IsAtMostXeHpgCore) { auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily); EXPECT_EQ(hwHelper.getPaddingForISAAllocation(), 512u); diff --git a/shared/source/command_container/command_encoder.h b/shared/source/command_container/command_encoder.h index 006fc0ae80..03a2b3ccc5 100644 --- a/shared/source/command_container/command_encoder.h +++ b/shared/source/command_container/command_encoder.h @@ -29,6 +29,7 @@ class BindlessHeapsHelper; class GmmHelper; class LogicalStateHelper; class IndirectHeap; +class LogicalStateHelper; class Gmm; struct HardwareInfo; struct StateComputeModeProperties; @@ -307,8 +308,8 @@ struct EncodeComputeMode { static size_t getCmdSizeForComputeMode(const HardwareInfo &hwInfo, bool hasSharedHandles, bool isRcs); static void programComputeModeCommandWithSynchronization(LinearStream &csr, StateComputeModeProperties &properties, const PipelineSelectArgs &args, bool hasSharedHandles, - const HardwareInfo &hwInfo, bool isRcs); - static void programComputeModeCommand(LinearStream &csr, StateComputeModeProperties &properties, const HardwareInfo &hwInfo); + const HardwareInfo &hwInfo, bool isRcs, LogicalStateHelper *logicalStateHelper); + static void programComputeModeCommand(LinearStream &csr, StateComputeModeProperties &properties, const HardwareInfo &hwInfo, LogicalStateHelper *logicalStateHelper); static void adjustPipelineSelect(CommandContainer &container, const NEO::KernelDescriptor &kernelDescriptor); }; diff --git a/shared/source/command_container/command_encoder_xehp_and_later.inl b/shared/source/command_container/command_encoder_xehp_and_later.inl index 2a8efc7941..e1cc3dbc15 100644 --- a/shared/source/command_container/command_encoder_xehp_and_later.inl +++ b/shared/source/command_container/command_encoder_xehp_and_later.inl @@ -532,7 +532,7 @@ size_t EncodeStateBaseAddress::getRequiredSizeForStateBaseAddress(Device } template -void EncodeComputeMode::programComputeModeCommand(LinearStream &csr, StateComputeModeProperties &properties, const HardwareInfo &hwInfo) { +void EncodeComputeMode::programComputeModeCommand(LinearStream &csr, StateComputeModeProperties &properties, const HardwareInfo &hwInfo, LogicalStateHelper *logicalStateHelper) { using STATE_COMPUTE_MODE = typename Family::STATE_COMPUTE_MODE; using FORCE_NON_COHERENT = typename STATE_COMPUTE_MODE::FORCE_NON_COHERENT; diff --git a/shared/source/command_container/encode_compute_mode_bdw_and_later.inl b/shared/source/command_container/encode_compute_mode_bdw_and_later.inl index d83a624447..f9be92d498 100644 --- a/shared/source/command_container/encode_compute_mode_bdw_and_later.inl +++ b/shared/source/command_container/encode_compute_mode_bdw_and_later.inl @@ -14,9 +14,9 @@ namespace NEO { template inline void EncodeComputeMode::programComputeModeCommandWithSynchronization( LinearStream &csr, StateComputeModeProperties &properties, const PipelineSelectArgs &args, - bool hasSharedHandles, const HardwareInfo &hwInfo, bool isRcs) { + bool hasSharedHandles, const HardwareInfo &hwInfo, bool isRcs, LogicalStateHelper *logicalStateHelper) { - EncodeComputeMode::programComputeModeCommand(csr, properties, hwInfo); + EncodeComputeMode::programComputeModeCommand(csr, properties, hwInfo, nullptr); } template diff --git a/shared/source/command_container/encode_compute_mode_tgllp_and_later.inl b/shared/source/command_container/encode_compute_mode_tgllp_and_later.inl index 4f6945eec4..fbdf8e0a24 100644 --- a/shared/source/command_container/encode_compute_mode_tgllp_and_later.inl +++ b/shared/source/command_container/encode_compute_mode_tgllp_and_later.inl @@ -8,6 +8,7 @@ #pragma once #include "shared/source/command_container/command_encoder.h" #include "shared/source/command_stream/linear_stream.h" +#include "shared/source/helpers/logical_state_helper.h" namespace NEO { @@ -34,7 +35,7 @@ size_t EncodeComputeMode::getCmdSizeForComputeMode(const HardwareInfo &h template inline void EncodeComputeMode::programComputeModeCommandWithSynchronization( LinearStream &csr, StateComputeModeProperties &properties, const PipelineSelectArgs &args, - bool hasSharedHandles, const HardwareInfo &hwInfo, bool isRcs) { + bool hasSharedHandles, const HardwareInfo &hwInfo, bool isRcs, LogicalStateHelper *logicalStateHelper) { using PIPE_CONTROL = typename Family::PIPE_CONTROL; @@ -50,7 +51,7 @@ inline void EncodeComputeMode::programComputeModeCommandWithSynchronizat NEO::EncodeWA::addPipeControlPriorToNonPipelinedStateCommand(csr, args, hwInfo, isRcs); } - EncodeComputeMode::programComputeModeCommand(csr, properties, hwInfo); + EncodeComputeMode::programComputeModeCommand(csr, properties, hwInfo, logicalStateHelper); if (hasSharedHandles) { MemorySynchronizationCommands::addPipeControlWithCSStallOnly(csr); 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 d2b0d74824..7b3869d30f 100644 --- a/shared/source/command_stream/command_stream_receiver_hw_base.inl +++ b/shared/source/command_stream/command_stream_receiver_hw_base.inl @@ -267,7 +267,7 @@ CompletionStamp CommandStreamReceiverHw::flushTask( auto requiresCoherency = hwHelper.forceNonGpuCoherencyWA(dispatchFlags.requiresCoherency); this->streamProperties.stateComputeMode.setProperties(requiresCoherency, dispatchFlags.numGrfRequired, - dispatchFlags.threadArbitrationPolicy, hwInfo); + dispatchFlags.threadArbitrationPolicy, device.getPreemptionMode(), hwInfo); csrSizeRequestFlags.l3ConfigChanged = this->lastSentL3Config != newL3Config; csrSizeRequestFlags.preemptionRequestChanged = this->lastPreemptionMode != dispatchFlags.preemptionMode; @@ -665,7 +665,7 @@ void CommandStreamReceiverHw::programComputeMode(LinearStream &stream if (this->streamProperties.stateComputeMode.isDirty()) { EncodeComputeMode::programComputeModeCommandWithSynchronization( stream, this->streamProperties.stateComputeMode, dispatchFlags.pipelineSelectArgs, - hasSharedHandles(), hwInfo, isRcs()); + hasSharedHandles(), hwInfo, isRcs(), logicalStateHelper.get()); } } diff --git a/shared/source/command_stream/definitions/stream_properties.inl b/shared/source/command_stream/definitions/stream_properties.inl index 0851f20415..6d59b9d3cb 100644 --- a/shared/source/command_stream/definitions/stream_properties.inl +++ b/shared/source/command_stream/definitions/stream_properties.inl @@ -15,8 +15,9 @@ struct StateComputeModeProperties { StreamProperty zPassAsyncComputeThreadLimit{}; StreamProperty pixelAsyncComputeThreadLimit{}; StreamProperty threadArbitrationPolicy{}; + StreamProperty devicePreemptionMode{}; - void setProperties(bool requiresCoherency, uint32_t numGrfRequired, int32_t threadArbitrationPolicy, const HardwareInfo &hwInfo); + void setProperties(bool requiresCoherency, uint32_t numGrfRequired, int32_t threadArbitrationPolicy, PreemptionMode devicePreemptionMode, const HardwareInfo &hwInfo); void setProperties(const StateComputeModeProperties &properties); bool isDirty() const; diff --git a/shared/source/command_stream/stream_properties.cpp b/shared/source/command_stream/stream_properties.cpp index e8140ba4c6..ebacab18bd 100644 --- a/shared/source/command_stream/stream_properties.cpp +++ b/shared/source/command_stream/stream_properties.cpp @@ -14,9 +14,10 @@ using namespace NEO; -void StateComputeModeProperties::setProperties(bool requiresCoherency, uint32_t numGrfRequired, int32_t threadArbitrationPolicy, +void StateComputeModeProperties::setProperties(bool requiresCoherency, uint32_t numGrfRequired, int32_t threadArbitrationPolicy, PreemptionMode devicePreemptionMode, const HardwareInfo &hwInfo) { auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); + auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); clearIsDirty(); @@ -45,7 +46,6 @@ void StateComputeModeProperties::setProperties(bool requiresCoherency, uint32_t (NEO::DebugManager.flags.ForceDefaultThreadArbitrationPolicyIfNotSpecified.get() || (this->threadArbitrationPolicy.value == ThreadArbitrationPolicy::NotPresent)); if (setDefaultThreadArbitrationPolicy) { - auto &hwHelper = NEO::HwHelper::get(hwInfo.platform.eRenderCoreFamily); threadArbitrationPolicy = hwHelper.getDefaultThreadArbitrationPolicy(); } if (DebugManager.flags.OverrideThreadArbitrationPolicy.get() != -1) { @@ -56,6 +56,10 @@ void StateComputeModeProperties::setProperties(bool requiresCoherency, uint32_t this->threadArbitrationPolicy.set(threadArbitrationPolicy); } + if (hwHelper.isDevicePreemptionModeTrackedInScm()) { + this->devicePreemptionMode.set(static_cast(devicePreemptionMode)); + } + setPropertiesExtra(reportNumGrf, reportThreadArbitrationPolicy); } @@ -67,13 +71,14 @@ void StateComputeModeProperties::setProperties(const StateComputeModeProperties zPassAsyncComputeThreadLimit.set(properties.zPassAsyncComputeThreadLimit.value); pixelAsyncComputeThreadLimit.set(properties.pixelAsyncComputeThreadLimit.value); threadArbitrationPolicy.set(properties.threadArbitrationPolicy.value); + devicePreemptionMode.set(properties.devicePreemptionMode.value); setPropertiesExtra(properties); } bool StateComputeModeProperties::isDirty() const { return isCoherencyRequired.isDirty || largeGrfMode.isDirty || zPassAsyncComputeThreadLimit.isDirty || - pixelAsyncComputeThreadLimit.isDirty || threadArbitrationPolicy.isDirty || isDirtyExtra(); + pixelAsyncComputeThreadLimit.isDirty || threadArbitrationPolicy.isDirty || devicePreemptionMode.isDirty || isDirtyExtra(); } void StateComputeModeProperties::clearIsDirty() { @@ -82,6 +87,7 @@ void StateComputeModeProperties::clearIsDirty() { zPassAsyncComputeThreadLimit.isDirty = false; pixelAsyncComputeThreadLimit.isDirty = false; threadArbitrationPolicy.isDirty = false; + devicePreemptionMode.isDirty = false; clearIsDirtyExtra(); } diff --git a/shared/source/gen11/command_encoder_gen11.cpp b/shared/source/gen11/command_encoder_gen11.cpp index 65665f0128..0d08ff795c 100644 --- a/shared/source/gen11/command_encoder_gen11.cpp +++ b/shared/source/gen11/command_encoder_gen11.cpp @@ -47,7 +47,7 @@ size_t EncodeComputeMode::getCmdSizeForComputeMode(const HardwareInfo &h template <> void EncodeComputeMode::programComputeModeCommand(LinearStream &csr, StateComputeModeProperties &properties, - const HardwareInfo &hwInfo) { + const HardwareInfo &hwInfo, LogicalStateHelper *logicalStateHelper) { using PIPE_CONTROL = typename Family::PIPE_CONTROL; if (properties.threadArbitrationPolicy.isDirty) { diff --git a/shared/source/gen12lp/command_encoder_gen12lp.cpp b/shared/source/gen12lp/command_encoder_gen12lp.cpp index 3bd209ef18..0025899426 100644 --- a/shared/source/gen12lp/command_encoder_gen12lp.cpp +++ b/shared/source/gen12lp/command_encoder_gen12lp.cpp @@ -34,7 +34,7 @@ size_t EncodeWA::getAdditionalPipelineSelectSize(Device &device) { } template <> -void EncodeComputeMode::programComputeModeCommand(LinearStream &csr, StateComputeModeProperties &properties, const HardwareInfo &hwInfo) { +void EncodeComputeMode::programComputeModeCommand(LinearStream &csr, StateComputeModeProperties &properties, const HardwareInfo &hwInfo, LogicalStateHelper *logicalStateHelper) { using STATE_COMPUTE_MODE = typename Family::STATE_COMPUTE_MODE; using FORCE_NON_COHERENT = typename STATE_COMPUTE_MODE::FORCE_NON_COHERENT; diff --git a/shared/source/gen8/command_encoder_gen8.cpp b/shared/source/gen8/command_encoder_gen8.cpp index 5390bacebf..ca9b0bbcd9 100644 --- a/shared/source/gen8/command_encoder_gen8.cpp +++ b/shared/source/gen8/command_encoder_gen8.cpp @@ -40,7 +40,7 @@ size_t EncodeComputeMode::getCmdSizeForComputeMode(const HardwareInfo &h template void EncodeComputeMode::programComputeModeCommand(LinearStream &csr, StateComputeModeProperties &properties, - const HardwareInfo &hwInfo) { + const HardwareInfo &hwInfo, LogicalStateHelper *logicalStateHelper) { } template <> diff --git a/shared/source/gen9/command_encoder_gen9.cpp b/shared/source/gen9/command_encoder_gen9.cpp index 7e04203add..b2f6a42d31 100644 --- a/shared/source/gen9/command_encoder_gen9.cpp +++ b/shared/source/gen9/command_encoder_gen9.cpp @@ -38,7 +38,7 @@ size_t EncodeComputeMode::getCmdSizeForComputeMode(const HardwareInfo &h template void EncodeComputeMode::programComputeModeCommand(LinearStream &csr, StateComputeModeProperties &properties, - const HardwareInfo &hwInfo) { + const HardwareInfo &hwInfo, LogicalStateHelper *logicalStateHelper) { using PIPE_CONTROL = typename Family::PIPE_CONTROL; UNRECOVERABLE_IF(properties.threadArbitrationPolicy.value == ThreadArbitrationPolicy::NotPresent); diff --git a/shared/source/helpers/hw_helper.h b/shared/source/helpers/hw_helper.h index ef4e5b5db8..4071a8ba47 100644 --- a/shared/source/helpers/hw_helper.h +++ b/shared/source/helpers/hw_helper.h @@ -159,6 +159,7 @@ class HwHelper { virtual const void *getBatchBufferEndReference() const = 0; virtual bool isPlatformFlushTaskEnabled(const NEO::HardwareInfo &hwInfo) const = 0; virtual bool isPatIndexFallbackWaRequired() const = 0; + virtual bool isDevicePreemptionModeTrackedInScm() const = 0; protected: HwHelper() = default; @@ -399,6 +400,7 @@ class HwHelperHw : public HwHelper { const void *getBatchBufferEndReference() const override; bool isPlatformFlushTaskEnabled(const NEO::HardwareInfo &hwInfo) const override; bool isPatIndexFallbackWaRequired() const override; + bool isDevicePreemptionModeTrackedInScm() 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 39269f1ac8..ed252f3639 100644 --- a/shared/source/helpers/hw_helper_base.inl +++ b/shared/source/helpers/hw_helper_base.inl @@ -729,4 +729,9 @@ template bool HwHelperHw::isPatIndexFallbackWaRequired() const { return false; } + +template +bool HwHelperHw::isDevicePreemptionModeTrackedInScm() const { + return false; +} } // namespace NEO diff --git a/shared/source/xe_hpc_core/command_encoder_xe_hpc_core.cpp b/shared/source/xe_hpc_core/command_encoder_xe_hpc_core.cpp index b71bbc4121..bcb3773494 100644 --- a/shared/source/xe_hpc_core/command_encoder_xe_hpc_core.cpp +++ b/shared/source/xe_hpc_core/command_encoder_xe_hpc_core.cpp @@ -49,7 +49,7 @@ inline void EncodeAtomic::setMiAtomicAddress(MI_ATOMIC &atomic, uint64_t } template <> -void EncodeComputeMode::programComputeModeCommand(LinearStream &csr, StateComputeModeProperties &properties, const HardwareInfo &hwInfo) { +void EncodeComputeMode::programComputeModeCommand(LinearStream &csr, StateComputeModeProperties &properties, const HardwareInfo &hwInfo, LogicalStateHelper *logicalStateHelper) { using STATE_COMPUTE_MODE = typename Family::STATE_COMPUTE_MODE; using FORCE_NON_COHERENT = typename STATE_COMPUTE_MODE::FORCE_NON_COHERENT; diff --git a/shared/source/xe_hpg_core/command_encoder_xe_hpg_core.cpp b/shared/source/xe_hpg_core/command_encoder_xe_hpg_core.cpp index 25e373e1d1..7b22934892 100644 --- a/shared/source/xe_hpg_core/command_encoder_xe_hpg_core.cpp +++ b/shared/source/xe_hpg_core/command_encoder_xe_hpg_core.cpp @@ -121,7 +121,7 @@ void EncodeDispatchKernel::encodeAdditionalWalkerFields(const HardwareIn } template <> -void EncodeComputeMode::programComputeModeCommand(LinearStream &csr, StateComputeModeProperties &properties, const HardwareInfo &hwInfo) { +void EncodeComputeMode::programComputeModeCommand(LinearStream &csr, StateComputeModeProperties &properties, const HardwareInfo &hwInfo, LogicalStateHelper *logicalStateHelper) { using STATE_COMPUTE_MODE = typename Family::STATE_COMPUTE_MODE; using FORCE_NON_COHERENT = typename STATE_COMPUTE_MODE::FORCE_NON_COHERENT; using PIXEL_ASYNC_COMPUTE_THREAD_LIMIT = typename STATE_COMPUTE_MODE::PIXEL_ASYNC_COMPUTE_THREAD_LIMIT; diff --git a/shared/test/common/gen11/test_preamble_gen11.cpp b/shared/test/common/gen11/test_preamble_gen11.cpp index 74cd28c75f..00b8a3d8b9 100644 --- a/shared/test/common/gen11/test_preamble_gen11.cpp +++ b/shared/test/common/gen11/test_preamble_gen11.cpp @@ -148,7 +148,7 @@ GEN11TEST_F(ThreadArbitrationGen11, whenThreadArbitrationPolicyIsProgrammedThenC MockDevice mockDevice; StreamProperties streamProperties{}; streamProperties.stateComputeMode.threadArbitrationPolicy.set(ThreadArbitrationPolicy::RoundRobin); - EncodeComputeMode::programComputeModeCommand(linearStream, streamProperties.stateComputeMode, *defaultHwInfo); + EncodeComputeMode::programComputeModeCommand(linearStream, streamProperties.stateComputeMode, *defaultHwInfo, nullptr); parseCommands(cs); diff --git a/shared/test/common/gen12lp/test_command_encoder_gen12lp.cpp b/shared/test/common/gen12lp/test_command_encoder_gen12lp.cpp index e749263339..447e68ebf1 100644 --- a/shared/test/common/gen12lp/test_command_encoder_gen12lp.cpp +++ b/shared/test/common/gen12lp/test_command_encoder_gen12lp.cpp @@ -32,9 +32,9 @@ GEN12LPTEST_F(CommandEncoderTest, WhenAdjustComputeModeIsCalledThenStateComputeM // Adjust the State Compute Mode which sets FORCE_NON_COHERENT_FORCE_GPU_NON_COHERENT StreamProperties properties{}; - properties.stateComputeMode.setProperties(false, GrfConfig::DefaultGrfNumber, 0, *defaultHwInfo); + properties.stateComputeMode.setProperties(false, GrfConfig::DefaultGrfNumber, 0, PreemptionMode::Disabled, *defaultHwInfo); NEO::EncodeComputeMode::programComputeModeCommand(*cmdContainer.getCommandStream(), - properties.stateComputeMode, *defaultHwInfo); + properties.stateComputeMode, *defaultHwInfo, nullptr); auto usedSpaceAfter = cmdContainer.getCommandStream()->getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); diff --git a/shared/test/common/gen12lp/test_encode_gen12lp.cpp b/shared/test/common/gen12lp/test_encode_gen12lp.cpp index 8a7f34e88e..b08e00a285 100644 --- a/shared/test/common/gen12lp/test_encode_gen12lp.cpp +++ b/shared/test/common/gen12lp/test_encode_gen12lp.cpp @@ -22,14 +22,14 @@ GEN12LPTEST_F(CommandEncodeGen12LpTest, whenProgrammingStateComputeModeThenPrope StateComputeModeProperties properties; auto pLinearStream = std::make_unique(buffer, sizeof(buffer)); - EncodeComputeMode::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo); + EncodeComputeMode::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo, nullptr); auto pScm = reinterpret_cast(pLinearStream->getCpuBase()); EXPECT_EQ(FamilyType::stateComputeModeForceNonCoherentMask, pScm->getMaskBits()); EXPECT_EQ(STATE_COMPUTE_MODE::FORCE_NON_COHERENT_FORCE_GPU_NON_COHERENT, pScm->getForceNonCoherent()); properties.isCoherencyRequired.value = 1; pLinearStream = std::make_unique(buffer, sizeof(buffer)); - EncodeComputeMode::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo); + EncodeComputeMode::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo, nullptr); pScm = reinterpret_cast(pLinearStream->getCpuBase()); EXPECT_EQ(FamilyType::stateComputeModeForceNonCoherentMask, pScm->getMaskBits()); EXPECT_EQ(STATE_COMPUTE_MODE::FORCE_NON_COHERENT_FORCE_DISABLED, pScm->getForceNonCoherent()); diff --git a/shared/test/common/gen8/test_preamble_gen8.cpp b/shared/test/common/gen8/test_preamble_gen8.cpp index 269867f283..2043a92d8e 100644 --- a/shared/test/common/gen8/test_preamble_gen8.cpp +++ b/shared/test/common/gen8/test_preamble_gen8.cpp @@ -77,7 +77,7 @@ BDWTEST_F(ThreadArbitrationGen8, givenPolicyWhenThreadArbitrationProgrammedThenD StreamProperties streamProperties{}; streamProperties.stateComputeMode.threadArbitrationPolicy.set(ThreadArbitrationPolicy::RoundRobin); - EncodeComputeMode::programComputeModeCommand(linearStream, streamProperties.stateComputeMode, *defaultHwInfo); + EncodeComputeMode::programComputeModeCommand(linearStream, streamProperties.stateComputeMode, *defaultHwInfo, nullptr); EXPECT_EQ(0u, cs.getUsed()); diff --git a/shared/test/common/gen9/preamble_tests_gen9.cpp b/shared/test/common/gen9/preamble_tests_gen9.cpp index 9893b34ea7..99dfbebee1 100644 --- a/shared/test/common/gen9/preamble_tests_gen9.cpp +++ b/shared/test/common/gen9/preamble_tests_gen9.cpp @@ -101,7 +101,7 @@ GEN9TEST_F(ThreadArbitrationGen9, whenThreadArbitrationPolicyIsProgrammedThenCor MockDevice mockDevice; StreamProperties streamProperties{}; streamProperties.stateComputeMode.threadArbitrationPolicy.set(ThreadArbitrationPolicy::RoundRobin); - EncodeComputeMode::programComputeModeCommand(linearStream, streamProperties.stateComputeMode, *defaultHwInfo); + EncodeComputeMode::programComputeModeCommand(linearStream, streamProperties.stateComputeMode, *defaultHwInfo, nullptr); parseCommands(cs); diff --git a/shared/test/common/xe_hp_core/test_encode_xe_hp_core.cpp b/shared/test/common/xe_hp_core/test_encode_xe_hp_core.cpp index 25194ab71c..02f3a37771 100644 --- a/shared/test/common/xe_hp_core/test_encode_xe_hp_core.cpp +++ b/shared/test/common/xe_hp_core/test_encode_xe_hp_core.cpp @@ -24,7 +24,7 @@ XE_HP_CORE_TEST_F(CommandEncodeXeHpCoreTest, whenProgrammingStateComputeModeThen StateComputeModeProperties properties; auto pLinearStream = std::make_unique(buffer, sizeof(buffer)); - EncodeComputeMode::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo); + EncodeComputeMode::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo, nullptr); auto pScm = reinterpret_cast(pLinearStream->getCpuBase()); auto expectedMask = FamilyType::stateComputeModeForceNonCoherentMask | FamilyType::stateComputeModeLargeGrfModeMask; @@ -35,7 +35,7 @@ XE_HP_CORE_TEST_F(CommandEncodeXeHpCoreTest, whenProgrammingStateComputeModeThen properties.isCoherencyRequired.value = 1; properties.largeGrfMode.value = 1; pLinearStream = std::make_unique(buffer, sizeof(buffer)); - EncodeComputeMode::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo); + EncodeComputeMode::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo, nullptr); pScm = reinterpret_cast(pLinearStream->getCpuBase()); EXPECT_EQ(expectedMask, pScm->getMaskBits()); EXPECT_EQ(STATE_COMPUTE_MODE::FORCE_NON_COHERENT_FORCE_DISABLED, pScm->getForceNonCoherent()); @@ -52,7 +52,7 @@ XE_HP_CORE_TEST_F(CommandEncodeXeHpCoreTest, givenForceDisableMultiAtomicsWhenDe StateComputeModeProperties properties; LinearStream cmdStream(buffer, sizeof(buffer)); - EncodeComputeMode::programComputeModeCommand(cmdStream, properties, *defaultHwInfo); + EncodeComputeMode::programComputeModeCommand(cmdStream, properties, *defaultHwInfo, nullptr); auto scmCommand = reinterpret_cast(cmdStream.getCpuBase()); uint32_t expectedMaskBits = FamilyType::stateComputeModeForceNonCoherentMask | FamilyType::stateComputeModeLargeGrfModeMask | @@ -71,7 +71,7 @@ XE_HP_CORE_TEST_F(CommandEncodeXeHpCoreTest, givenForceDisableMultiAtomicsWhenDe StateComputeModeProperties properties; LinearStream cmdStream(buffer, sizeof(buffer)); - EncodeComputeMode::programComputeModeCommand(cmdStream, properties, *defaultHwInfo); + EncodeComputeMode::programComputeModeCommand(cmdStream, properties, *defaultHwInfo, nullptr); auto scmCommand = reinterpret_cast(cmdStream.getCpuBase()); uint32_t expectedMaskBits = FamilyType::stateComputeModeForceNonCoherentMask | FamilyType::stateComputeModeLargeGrfModeMask | @@ -90,7 +90,7 @@ XE_HP_CORE_TEST_F(CommandEncodeXeHpCoreTest, givenForceDisableMultiPartialWrites StateComputeModeProperties properties; LinearStream cmdStream(buffer, sizeof(buffer)); - EncodeComputeMode::programComputeModeCommand(cmdStream, properties, *defaultHwInfo); + EncodeComputeMode::programComputeModeCommand(cmdStream, properties, *defaultHwInfo, nullptr); auto scmCommand = reinterpret_cast(cmdStream.getCpuBase()); uint32_t expectedMaskBits = FamilyType::stateComputeModeForceNonCoherentMask | FamilyType::stateComputeModeLargeGrfModeMask | @@ -109,7 +109,7 @@ XE_HP_CORE_TEST_F(CommandEncodeXeHpCoreTest, givenForceDisableMultiPartialWrites StateComputeModeProperties properties; LinearStream cmdStream(buffer, sizeof(buffer)); - EncodeComputeMode::programComputeModeCommand(cmdStream, properties, *defaultHwInfo); + EncodeComputeMode::programComputeModeCommand(cmdStream, properties, *defaultHwInfo, nullptr); auto scmCommand = reinterpret_cast(cmdStream.getCpuBase()); uint32_t expectedMaskBits = FamilyType::stateComputeModeForceNonCoherentMask | FamilyType::stateComputeModeLargeGrfModeMask | diff --git a/shared/test/common/xe_hpg_core/dg2/test_encode_dg2.cpp b/shared/test/common/xe_hpg_core/dg2/test_encode_dg2.cpp index 8a34ab7593..42fb97b099 100644 --- a/shared/test/common/xe_hpg_core/dg2/test_encode_dg2.cpp +++ b/shared/test/common/xe_hpg_core/dg2/test_encode_dg2.cpp @@ -24,7 +24,7 @@ DG2TEST_F(CommandEncodeDG2Test, whenProgrammingStateComputeModeThenProperFieldsA StateComputeModeProperties properties; auto pLinearStream = std::make_unique(buffer, sizeof(buffer)); - EncodeComputeMode::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo); + EncodeComputeMode::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo, nullptr); auto pScm = reinterpret_cast(pLinearStream->getCpuBase()); auto expectedMask = FamilyType::stateComputeModeForceNonCoherentMask | FamilyType::stateComputeModeLargeGrfModeMask; EXPECT_EQ(expectedMask, pScm->getMaskBits()); @@ -38,7 +38,7 @@ DG2TEST_F(CommandEncodeDG2Test, whenProgrammingStateComputeModeThenProperFieldsA properties.pixelAsyncComputeThreadLimit.value = 1; properties.largeGrfMode.value = 1; pLinearStream = std::make_unique(buffer, sizeof(buffer)); - EncodeComputeMode::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo); + EncodeComputeMode::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo, nullptr); pScm = reinterpret_cast(pLinearStream->getCpuBase()); expectedMask |= FamilyType::stateComputeModeZPassAsyncComputeThreadLimitMask | FamilyType::stateComputeModePixelAsyncComputeThreadLimitMask; diff --git a/shared/test/unit_test/command_stream/stream_properties_tests_common.cpp b/shared/test/unit_test/command_stream/stream_properties_tests_common.cpp index e480532aa5..8009c32322 100644 --- a/shared/test/unit_test/command_stream/stream_properties_tests_common.cpp +++ b/shared/test/unit_test/command_stream/stream_properties_tests_common.cpp @@ -9,6 +9,7 @@ #include "shared/source/command_stream/stream_properties.h" #include "shared/source/command_stream/thread_arbitration_policy.h" +#include "shared/source/helpers/hw_helper.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/test_macros/test.h" @@ -64,39 +65,51 @@ TEST(StreamPropertiesTests, whenSettingStateComputeModePropertiesThenCorrectValu DebugManager.flags.ForceGrfNumProgrammingWithScm.set(1); DebugManager.flags.ForceThreadArbitrationPolicyProgrammingWithScm.set(1); + auto isDevicePreemptionModeTrackedInScm = HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily).isDevicePreemptionModeTrackedInScm(); + int32_t threadArbitrationPolicyValues[] = { ThreadArbitrationPolicy::AgeBased, ThreadArbitrationPolicy::RoundRobin, ThreadArbitrationPolicy::RoundRobinAfterDependency}; + PreemptionMode preemptionModes[] = {PreemptionMode::Disabled, PreemptionMode::Initial, PreemptionMode::MidBatch, PreemptionMode::ThreadGroup, PreemptionMode::MidThread}; + StreamProperties properties; - for (auto requiresCoherency : ::testing::Bool()) { - for (auto largeGrf : ::testing::Bool()) { - for (auto threadArbitrationPolicy : threadArbitrationPolicyValues) { - properties.stateComputeMode.setProperties(requiresCoherency, largeGrf ? 256 : 128, threadArbitrationPolicy, *defaultHwInfo); - EXPECT_EQ(largeGrf, properties.stateComputeMode.largeGrfMode.value); - EXPECT_EQ(requiresCoherency, properties.stateComputeMode.isCoherencyRequired.value); - EXPECT_EQ(-1, properties.stateComputeMode.zPassAsyncComputeThreadLimit.value); - EXPECT_EQ(-1, properties.stateComputeMode.pixelAsyncComputeThreadLimit.value); - EXPECT_EQ(threadArbitrationPolicy, properties.stateComputeMode.threadArbitrationPolicy.value); + for (auto preemptionMode : preemptionModes) { + for (auto requiresCoherency : ::testing::Bool()) { + for (auto largeGrf : ::testing::Bool()) { + for (auto threadArbitrationPolicy : threadArbitrationPolicyValues) { + properties.stateComputeMode.setProperties(requiresCoherency, largeGrf ? 256 : 128, threadArbitrationPolicy, preemptionMode, *defaultHwInfo); + EXPECT_EQ(largeGrf, properties.stateComputeMode.largeGrfMode.value); + EXPECT_EQ(requiresCoherency, properties.stateComputeMode.isCoherencyRequired.value); + EXPECT_EQ(-1, properties.stateComputeMode.zPassAsyncComputeThreadLimit.value); + EXPECT_EQ(-1, properties.stateComputeMode.pixelAsyncComputeThreadLimit.value); + EXPECT_EQ(threadArbitrationPolicy, properties.stateComputeMode.threadArbitrationPolicy.value); + + if (isDevicePreemptionModeTrackedInScm) { + EXPECT_EQ(preemptionMode, static_cast(properties.stateComputeMode.devicePreemptionMode.value)); + } else { + EXPECT_EQ(-1, properties.stateComputeMode.devicePreemptionMode.value); + } + } } } } for (auto forceZPassAsyncComputeThreadLimit : ::testing::Bool()) { DebugManager.flags.ForceZPassAsyncComputeThreadLimit.set(forceZPassAsyncComputeThreadLimit); - properties.stateComputeMode.setProperties(false, 0u, 0u, *defaultHwInfo); + properties.stateComputeMode.setProperties(false, 0u, 0u, PreemptionMode::MidBatch, *defaultHwInfo); EXPECT_EQ(forceZPassAsyncComputeThreadLimit, properties.stateComputeMode.zPassAsyncComputeThreadLimit.value); } for (auto forcePixelAsyncComputeThreadLimit : ::testing::Bool()) { DebugManager.flags.ForcePixelAsyncComputeThreadLimit.set(forcePixelAsyncComputeThreadLimit); - properties.stateComputeMode.setProperties(false, 0u, 0u, *defaultHwInfo); + properties.stateComputeMode.setProperties(false, 0u, 0u, PreemptionMode::MidBatch, *defaultHwInfo); EXPECT_EQ(forcePixelAsyncComputeThreadLimit, properties.stateComputeMode.pixelAsyncComputeThreadLimit.value); } for (auto threadArbitrationPolicy : threadArbitrationPolicyValues) { DebugManager.flags.OverrideThreadArbitrationPolicy.set(threadArbitrationPolicy); - properties.stateComputeMode.setProperties(false, 0u, 0u, *defaultHwInfo); + properties.stateComputeMode.setProperties(false, 0u, 0u, PreemptionMode::MidBatch, *defaultHwInfo); EXPECT_EQ(threadArbitrationPolicy, properties.stateComputeMode.threadArbitrationPolicy.value); } } diff --git a/shared/test/unit_test/encoders/test_encode_dispatch_kernel_pvc_and_later.cpp b/shared/test/unit_test/encoders/test_encode_dispatch_kernel_pvc_and_later.cpp index 485b269a2e..07619e513d 100644 --- a/shared/test/unit_test/encoders/test_encode_dispatch_kernel_pvc_and_later.cpp +++ b/shared/test/unit_test/encoders/test_encode_dispatch_kernel_pvc_and_later.cpp @@ -83,8 +83,8 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTestPvcAndLater, givenCommandCon using STATE_COMPUTE_MODE = typename FamilyType::STATE_COMPUTE_MODE; auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily); StreamProperties streamProperties{}; - streamProperties.stateComputeMode.setProperties(false, GrfConfig::LargeGrfNumber, 0u, *defaultHwInfo); - EncodeComputeMode::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, *defaultHwInfo); + streamProperties.stateComputeMode.setProperties(false, GrfConfig::LargeGrfNumber, 0u, PreemptionMode::Disabled, *defaultHwInfo); + EncodeComputeMode::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, *defaultHwInfo, nullptr); GenCmdList commands; CmdParse::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed()); diff --git a/shared/test/unit_test/encoders/test_encode_dispatch_kernel_xehp_and_later.cpp b/shared/test/unit_test/encoders/test_encode_dispatch_kernel_xehp_and_later.cpp index 1f90877142..841cfdebfa 100644 --- a/shared/test/unit_test/encoders/test_encode_dispatch_kernel_xehp_and_later.cpp +++ b/shared/test/unit_test/encoders/test_encode_dispatch_kernel_xehp_and_later.cpp @@ -441,11 +441,11 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTest, givenDispatchInterfaceWhen DebugManager.flags.ForceGrfNumProgrammingWithScm.set(1); StreamProperties streamProperties{}; - streamProperties.stateComputeMode.setProperties(false, 128, 0u, *defaultHwInfo); - streamProperties.stateComputeMode.setProperties(false, 128, 0u, *defaultHwInfo); + streamProperties.stateComputeMode.setProperties(false, 128, 0u, PreemptionMode::Disabled, *defaultHwInfo); + streamProperties.stateComputeMode.setProperties(false, 128, 0u, PreemptionMode::Disabled, *defaultHwInfo); EXPECT_FALSE(streamProperties.stateComputeMode.isDirty()); - streamProperties.stateComputeMode.setProperties(false, 256, 0u, *defaultHwInfo); + streamProperties.stateComputeMode.setProperties(false, 256, 0u, PreemptionMode::Disabled, *defaultHwInfo); EXPECT_TRUE(streamProperties.stateComputeMode.isDirty()); } diff --git a/shared/test/unit_test/encoders/test_encode_grf_mode_xe_hp_and_later.cpp b/shared/test/unit_test/encoders/test_encode_grf_mode_xe_hp_and_later.cpp index 0ee50c8a95..14f45fdf8c 100644 --- a/shared/test/unit_test/encoders/test_encode_grf_mode_xe_hp_and_later.cpp +++ b/shared/test/unit_test/encoders/test_encode_grf_mode_xe_hp_and_later.cpp @@ -21,8 +21,8 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTest, givenCommandContainerWhenN using PIPELINE_SELECT = typename FamilyType::PIPELINE_SELECT; using STATE_COMPUTE_MODE = typename FamilyType::STATE_COMPUTE_MODE; StreamProperties streamProperties{}; - streamProperties.stateComputeMode.setProperties(false, GrfConfig::DefaultGrfNumber, 0u, *defaultHwInfo); - EncodeComputeMode::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, *defaultHwInfo); + streamProperties.stateComputeMode.setProperties(false, GrfConfig::DefaultGrfNumber, 0u, PreemptionMode::Disabled, *defaultHwInfo); + EncodeComputeMode::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, *defaultHwInfo, nullptr); GenCmdList commands; CmdParse::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed()); @@ -57,8 +57,8 @@ HWTEST2_F(CommandEncodeStatesTest, givenLargeGrfModeProgrammedThenExpectedComman NEO::EncodeComputeMode::adjustPipelineSelect(*cmdContainer, descriptor); StreamProperties streamProperties{}; - streamProperties.stateComputeMode.setProperties(false, 256u, 0u, *defaultHwInfo); - NEO::EncodeComputeMode::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, *defaultHwInfo); + streamProperties.stateComputeMode.setProperties(false, 256u, 0u, PreemptionMode::Disabled, *defaultHwInfo); + NEO::EncodeComputeMode::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, *defaultHwInfo, nullptr); auto usedSpaceAfter = cmdContainer->getCommandStream()->getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); @@ -79,7 +79,7 @@ HWTEST2_F(CommandEncodeStatesTest, givenLargeGrfModeDisabledThenExpectedCommands NEO::EncodeComputeMode::adjustPipelineSelect(*cmdContainer, descriptor); StreamProperties streamProperties{}; streamProperties.stateComputeMode.largeGrfMode.set(0); - NEO::EncodeComputeMode::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, *defaultHwInfo); + NEO::EncodeComputeMode::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, *defaultHwInfo, nullptr); auto usedSpaceAfter = cmdContainer->getCommandStream()->getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); @@ -179,7 +179,7 @@ HWTEST2_F(CommandEncodeStatesTest, givenLargeGrfModeEnabledThenExpectedCommandsA NEO::EncodeComputeMode::adjustPipelineSelect(*cmdContainer, descriptor); StreamProperties streamProperties{}; streamProperties.stateComputeMode.largeGrfMode.set(1); - NEO::EncodeComputeMode::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, *defaultHwInfo); + NEO::EncodeComputeMode::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, *defaultHwInfo, nullptr); auto usedSpaceAfter = cmdContainer->getCommandStream()->getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); @@ -217,7 +217,7 @@ HWTEST2_F(CommandEncodeStatesTest, givenLargeGrfModeEnabledAndDisabledThenExpect NEO::EncodeComputeMode::adjustPipelineSelect(*cmdContainer, descriptor); StreamProperties streamProperties{}; streamProperties.stateComputeMode.largeGrfMode.set(1); - NEO::EncodeComputeMode::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, *defaultHwInfo); + NEO::EncodeComputeMode::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, *defaultHwInfo, nullptr); auto usedSpaceAfter = cmdContainer->getCommandStream()->getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); @@ -246,7 +246,7 @@ HWTEST2_F(CommandEncodeStatesTest, givenLargeGrfModeEnabledAndDisabledThenExpect usedSpaceBefore = cmdContainer->getCommandStream()->getUsed(); NEO::EncodeComputeMode::adjustPipelineSelect(*cmdContainer, descriptor); streamProperties.stateComputeMode.largeGrfMode.set(0); - NEO::EncodeComputeMode::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, *defaultHwInfo); + NEO::EncodeComputeMode::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, *defaultHwInfo, nullptr); usedSpaceAfter = cmdContainer->getCommandStream()->getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); diff --git a/shared/test/unit_test/encoders/test_encode_states.cpp b/shared/test/unit_test/encoders/test_encode_states.cpp index e8ab538502..71c514ac3e 100644 --- a/shared/test/unit_test/encoders/test_encode_states.cpp +++ b/shared/test/unit_test/encoders/test_encode_states.cpp @@ -384,7 +384,7 @@ HWTEST2_F(CommandEncodeStatesTest, whenProgramComputeModeCommandModeIsCalledThen streamProperties.stateComputeMode.threadArbitrationPolicy.value = ThreadArbitrationPolicy::AgeBased; streamProperties.stateComputeMode.threadArbitrationPolicy.isDirty = true; NEO::EncodeComputeMode::programComputeModeCommand(*cmdContainer->getCommandStream(), - streamProperties.stateComputeMode, *defaultHwInfo); + streamProperties.stateComputeMode, *defaultHwInfo, nullptr); if constexpr (TestTraits::programComputeModeCommandProgramsThreadArbitrationPolicy) { GenCmdList commands; @@ -409,7 +409,7 @@ HWTEST2_F(CommandEncodeStatesTest, whenProgramComputeModeCommandModeIsCalledThen streamProperties.stateComputeMode.threadArbitrationPolicy.value = ThreadArbitrationPolicy::AgeBased; streamProperties.stateComputeMode.isCoherencyRequired.isDirty = true; NEO::EncodeComputeMode::programComputeModeCommand(*cmdContainer->getCommandStream(), - streamProperties.stateComputeMode, *defaultHwInfo); + streamProperties.stateComputeMode, *defaultHwInfo, nullptr); if constexpr (TestTraits::programComputeModeCommandProgramsNonCoherent) { GenCmdList commands; @@ -438,6 +438,6 @@ HWTEST2_F(CommandEncodeStatesTest, whenGetCmdSizeForComputeModeThenCorrectValueI UltDeviceFactory deviceFactory{1, 0}; auto &csr = deviceFactory.rootDevices[0]->getUltCommandStreamReceiver(); - csr.streamProperties.stateComputeMode.setProperties(false, 0, ThreadArbitrationPolicy::AgeBased, *defaultHwInfo); + csr.streamProperties.stateComputeMode.setProperties(false, 0, ThreadArbitrationPolicy::AgeBased, PreemptionMode::Disabled, *defaultHwInfo); EXPECT_EQ(expectedScmSize, csr.getCmdSizeForComputeMode()); } diff --git a/shared/test/unit_test/xe_hpc_core/compute_mode_tests_xe_hpc_core.cpp b/shared/test/unit_test/xe_hpc_core/compute_mode_tests_xe_hpc_core.cpp index 5d5ce4def9..4e562aa2d5 100644 --- a/shared/test/unit_test/xe_hpc_core/compute_mode_tests_xe_hpc_core.cpp +++ b/shared/test/unit_test/xe_hpc_core/compute_mode_tests_xe_hpc_core.cpp @@ -190,7 +190,7 @@ HWTEST2_F(XeHpcComputeModeRequirements, giventhreadArbitrationPolicyWithoutShare }; getCsrHw()->streamProperties.stateComputeMode.setProperties(flags.requiresCoherency, flags.numGrfRequired, - flags.threadArbitrationPolicy, *defaultHwInfo); + flags.threadArbitrationPolicy, PreemptionMode::Disabled, *defaultHwInfo); flushTask(true); findCmd(hwInfoConfig.isThreadArbitrationPolicyReportedWithScm()); // first time diff --git a/shared/test/unit_test/xe_hpc_core/test_encode_xe_hpc_core.cpp b/shared/test/unit_test/xe_hpc_core/test_encode_xe_hpc_core.cpp index 2a9f0d842a..b7f6e36fba 100644 --- a/shared/test/unit_test/xe_hpc_core/test_encode_xe_hpc_core.cpp +++ b/shared/test/unit_test/xe_hpc_core/test_encode_xe_hpc_core.cpp @@ -212,7 +212,7 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, whenProgrammingStateComputeModeThe StateComputeModeProperties properties; auto pLinearStream = std::make_unique(buffer, sizeof(buffer)); - EncodeComputeMode::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo); + EncodeComputeMode::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo, nullptr); auto pScm = reinterpret_cast(pLinearStream->getCpuBase()); EXPECT_EQ(0u, pScm->getMaskBits()); EXPECT_EQ(STATE_COMPUTE_MODE::FORCE_NON_COHERENT_FORCE_DISABLED, pScm->getForceNonCoherent()); @@ -223,7 +223,7 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, whenProgrammingStateComputeModeThe properties.threadArbitrationPolicy.value = ThreadArbitrationPolicy::RoundRobin; properties.largeGrfMode.value = 1; pLinearStream = std::make_unique(buffer, sizeof(buffer)); - EncodeComputeMode::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo); + EncodeComputeMode::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo, nullptr); pScm = reinterpret_cast(pLinearStream->getCpuBase()); EXPECT_EQ(0u, pScm->getMaskBits()); EXPECT_EQ(STATE_COMPUTE_MODE::FORCE_NON_COHERENT_FORCE_DISABLED, pScm->getForceNonCoherent()); @@ -234,7 +234,7 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, whenProgrammingStateComputeModeThe properties.threadArbitrationPolicy.isDirty = true; properties.largeGrfMode.isDirty = true; pLinearStream = std::make_unique(buffer, sizeof(buffer)); - EncodeComputeMode::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo); + EncodeComputeMode::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo, nullptr); pScm = reinterpret_cast(pLinearStream->getCpuBase()); auto expectedMask = FamilyType::stateComputeModeForceNonCoherentMask | FamilyType::stateComputeModeEuThreadSchedulingModeOverrideMask | FamilyType::stateComputeModeLargeGrfModeMask; @@ -253,8 +253,8 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, whenAdjustComputeModeIsCalledThenC auto &hwInfoConfig = *NEO::HwInfoConfig::get(defaultHwInfo->platform.eProductFamily); auto pLinearStream = std::make_unique(buffer, sizeof(buffer)); - properties.stateComputeMode.setProperties(false, 0, ThreadArbitrationPolicy::AgeBased, *defaultHwInfo); - EncodeComputeMode::programComputeModeCommand(*pLinearStream, properties.stateComputeMode, *defaultHwInfo); + properties.stateComputeMode.setProperties(false, 0, ThreadArbitrationPolicy::AgeBased, PreemptionMode::Disabled, *defaultHwInfo); + EncodeComputeMode::programComputeModeCommand(*pLinearStream, properties.stateComputeMode, *defaultHwInfo, nullptr); auto pScm = reinterpret_cast(pLinearStream->getCpuBase()); if (hwInfoConfig.isThreadArbitrationPolicyReportedWithScm()) { EXPECT_EQ(EU_THREAD_SCHEDULING_MODE_OVERRIDE::EU_THREAD_SCHEDULING_MODE_OVERRIDE_OLDEST_FIRST, pScm->getEuThreadSchedulingModeOverride()); @@ -263,8 +263,8 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, whenAdjustComputeModeIsCalledThenC } pLinearStream = std::make_unique(buffer, sizeof(buffer)); - properties.stateComputeMode.setProperties(false, 0, ThreadArbitrationPolicy::RoundRobin, *defaultHwInfo); - EncodeComputeMode::programComputeModeCommand(*pLinearStream, properties.stateComputeMode, *defaultHwInfo); + properties.stateComputeMode.setProperties(false, 0, ThreadArbitrationPolicy::RoundRobin, PreemptionMode::Disabled, *defaultHwInfo); + EncodeComputeMode::programComputeModeCommand(*pLinearStream, properties.stateComputeMode, *defaultHwInfo, nullptr); pScm = reinterpret_cast(pLinearStream->getCpuBase()); if (hwInfoConfig.isThreadArbitrationPolicyReportedWithScm()) { EXPECT_EQ(EU_THREAD_SCHEDULING_MODE_OVERRIDE::EU_THREAD_SCHEDULING_MODE_OVERRIDE_ROUND_ROBIN, pScm->getEuThreadSchedulingModeOverride()); @@ -273,8 +273,8 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, whenAdjustComputeModeIsCalledThenC } pLinearStream = std::make_unique(buffer, sizeof(buffer)); - properties.stateComputeMode.setProperties(false, 0, ThreadArbitrationPolicy::RoundRobinAfterDependency, *defaultHwInfo); - EncodeComputeMode::programComputeModeCommand(*pLinearStream, properties.stateComputeMode, *defaultHwInfo); + properties.stateComputeMode.setProperties(false, 0, ThreadArbitrationPolicy::RoundRobinAfterDependency, PreemptionMode::Disabled, *defaultHwInfo); + EncodeComputeMode::programComputeModeCommand(*pLinearStream, properties.stateComputeMode, *defaultHwInfo, nullptr); pScm = reinterpret_cast(pLinearStream->getCpuBase()); if (hwInfoConfig.isThreadArbitrationPolicyReportedWithScm()) { EXPECT_EQ(EU_THREAD_SCHEDULING_MODE_OVERRIDE::EU_THREAD_SCHEDULING_MODE_OVERRIDE_STALL_BASED_ROUND_ROBIN, pScm->getEuThreadSchedulingModeOverride()); @@ -283,8 +283,8 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, whenAdjustComputeModeIsCalledThenC } pLinearStream = std::make_unique(buffer, sizeof(buffer)); - properties.stateComputeMode.setProperties(false, 0, ThreadArbitrationPolicy::NotPresent, *defaultHwInfo); - EncodeComputeMode::programComputeModeCommand(*pLinearStream, properties.stateComputeMode, *defaultHwInfo); + properties.stateComputeMode.setProperties(false, 0, ThreadArbitrationPolicy::NotPresent, PreemptionMode::Disabled, *defaultHwInfo); + EncodeComputeMode::programComputeModeCommand(*pLinearStream, properties.stateComputeMode, *defaultHwInfo, nullptr); pScm = reinterpret_cast(pLinearStream->getCpuBase()); EXPECT_EQ(EU_THREAD_SCHEDULING_MODE_OVERRIDE::EU_THREAD_SCHEDULING_MODE_OVERRIDE_HW_DEFAULT, pScm->getEuThreadSchedulingModeOverride()); } diff --git a/shared/test/unit_test/xe_hpg_core/compute_mode_tests_xe_hpg_core.cpp b/shared/test/unit_test/xe_hpg_core/compute_mode_tests_xe_hpg_core.cpp index ade5c1f48c..5a70f5640f 100644 --- a/shared/test/unit_test/xe_hpg_core/compute_mode_tests_xe_hpg_core.cpp +++ b/shared/test/unit_test/xe_hpg_core/compute_mode_tests_xe_hpg_core.cpp @@ -62,7 +62,7 @@ XE_HPG_CORETEST_F(ComputeModeRequirementsXeHpgCore, GivenVariousSettingsWhenComp DebugManager.flags.ForcePixelAsyncComputeThreadLimit.set(testValue.pixelThreadLimit); pCsr->streamProperties.stateComputeMode = {}; - pCsr->streamProperties.stateComputeMode.setProperties(false, 0u, 0u, *defaultHwInfo); + pCsr->streamProperties.stateComputeMode.setProperties(false, 0u, 0u, PreemptionMode::Disabled, *defaultHwInfo); LinearStream stream(buff, 1024); pCsr->programComputeMode(stream, flags, *defaultHwInfo); EXPECT_EQ(cmdsSize, stream.getUsed()); @@ -83,7 +83,7 @@ XE_HPG_CORETEST_F(ComputeModeRequirementsXeHpgCore, GivenVariousSettingsWhenComp DebugManager.flags.ForcePixelAsyncComputeThreadLimit.set(-1); pCsr->streamProperties.stateComputeMode = {}; - pCsr->streamProperties.stateComputeMode.setProperties(false, 0u, 0u, *defaultHwInfo); + pCsr->streamProperties.stateComputeMode.setProperties(false, 0u, 0u, PreemptionMode::Disabled, *defaultHwInfo); LinearStream stream(buff, 1024); pCsr->programComputeMode(stream, flags, *defaultHwInfo); EXPECT_EQ(cmdsSize, stream.getUsed());