Use LogicalStateHelper to program ComputeMode

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2022-06-23 15:25:10 +00:00
committed by Compute-Runtime-Automation
parent 4dff4e165c
commit 2c853adac3
44 changed files with 136 additions and 87 deletions

View File

@ -16,9 +16,12 @@
#include "igfxfmid.h"
#include <memory>
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<NEO::LogicalStateHelper> logicalStateHelper;
size_t cmdListCurrentStartOffset = 0;
bool containsAnyKernel = false;
};

View File

@ -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<gfxCoreFamily>::initialize(Device *device, NEO
}
}
this->logicalStateHelper.reset(NEO::LogicalStateHelper::create<GfxFamily>(true));
return returnType;
}
@ -2280,7 +2283,7 @@ void CommandListCoreFamily<gfxCoreFamily>::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<gfxCoreFamily>::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<GfxFamily>::programComputeModeCommandWithSynchronization(
*commandContainer.getCommandStream(), finalStreamState.stateComputeMode, {}, false, hwInfo, isRcs);
*commandContainer.getCommandStream(), finalStreamState.stateComputeMode, {}, false, hwInfo, isRcs, nullptr);
}
}

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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,

View File

@ -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

View File

@ -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,

View File

@ -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 <typename GfxFamily>

View File

@ -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);

View File

@ -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);
};

View File

@ -532,7 +532,7 @@ size_t EncodeStateBaseAddress<Family>::getRequiredSizeForStateBaseAddress(Device
}
template <typename Family>
void EncodeComputeMode<Family>::programComputeModeCommand(LinearStream &csr, StateComputeModeProperties &properties, const HardwareInfo &hwInfo) {
void EncodeComputeMode<Family>::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;

View File

@ -14,9 +14,9 @@ namespace NEO {
template <typename Family>
inline void EncodeComputeMode<Family>::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<Family>::programComputeModeCommand(csr, properties, hwInfo);
EncodeComputeMode<Family>::programComputeModeCommand(csr, properties, hwInfo, nullptr);
}
template <typename Family>

View File

@ -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<Family>::getCmdSizeForComputeMode(const HardwareInfo &h
template <typename Family>
inline void EncodeComputeMode<Family>::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<Family>::programComputeModeCommandWithSynchronizat
NEO::EncodeWA<Family>::addPipeControlPriorToNonPipelinedStateCommand(csr, args, hwInfo, isRcs);
}
EncodeComputeMode<Family>::programComputeModeCommand(csr, properties, hwInfo);
EncodeComputeMode<Family>::programComputeModeCommand(csr, properties, hwInfo, logicalStateHelper);
if (hasSharedHandles) {
MemorySynchronizationCommands<Family>::addPipeControlWithCSStallOnly(csr);

View File

@ -267,7 +267,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::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<GfxFamily>::programComputeMode(LinearStream &stream
if (this->streamProperties.stateComputeMode.isDirty()) {
EncodeComputeMode<GfxFamily>::programComputeModeCommandWithSynchronization(
stream, this->streamProperties.stateComputeMode, dispatchFlags.pipelineSelectArgs,
hasSharedHandles(), hwInfo, isRcs());
hasSharedHandles(), hwInfo, isRcs(), logicalStateHelper.get());
}
}

View File

@ -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;

View File

@ -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<int32_t>(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();
}

View File

@ -47,7 +47,7 @@ size_t EncodeComputeMode<Family>::getCmdSizeForComputeMode(const HardwareInfo &h
template <>
void EncodeComputeMode<Family>::programComputeModeCommand(LinearStream &csr, StateComputeModeProperties &properties,
const HardwareInfo &hwInfo) {
const HardwareInfo &hwInfo, LogicalStateHelper *logicalStateHelper) {
using PIPE_CONTROL = typename Family::PIPE_CONTROL;
if (properties.threadArbitrationPolicy.isDirty) {

View File

@ -34,7 +34,7 @@ size_t EncodeWA<Family>::getAdditionalPipelineSelectSize(Device &device) {
}
template <>
void EncodeComputeMode<Family>::programComputeModeCommand(LinearStream &csr, StateComputeModeProperties &properties, const HardwareInfo &hwInfo) {
void EncodeComputeMode<Family>::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;

View File

@ -40,7 +40,7 @@ size_t EncodeComputeMode<Family>::getCmdSizeForComputeMode(const HardwareInfo &h
template <typename Family>
void EncodeComputeMode<Family>::programComputeModeCommand(LinearStream &csr, StateComputeModeProperties &properties,
const HardwareInfo &hwInfo) {
const HardwareInfo &hwInfo, LogicalStateHelper *logicalStateHelper) {
}
template <>

View File

@ -38,7 +38,7 @@ size_t EncodeComputeMode<Family>::getCmdSizeForComputeMode(const HardwareInfo &h
template <typename Family>
void EncodeComputeMode<Family>::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);

View File

@ -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;

View File

@ -729,4 +729,9 @@ template <typename GfxFamily>
bool HwHelperHw<GfxFamily>::isPatIndexFallbackWaRequired() const {
return false;
}
template <typename GfxFamily>
bool HwHelperHw<GfxFamily>::isDevicePreemptionModeTrackedInScm() const {
return false;
}
} // namespace NEO

View File

@ -49,7 +49,7 @@ inline void EncodeAtomic<Family>::setMiAtomicAddress(MI_ATOMIC &atomic, uint64_t
}
template <>
void EncodeComputeMode<Family>::programComputeModeCommand(LinearStream &csr, StateComputeModeProperties &properties, const HardwareInfo &hwInfo) {
void EncodeComputeMode<Family>::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;

View File

@ -121,7 +121,7 @@ void EncodeDispatchKernel<Family>::encodeAdditionalWalkerFields(const HardwareIn
}
template <>
void EncodeComputeMode<Family>::programComputeModeCommand(LinearStream &csr, StateComputeModeProperties &properties, const HardwareInfo &hwInfo) {
void EncodeComputeMode<Family>::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;

View File

@ -148,7 +148,7 @@ GEN11TEST_F(ThreadArbitrationGen11, whenThreadArbitrationPolicyIsProgrammedThenC
MockDevice mockDevice;
StreamProperties streamProperties{};
streamProperties.stateComputeMode.threadArbitrationPolicy.set(ThreadArbitrationPolicy::RoundRobin);
EncodeComputeMode<FamilyType>::programComputeModeCommand(linearStream, streamProperties.stateComputeMode, *defaultHwInfo);
EncodeComputeMode<FamilyType>::programComputeModeCommand(linearStream, streamProperties.stateComputeMode, *defaultHwInfo, nullptr);
parseCommands<FamilyType>(cs);

View File

@ -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<FamilyType>::programComputeModeCommand(*cmdContainer.getCommandStream(),
properties.stateComputeMode, *defaultHwInfo);
properties.stateComputeMode, *defaultHwInfo, nullptr);
auto usedSpaceAfter = cmdContainer.getCommandStream()->getUsed();
ASSERT_GT(usedSpaceAfter, usedSpaceBefore);

View File

@ -22,14 +22,14 @@ GEN12LPTEST_F(CommandEncodeGen12LpTest, whenProgrammingStateComputeModeThenPrope
StateComputeModeProperties properties;
auto pLinearStream = std::make_unique<LinearStream>(buffer, sizeof(buffer));
EncodeComputeMode<FamilyType>::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo);
EncodeComputeMode<FamilyType>::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo, nullptr);
auto pScm = reinterpret_cast<STATE_COMPUTE_MODE *>(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<LinearStream>(buffer, sizeof(buffer));
EncodeComputeMode<FamilyType>::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo);
EncodeComputeMode<FamilyType>::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo, nullptr);
pScm = reinterpret_cast<STATE_COMPUTE_MODE *>(pLinearStream->getCpuBase());
EXPECT_EQ(FamilyType::stateComputeModeForceNonCoherentMask, pScm->getMaskBits());
EXPECT_EQ(STATE_COMPUTE_MODE::FORCE_NON_COHERENT_FORCE_DISABLED, pScm->getForceNonCoherent());

View File

@ -77,7 +77,7 @@ BDWTEST_F(ThreadArbitrationGen8, givenPolicyWhenThreadArbitrationProgrammedThenD
StreamProperties streamProperties{};
streamProperties.stateComputeMode.threadArbitrationPolicy.set(ThreadArbitrationPolicy::RoundRobin);
EncodeComputeMode<FamilyType>::programComputeModeCommand(linearStream, streamProperties.stateComputeMode, *defaultHwInfo);
EncodeComputeMode<FamilyType>::programComputeModeCommand(linearStream, streamProperties.stateComputeMode, *defaultHwInfo, nullptr);
EXPECT_EQ(0u, cs.getUsed());

View File

@ -101,7 +101,7 @@ GEN9TEST_F(ThreadArbitrationGen9, whenThreadArbitrationPolicyIsProgrammedThenCor
MockDevice mockDevice;
StreamProperties streamProperties{};
streamProperties.stateComputeMode.threadArbitrationPolicy.set(ThreadArbitrationPolicy::RoundRobin);
EncodeComputeMode<FamilyType>::programComputeModeCommand(linearStream, streamProperties.stateComputeMode, *defaultHwInfo);
EncodeComputeMode<FamilyType>::programComputeModeCommand(linearStream, streamProperties.stateComputeMode, *defaultHwInfo, nullptr);
parseCommands<SKLFamily>(cs);

View File

@ -24,7 +24,7 @@ XE_HP_CORE_TEST_F(CommandEncodeXeHpCoreTest, whenProgrammingStateComputeModeThen
StateComputeModeProperties properties;
auto pLinearStream = std::make_unique<LinearStream>(buffer, sizeof(buffer));
EncodeComputeMode<FamilyType>::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo);
EncodeComputeMode<FamilyType>::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo, nullptr);
auto pScm = reinterpret_cast<STATE_COMPUTE_MODE *>(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<LinearStream>(buffer, sizeof(buffer));
EncodeComputeMode<FamilyType>::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo);
EncodeComputeMode<FamilyType>::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo, nullptr);
pScm = reinterpret_cast<STATE_COMPUTE_MODE *>(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<FamilyType>::programComputeModeCommand(cmdStream, properties, *defaultHwInfo);
EncodeComputeMode<FamilyType>::programComputeModeCommand(cmdStream, properties, *defaultHwInfo, nullptr);
auto scmCommand = reinterpret_cast<STATE_COMPUTE_MODE *>(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<FamilyType>::programComputeModeCommand(cmdStream, properties, *defaultHwInfo);
EncodeComputeMode<FamilyType>::programComputeModeCommand(cmdStream, properties, *defaultHwInfo, nullptr);
auto scmCommand = reinterpret_cast<STATE_COMPUTE_MODE *>(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<FamilyType>::programComputeModeCommand(cmdStream, properties, *defaultHwInfo);
EncodeComputeMode<FamilyType>::programComputeModeCommand(cmdStream, properties, *defaultHwInfo, nullptr);
auto scmCommand = reinterpret_cast<STATE_COMPUTE_MODE *>(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<FamilyType>::programComputeModeCommand(cmdStream, properties, *defaultHwInfo);
EncodeComputeMode<FamilyType>::programComputeModeCommand(cmdStream, properties, *defaultHwInfo, nullptr);
auto scmCommand = reinterpret_cast<STATE_COMPUTE_MODE *>(cmdStream.getCpuBase());
uint32_t expectedMaskBits = FamilyType::stateComputeModeForceNonCoherentMask | FamilyType::stateComputeModeLargeGrfModeMask |

View File

@ -24,7 +24,7 @@ DG2TEST_F(CommandEncodeDG2Test, whenProgrammingStateComputeModeThenProperFieldsA
StateComputeModeProperties properties;
auto pLinearStream = std::make_unique<LinearStream>(buffer, sizeof(buffer));
EncodeComputeMode<FamilyType>::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo);
EncodeComputeMode<FamilyType>::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo, nullptr);
auto pScm = reinterpret_cast<STATE_COMPUTE_MODE *>(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<LinearStream>(buffer, sizeof(buffer));
EncodeComputeMode<FamilyType>::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo);
EncodeComputeMode<FamilyType>::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo, nullptr);
pScm = reinterpret_cast<STATE_COMPUTE_MODE *>(pLinearStream->getCpuBase());
expectedMask |= FamilyType::stateComputeModeZPassAsyncComputeThreadLimitMask |
FamilyType::stateComputeModePixelAsyncComputeThreadLimitMask;

View File

@ -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 preemptionMode : preemptionModes) {
for (auto requiresCoherency : ::testing::Bool()) {
for (auto largeGrf : ::testing::Bool()) {
for (auto threadArbitrationPolicy : threadArbitrationPolicyValues) {
properties.stateComputeMode.setProperties(requiresCoherency, largeGrf ? 256 : 128, threadArbitrationPolicy, *defaultHwInfo);
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<PreemptionMode>(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);
}
}

View File

@ -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<FamilyType>::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, *defaultHwInfo);
streamProperties.stateComputeMode.setProperties(false, GrfConfig::LargeGrfNumber, 0u, PreemptionMode::Disabled, *defaultHwInfo);
EncodeComputeMode<FamilyType>::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, *defaultHwInfo, nullptr);
GenCmdList commands;
CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed());

View File

@ -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());
}

View File

@ -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<FamilyType>::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, *defaultHwInfo);
streamProperties.stateComputeMode.setProperties(false, GrfConfig::DefaultGrfNumber, 0u, PreemptionMode::Disabled, *defaultHwInfo);
EncodeComputeMode<FamilyType>::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, *defaultHwInfo, nullptr);
GenCmdList commands;
CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed());
@ -57,8 +57,8 @@ HWTEST2_F(CommandEncodeStatesTest, givenLargeGrfModeProgrammedThenExpectedComman
NEO::EncodeComputeMode<GfxFamily>::adjustPipelineSelect(*cmdContainer, descriptor);
StreamProperties streamProperties{};
streamProperties.stateComputeMode.setProperties(false, 256u, 0u, *defaultHwInfo);
NEO::EncodeComputeMode<GfxFamily>::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, *defaultHwInfo);
streamProperties.stateComputeMode.setProperties(false, 256u, 0u, PreemptionMode::Disabled, *defaultHwInfo);
NEO::EncodeComputeMode<GfxFamily>::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<GfxFamily>::adjustPipelineSelect(*cmdContainer, descriptor);
StreamProperties streamProperties{};
streamProperties.stateComputeMode.largeGrfMode.set(0);
NEO::EncodeComputeMode<GfxFamily>::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, *defaultHwInfo);
NEO::EncodeComputeMode<GfxFamily>::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<GfxFamily>::adjustPipelineSelect(*cmdContainer, descriptor);
StreamProperties streamProperties{};
streamProperties.stateComputeMode.largeGrfMode.set(1);
NEO::EncodeComputeMode<GfxFamily>::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, *defaultHwInfo);
NEO::EncodeComputeMode<GfxFamily>::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<GfxFamily>::adjustPipelineSelect(*cmdContainer, descriptor);
StreamProperties streamProperties{};
streamProperties.stateComputeMode.largeGrfMode.set(1);
NEO::EncodeComputeMode<GfxFamily>::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, *defaultHwInfo);
NEO::EncodeComputeMode<GfxFamily>::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<GfxFamily>::adjustPipelineSelect(*cmdContainer, descriptor);
streamProperties.stateComputeMode.largeGrfMode.set(0);
NEO::EncodeComputeMode<GfxFamily>::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, *defaultHwInfo);
NEO::EncodeComputeMode<GfxFamily>::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, *defaultHwInfo, nullptr);
usedSpaceAfter = cmdContainer->getCommandStream()->getUsed();
ASSERT_GT(usedSpaceAfter, usedSpaceBefore);

View File

@ -384,7 +384,7 @@ HWTEST2_F(CommandEncodeStatesTest, whenProgramComputeModeCommandModeIsCalledThen
streamProperties.stateComputeMode.threadArbitrationPolicy.value = ThreadArbitrationPolicy::AgeBased;
streamProperties.stateComputeMode.threadArbitrationPolicy.isDirty = true;
NEO::EncodeComputeMode<FamilyType>::programComputeModeCommand(*cmdContainer->getCommandStream(),
streamProperties.stateComputeMode, *defaultHwInfo);
streamProperties.stateComputeMode, *defaultHwInfo, nullptr);
if constexpr (TestTraits<gfxCoreFamily>::programComputeModeCommandProgramsThreadArbitrationPolicy) {
GenCmdList commands;
@ -409,7 +409,7 @@ HWTEST2_F(CommandEncodeStatesTest, whenProgramComputeModeCommandModeIsCalledThen
streamProperties.stateComputeMode.threadArbitrationPolicy.value = ThreadArbitrationPolicy::AgeBased;
streamProperties.stateComputeMode.isCoherencyRequired.isDirty = true;
NEO::EncodeComputeMode<FamilyType>::programComputeModeCommand(*cmdContainer->getCommandStream(),
streamProperties.stateComputeMode, *defaultHwInfo);
streamProperties.stateComputeMode, *defaultHwInfo, nullptr);
if constexpr (TestTraits<gfxCoreFamily>::programComputeModeCommandProgramsNonCoherent) {
GenCmdList commands;
@ -438,6 +438,6 @@ HWTEST2_F(CommandEncodeStatesTest, whenGetCmdSizeForComputeModeThenCorrectValueI
UltDeviceFactory deviceFactory{1, 0};
auto &csr = deviceFactory.rootDevices[0]->getUltCommandStreamReceiver<FamilyType>();
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());
}

View File

@ -190,7 +190,7 @@ HWTEST2_F(XeHpcComputeModeRequirements, giventhreadArbitrationPolicyWithoutShare
};
getCsrHw<FamilyType>()->streamProperties.stateComputeMode.setProperties(flags.requiresCoherency, flags.numGrfRequired,
flags.threadArbitrationPolicy, *defaultHwInfo);
flags.threadArbitrationPolicy, PreemptionMode::Disabled, *defaultHwInfo);
flushTask(true);
findCmd(hwInfoConfig.isThreadArbitrationPolicyReportedWithScm()); // first time

View File

@ -212,7 +212,7 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, whenProgrammingStateComputeModeThe
StateComputeModeProperties properties;
auto pLinearStream = std::make_unique<LinearStream>(buffer, sizeof(buffer));
EncodeComputeMode<FamilyType>::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo);
EncodeComputeMode<FamilyType>::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo, nullptr);
auto pScm = reinterpret_cast<STATE_COMPUTE_MODE *>(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<LinearStream>(buffer, sizeof(buffer));
EncodeComputeMode<FamilyType>::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo);
EncodeComputeMode<FamilyType>::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo, nullptr);
pScm = reinterpret_cast<STATE_COMPUTE_MODE *>(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<LinearStream>(buffer, sizeof(buffer));
EncodeComputeMode<FamilyType>::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo);
EncodeComputeMode<FamilyType>::programComputeModeCommand(*pLinearStream, properties, *defaultHwInfo, nullptr);
pScm = reinterpret_cast<STATE_COMPUTE_MODE *>(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<LinearStream>(buffer, sizeof(buffer));
properties.stateComputeMode.setProperties(false, 0, ThreadArbitrationPolicy::AgeBased, *defaultHwInfo);
EncodeComputeMode<FamilyType>::programComputeModeCommand(*pLinearStream, properties.stateComputeMode, *defaultHwInfo);
properties.stateComputeMode.setProperties(false, 0, ThreadArbitrationPolicy::AgeBased, PreemptionMode::Disabled, *defaultHwInfo);
EncodeComputeMode<FamilyType>::programComputeModeCommand(*pLinearStream, properties.stateComputeMode, *defaultHwInfo, nullptr);
auto pScm = reinterpret_cast<STATE_COMPUTE_MODE *>(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<LinearStream>(buffer, sizeof(buffer));
properties.stateComputeMode.setProperties(false, 0, ThreadArbitrationPolicy::RoundRobin, *defaultHwInfo);
EncodeComputeMode<FamilyType>::programComputeModeCommand(*pLinearStream, properties.stateComputeMode, *defaultHwInfo);
properties.stateComputeMode.setProperties(false, 0, ThreadArbitrationPolicy::RoundRobin, PreemptionMode::Disabled, *defaultHwInfo);
EncodeComputeMode<FamilyType>::programComputeModeCommand(*pLinearStream, properties.stateComputeMode, *defaultHwInfo, nullptr);
pScm = reinterpret_cast<STATE_COMPUTE_MODE *>(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<LinearStream>(buffer, sizeof(buffer));
properties.stateComputeMode.setProperties(false, 0, ThreadArbitrationPolicy::RoundRobinAfterDependency, *defaultHwInfo);
EncodeComputeMode<FamilyType>::programComputeModeCommand(*pLinearStream, properties.stateComputeMode, *defaultHwInfo);
properties.stateComputeMode.setProperties(false, 0, ThreadArbitrationPolicy::RoundRobinAfterDependency, PreemptionMode::Disabled, *defaultHwInfo);
EncodeComputeMode<FamilyType>::programComputeModeCommand(*pLinearStream, properties.stateComputeMode, *defaultHwInfo, nullptr);
pScm = reinterpret_cast<STATE_COMPUTE_MODE *>(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<LinearStream>(buffer, sizeof(buffer));
properties.stateComputeMode.setProperties(false, 0, ThreadArbitrationPolicy::NotPresent, *defaultHwInfo);
EncodeComputeMode<FamilyType>::programComputeModeCommand(*pLinearStream, properties.stateComputeMode, *defaultHwInfo);
properties.stateComputeMode.setProperties(false, 0, ThreadArbitrationPolicy::NotPresent, PreemptionMode::Disabled, *defaultHwInfo);
EncodeComputeMode<FamilyType>::programComputeModeCommand(*pLinearStream, properties.stateComputeMode, *defaultHwInfo, nullptr);
pScm = reinterpret_cast<STATE_COMPUTE_MODE *>(pLinearStream->getCpuBase());
EXPECT_EQ(EU_THREAD_SCHEDULING_MODE_OVERRIDE::EU_THREAD_SCHEDULING_MODE_OVERRIDE_HW_DEFAULT, pScm->getEuThreadSchedulingModeOverride());
}

View File

@ -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());