Add method to set force non coherent

Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
Szymon Morek
2021-07-06 13:29:10 +00:00
committed by Compute-Runtime-Automation
parent ffbfd6cf28
commit 1a7c9e63fa
26 changed files with 61 additions and 47 deletions

View File

@ -2047,7 +2047,7 @@ void CommandListCoreFamily<gfxCoreFamily>::updateStreamProperties(Kernel &kernel
NEO::EncodeWA<GfxFamily>::encodeAdditionalPipelineSelect(neoDevice, *commandContainer.getCommandStream(), true);
if (finalStreamState.stateComputeMode.isDirty()) {
NEO::EncodeComputeMode<GfxFamily>::adjustComputeMode(*commandContainer.getCommandStream(), nullptr, finalStreamState.stateComputeMode);
NEO::EncodeComputeMode<GfxFamily>::adjustComputeMode(*commandContainer.getCommandStream(), nullptr, finalStreamState.stateComputeMode, hwInfo);
}
NEO::EncodeWA<GfxFamily>::encodeAdditionalPipelineSelect(neoDevice, *commandContainer.getCommandStream(), false);
}

View File

@ -71,14 +71,14 @@ GEN11TEST_F(Gen11CoherencyRequirements, GivenSettingsWhenCoherencyRequestedThenH
expectedCmd.setDataDword(DwordBuilder::build(gen11HdcModeRegister::forceNonCoherentEnableBit, true));
overrideCoherencyRequest(true, false);
csr->programComputeMode(stream, flags);
csr->programComputeMode(stream, flags, *defaultHwInfo);
EXPECT_EQ(csr->getCmdSizeForComputeMode(), stream.getUsed());
auto cmd = reinterpret_cast<MI_LOAD_REGISTER_IMM *>(stream.getCpuBase());
EXPECT_TRUE(memcmp(&expectedCmd, cmd, lriSize) == 0);
overrideCoherencyRequest(true, true);
csr->programComputeMode(stream, flags);
csr->programComputeMode(stream, flags, *defaultHwInfo);
EXPECT_EQ(csr->getCmdSizeForComputeMode() * 2, stream.getUsed());
cmd = reinterpret_cast<MI_LOAD_REGISTER_IMM *>(ptrOffset(stream.getCpuBase(), lriSize));

View File

@ -136,7 +136,7 @@ GEN12LPTEST_F(Gen12LpCoherencyRequirements, GivenNoSharedHandlesThenCoherencyCmd
expectedScmCmd.setMaskBits(FamilyType::stateComputeModeForceNonCoherentMask);
overrideCoherencyRequest(true, false, false);
csr->programComputeMode(stream, flags);
csr->programComputeMode(stream, flags, *defaultHwInfo);
EXPECT_EQ(cmdsSize, stream.getUsed());
auto scmCmd = reinterpret_cast<char *>(stream.getCpuBase());
@ -145,7 +145,7 @@ GEN12LPTEST_F(Gen12LpCoherencyRequirements, GivenNoSharedHandlesThenCoherencyCmd
auto startOffset = stream.getUsed();
overrideCoherencyRequest(true, true, false);
csr->programComputeMode(stream, flags);
csr->programComputeMode(stream, flags, *defaultHwInfo);
EXPECT_EQ(cmdsSize * 2, stream.getUsed());
expectedScmCmd.setForceNonCoherent(STATE_COMPUTE_MODE::FORCE_NON_COHERENT_FORCE_DISABLED);
@ -178,7 +178,7 @@ GEN12LPTEST_F(Gen12LpCoherencyRequirements, GivenSharedHandlesThenCoherencyCmdVa
auto expectedPcCmd = FamilyType::cmdInitPipeControl;
overrideCoherencyRequest(true, false, true);
csr->programComputeMode(stream, flags);
csr->programComputeMode(stream, flags, *defaultHwInfo);
EXPECT_EQ(cmdsSize, stream.getUsed());
auto scmCmd = reinterpret_cast<char *>(stream.getCpuBase());
@ -190,7 +190,7 @@ GEN12LPTEST_F(Gen12LpCoherencyRequirements, GivenSharedHandlesThenCoherencyCmdVa
auto startOffset = stream.getUsed();
overrideCoherencyRequest(true, true, true);
csr->programComputeMode(stream, flags);
csr->programComputeMode(stream, flags, *defaultHwInfo);
EXPECT_EQ(cmdsSize * 2, stream.getUsed());
expectedScmCmd.setForceNonCoherent(STATE_COMPUTE_MODE::FORCE_NON_COHERENT_FORCE_DISABLED);

View File

@ -21,7 +21,7 @@ HWTEST2_F(ComputeModeRequirements, givenCsrRequestFlagsWithSharedHandlesWhenComm
auto retSize = getCsrHw<FamilyType>()->getCmdSizeForComputeMode();
EXPECT_EQ(cmdsSize, retSize);
getCsrHw<FamilyType>()->programComputeMode(stream, flags);
getCsrHw<FamilyType>()->programComputeMode(stream, flags, *defaultHwInfo);
EXPECT_EQ(cmdsSize, stream.getUsed());
stream.replaceBuffer(buff, 1024);
@ -29,7 +29,7 @@ HWTEST2_F(ComputeModeRequirements, givenCsrRequestFlagsWithSharedHandlesWhenComm
retSize = getCsrHw<FamilyType>()->getCmdSizeForComputeMode();
EXPECT_EQ(cmdsSize, retSize);
getCsrHw<FamilyType>()->programComputeMode(stream, flags);
getCsrHw<FamilyType>()->programComputeMode(stream, flags, *defaultHwInfo);
EXPECT_EQ(cmdsSize, stream.getUsed());
stream.replaceBuffer(buff, 1024);
@ -37,7 +37,7 @@ HWTEST2_F(ComputeModeRequirements, givenCsrRequestFlagsWithSharedHandlesWhenComm
retSize = getCsrHw<FamilyType>()->getCmdSizeForComputeMode();
EXPECT_EQ(cmdsSize, retSize);
getCsrHw<FamilyType>()->programComputeMode(stream, flags);
getCsrHw<FamilyType>()->programComputeMode(stream, flags, *defaultHwInfo);
EXPECT_EQ(cmdsSize, stream.getUsed());
stream.replaceBuffer(buff, 1024);
@ -45,7 +45,7 @@ HWTEST2_F(ComputeModeRequirements, givenCsrRequestFlagsWithSharedHandlesWhenComm
retSize = getCsrHw<FamilyType>()->getCmdSizeForComputeMode();
EXPECT_EQ(cmdsSize, retSize);
getCsrHw<FamilyType>()->programComputeMode(stream, flags);
getCsrHw<FamilyType>()->programComputeMode(stream, flags, *defaultHwInfo);
EXPECT_EQ(cmdsSize, stream.getUsed());
stream.replaceBuffer(buff, 1024);
@ -53,7 +53,7 @@ HWTEST2_F(ComputeModeRequirements, givenCsrRequestFlagsWithSharedHandlesWhenComm
retSize = getCsrHw<FamilyType>()->getCmdSizeForComputeMode();
EXPECT_EQ(cmdsSize, retSize);
getCsrHw<FamilyType>()->programComputeMode(stream, flags);
getCsrHw<FamilyType>()->programComputeMode(stream, flags, *defaultHwInfo);
EXPECT_EQ(cmdsSize, stream.getUsed());
}
@ -71,7 +71,7 @@ HWTEST2_F(ComputeModeRequirements, givenCsrRequestFlagsWithoutSharedHandlesWhenC
auto retSize = getCsrHw<FamilyType>()->getCmdSizeForComputeMode();
EXPECT_EQ(0u, retSize);
getCsrHw<FamilyType>()->programComputeMode(stream, flags);
getCsrHw<FamilyType>()->programComputeMode(stream, flags, *defaultHwInfo);
EXPECT_EQ(0u, stream.getUsed());
stream.replaceBuffer(buff, 1024);
@ -79,7 +79,7 @@ HWTEST2_F(ComputeModeRequirements, givenCsrRequestFlagsWithoutSharedHandlesWhenC
retSize = getCsrHw<FamilyType>()->getCmdSizeForComputeMode();
EXPECT_EQ(cmdsSize, retSize);
getCsrHw<FamilyType>()->programComputeMode(stream, flags);
getCsrHw<FamilyType>()->programComputeMode(stream, flags, *defaultHwInfo);
EXPECT_EQ(cmdsSize, stream.getUsed());
stream.replaceBuffer(buff, 1024);
@ -87,7 +87,7 @@ HWTEST2_F(ComputeModeRequirements, givenCsrRequestFlagsWithoutSharedHandlesWhenC
retSize = getCsrHw<FamilyType>()->getCmdSizeForComputeMode();
EXPECT_EQ(cmdsSize, retSize);
getCsrHw<FamilyType>()->programComputeMode(stream, flags);
getCsrHw<FamilyType>()->programComputeMode(stream, flags, *defaultHwInfo);
EXPECT_EQ(cmdsSize, stream.getUsed());
stream.replaceBuffer(buff, 1024);
@ -95,7 +95,7 @@ HWTEST2_F(ComputeModeRequirements, givenCsrRequestFlagsWithoutSharedHandlesWhenC
retSize = getCsrHw<FamilyType>()->getCmdSizeForComputeMode();
EXPECT_EQ(cmdsSize, retSize);
getCsrHw<FamilyType>()->programComputeMode(stream, flags);
getCsrHw<FamilyType>()->programComputeMode(stream, flags, *defaultHwInfo);
EXPECT_EQ(cmdsSize, stream.getUsed());
}
@ -115,7 +115,7 @@ HWTEST2_F(ComputeModeRequirements, givenCsrRequestOnEngineCCSWhenCommandSizeIsCa
auto retSize = getCsrHw<FamilyType>()->getCmdSizeForComputeMode();
EXPECT_EQ(0u, retSize);
getCsrHw<FamilyType>()->programComputeMode(stream, flags);
getCsrHw<FamilyType>()->programComputeMode(stream, flags, *defaultHwInfo);
EXPECT_EQ(0u, stream.getUsed());
stream.replaceBuffer(buff, 1024);
@ -123,7 +123,7 @@ HWTEST2_F(ComputeModeRequirements, givenCsrRequestOnEngineCCSWhenCommandSizeIsCa
retSize = getCsrHw<FamilyType>()->getCmdSizeForComputeMode();
EXPECT_EQ(cmdsSize, retSize);
getCsrHw<FamilyType>()->programComputeMode(stream, flags);
getCsrHw<FamilyType>()->programComputeMode(stream, flags, *defaultHwInfo);
EXPECT_EQ(cmdsSize, stream.getUsed());
stream.replaceBuffer(buff, 1024);
@ -131,7 +131,7 @@ HWTEST2_F(ComputeModeRequirements, givenCsrRequestOnEngineCCSWhenCommandSizeIsCa
retSize = getCsrHw<FamilyType>()->getCmdSizeForComputeMode();
EXPECT_EQ(cmdsSize, retSize);
getCsrHw<FamilyType>()->programComputeMode(stream, flags);
getCsrHw<FamilyType>()->programComputeMode(stream, flags, *defaultHwInfo);
EXPECT_EQ(cmdsSize, stream.getUsed());
stream.replaceBuffer(buff, 1024);
@ -139,6 +139,6 @@ HWTEST2_F(ComputeModeRequirements, givenCsrRequestOnEngineCCSWhenCommandSizeIsCa
retSize = getCsrHw<FamilyType>()->getCmdSizeForComputeMode();
EXPECT_EQ(cmdsSize, retSize);
getCsrHw<FamilyType>()->programComputeMode(stream, flags);
getCsrHw<FamilyType>()->programComputeMode(stream, flags, *defaultHwInfo);
EXPECT_EQ(cmdsSize, stream.getUsed());
}

View File

@ -7,6 +7,7 @@
#include "shared/source/command_stream/command_stream_receiver_hw.h"
#include "shared/source/execution_environment/execution_environment.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/helpers/dispatch_flags_helper.h"
#include "opencl/source/platform/platform.h"
@ -26,12 +27,12 @@ GEN8TEST_F(Gen8CoherencyRequirements, WhenMemoryManagerIsInitializedThenNoCohere
auto retSize = csr.getCmdSizeForComputeMode();
EXPECT_EQ(0u, retSize);
csr.programComputeMode(stream, flags);
csr.programComputeMode(stream, flags, *defaultHwInfo);
EXPECT_EQ(0u, stream.getUsed());
flags.requiresCoherency = true;
retSize = csr.getCmdSizeForComputeMode();
EXPECT_EQ(0u, retSize);
csr.programComputeMode(stream, flags);
csr.programComputeMode(stream, flags, *defaultHwInfo);
EXPECT_EQ(0u, stream.getUsed());
}

View File

@ -7,6 +7,7 @@
#include "shared/source/command_stream/command_stream_receiver_hw.h"
#include "shared/source/execution_environment/execution_environment.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/helpers/dispatch_flags_helper.h"
#include "opencl/source/platform/platform.h"
@ -26,12 +27,12 @@ GEN9TEST_F(Gen9CoherencyRequirements, WhenMemoryManagerIsInitializedThenNoCohere
auto retSize = csr.getCmdSizeForComputeMode();
EXPECT_EQ(0u, retSize);
csr.programComputeMode(stream, flags);
csr.programComputeMode(stream, flags, *defaultHwInfo);
EXPECT_EQ(0u, stream.getUsed());
flags.requiresCoherency = true;
retSize = csr.getCmdSizeForComputeMode();
EXPECT_EQ(0u, retSize);
csr.programComputeMode(stream, flags);
csr.programComputeMode(stream, flags, *defaultHwInfo);
EXPECT_EQ(0u, stream.getUsed());
}

View File

@ -109,6 +109,8 @@ uint32_t HwInfoConfigHw<IGFX_UNKNOWN>::getMaxThreadsForWorkgroup(const HardwareI
return 0;
}
template <>
void HwInfoConfigHw<IGFX_UNKNOWN>::setForceNonCoherent(void *const commandPtr, const StateComputeModeProperties &properties) {}
} // namespace NEO
struct DummyHwConfig : HwInfoConfigHw<IGFX_UNKNOWN> {

View File

@ -87,6 +87,9 @@ uint32_t HwInfoConfigHw<IGFX_UNKNOWN>::getMaxThreadsForWorkgroup(const HardwareI
return 0;
}
template <>
void HwInfoConfigHw<IGFX_UNKNOWN>::setForceNonCoherent(void *const commandPtr, const StateComputeModeProperties &properties) {}
HwInfoConfigTestWindows::HwInfoConfigTestWindows() {
this->executionEnvironment = std::make_unique<MockExecutionEnvironment>();
this->rootDeviceEnvironment = std::make_unique<RootDeviceEnvironment>(*executionEnvironment);

View File

@ -103,7 +103,7 @@ struct EncodeStates {
BindlessHeapsHelper *bindlessHeapHelper);
static void adjustStateComputeMode(LinearStream &csr, uint32_t numGrfRequired, void *const stateComputeModePtr,
bool requiresCoherency, uint32_t threadArbitrationPolicy);
bool requiresCoherency, uint32_t threadArbitrationPolicy, const HardwareInfo &hwInfo);
static size_t getAdjustStateComputeModeSize();
};
@ -277,7 +277,7 @@ struct EncodeSurfaceState {
template <typename GfxFamily>
struct EncodeComputeMode {
static void adjustComputeMode(LinearStream &csr, void *const stateComputeModePtr, StateComputeModeProperties &properties);
static void adjustComputeMode(LinearStream &csr, void *const stateComputeModePtr, StateComputeModeProperties &properties, const HardwareInfo &hwInfo);
static void adjustPipelineSelect(CommandContainer &container, const NEO::KernelDescriptor &kernelDescriptor);
};

View File

@ -341,7 +341,7 @@ size_t EncodeDispatchKernel<Family>::estimateEncodeDispatchKernelCmdsSize(Device
}
template <typename Family>
inline void EncodeComputeMode<Family>::adjustComputeMode(LinearStream &csr, void *const stateComputeModePtr, StateComputeModeProperties &properties) {
inline void EncodeComputeMode<Family>::adjustComputeMode(LinearStream &csr, void *const stateComputeModePtr, StateComputeModeProperties &properties, const HardwareInfo &hwInfo) {
}
template <typename Family>

View File

@ -510,7 +510,7 @@ size_t EncodeStateBaseAddress<Family>::getRequiredSizeForStateBaseAddress(Device
}
template <typename Family>
void EncodeComputeMode<Family>::adjustComputeMode(LinearStream &csr, void *const stateComputeModePtr, StateComputeModeProperties &properties) {
void EncodeComputeMode<Family>::adjustComputeMode(LinearStream &csr, void *const stateComputeModePtr, StateComputeModeProperties &properties, const HardwareInfo &hwInfo) {
using STATE_COMPUTE_MODE = typename Family::STATE_COMPUTE_MODE;
using FORCE_NON_COHERENT = typename STATE_COMPUTE_MODE::FORCE_NON_COHERENT;

View File

@ -12,7 +12,7 @@
namespace NEO {
template <typename Family>
inline void EncodeStates<Family>::adjustStateComputeMode(LinearStream &csr, uint32_t numGrfRequired, void *const stateComputeModePtr,
bool requiresCoherency, uint32_t threadArbitrationPolicy) {
bool requiresCoherency, uint32_t threadArbitrationPolicy, const HardwareInfo &hwInfo) {
}
template <typename Family>

View File

@ -12,10 +12,10 @@
namespace NEO {
template <typename Family>
void EncodeStates<Family>::adjustStateComputeMode(LinearStream &csr, uint32_t numGrfRequired, void *const stateComputeModePtr,
bool requiresCoherency, uint32_t threadArbitrationPolicy) {
bool requiresCoherency, uint32_t threadArbitrationPolicy, const HardwareInfo &hwInfo) {
StreamProperties properties{};
properties.stateComputeMode.setProperties(requiresCoherency, numGrfRequired, threadArbitrationPolicy);
EncodeComputeMode<Family>::adjustComputeMode(csr, stateComputeModePtr, properties.stateComputeMode);
EncodeComputeMode<Family>::adjustComputeMode(csr, stateComputeModePtr, properties.stateComputeMode, hwInfo);
}
template <typename Family>

View File

@ -72,7 +72,7 @@ class CommandStreamReceiverHw : public CommandStreamReceiver {
bool isComputeModeNeeded() const;
bool isAdditionalPipeControlNeeded() const;
bool isPipelineSelectAlreadyProgrammed() const;
void programComputeMode(LinearStream &csr, DispatchFlags &dispatchFlags);
void programComputeMode(LinearStream &csr, DispatchFlags &dispatchFlags, const HardwareInfo &hwInfo);
void waitForTaskCountWithKmdNotifyFallback(uint32_t taskCountToWait, FlushStamp flushStampToWait, bool useQuickKmdSleep, bool forcePowerSavingMode) override;
const HardwareInfo &peekHwInfo() const;

View File

@ -331,7 +331,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
}
programHardwareContext(commandStreamCSR);
programComputeMode(commandStreamCSR, dispatchFlags);
programComputeMode(commandStreamCSR, dispatchFlags, device.getHardwareInfo());
programPipelineSelect(commandStreamCSR, dispatchFlags.pipelineSelectArgs);
programL3(commandStreamCSR, dispatchFlags, newL3Config);
programPreamble(commandStreamCSR, device, dispatchFlags, newL3Config);

View File

@ -13,7 +13,7 @@
namespace NEO {
template <typename GfxFamily>
void CommandStreamReceiverHw<GfxFamily>::programComputeMode(LinearStream &stream, DispatchFlags &dispatchFlags) {
void CommandStreamReceiverHw<GfxFamily>::programComputeMode(LinearStream &stream, DispatchFlags &dispatchFlags, const HardwareInfo &hwInfo) {
using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL;
if (isComputeModeNeeded()) {
programAdditionalPipelineSelect(stream, dispatchFlags.pipelineSelectArgs, true);
@ -21,7 +21,7 @@ void CommandStreamReceiverHw<GfxFamily>::programComputeMode(LinearStream &stream
auto stateComputeMode = GfxFamily::cmdInitStateComputeMode;
EncodeStates<GfxFamily>::adjustStateComputeMode(stream, dispatchFlags.numGrfRequired, &stateComputeMode,
dispatchFlags.requiresCoherency, this->requiredThreadArbitrationPolicy);
dispatchFlags.requiresCoherency, this->requiredThreadArbitrationPolicy, hwInfo);
if (csrSizeRequestFlags.hasSharedHandles) {
auto pc = stream.getSpaceForCmd<PIPE_CONTROL>();

View File

@ -25,7 +25,7 @@ size_t CommandStreamReceiverHw<Family>::getCmdSizeForComputeMode() {
}
template <>
void CommandStreamReceiverHw<Family>::programComputeMode(LinearStream &stream, DispatchFlags &dispatchFlags) {
void CommandStreamReceiverHw<Family>::programComputeMode(LinearStream &stream, DispatchFlags &dispatchFlags, const HardwareInfo &hwInfo) {
if (csrSizeRequestFlags.coherencyRequestChanged) {
LriHelper<Family>::program(&stream,
gen11HdcModeRegister::address,

View File

@ -36,7 +36,7 @@ size_t EncodeStates<Family>::getAdjustStateComputeModeSize() {
}
template <>
void EncodeComputeMode<Family>::adjustComputeMode(LinearStream &csr, void *const stateComputeModePtr, StateComputeModeProperties &properties) {
void EncodeComputeMode<Family>::adjustComputeMode(LinearStream &csr, void *const stateComputeModePtr, StateComputeModeProperties &properties, const HardwareInfo &hwInfo) {
using STATE_COMPUTE_MODE = typename Family::STATE_COMPUTE_MODE;
using FORCE_NON_COHERENT = typename STATE_COMPUTE_MODE::FORCE_NON_COHERENT;

View File

@ -21,7 +21,7 @@ size_t CommandStreamReceiverHw<Family>::getCmdSizeForComputeMode() {
}
template <>
void CommandStreamReceiverHw<Family>::programComputeMode(LinearStream &stream, DispatchFlags &dispatchFlags) {
void CommandStreamReceiverHw<Family>::programComputeMode(LinearStream &stream, DispatchFlags &dispatchFlags, const HardwareInfo &hwInfo) {
}
template <>

View File

@ -21,7 +21,7 @@ size_t CommandStreamReceiverHw<Family>::getCmdSizeForComputeMode() {
}
template <>
void CommandStreamReceiverHw<Family>::programComputeMode(LinearStream &stream, DispatchFlags &dispatchFlags) {
void CommandStreamReceiverHw<Family>::programComputeMode(LinearStream &stream, DispatchFlags &dispatchFlags, const HardwareInfo &hwInfo) {
}
template <>

View File

@ -15,6 +15,7 @@
namespace NEO {
struct HardwareInfo;
struct StateComputeModeProperties;
class OSInterface;
class HwInfoConfig;
@ -42,6 +43,7 @@ class HwInfoConfig {
virtual bool isMaxThreadsForWorkgroupWARequired(const HardwareInfo &hwInfo) const = 0;
virtual uint32_t getMaxThreadsForWorkgroupInDSSOrSS(const HardwareInfo &hwInfo, uint32_t maxNumEUsPerSubSlice, uint32_t maxNumEUsPerDualSubSlice) const = 0;
virtual uint32_t getMaxThreadsForWorkgroup(const HardwareInfo &hwInfo, uint32_t maxNumEUsPerSubSlice) const = 0;
virtual void setForceNonCoherent(void *const commandPtr, const StateComputeModeProperties &properties) = 0;
uint32_t threadsPerEu;
};
@ -67,6 +69,7 @@ class HwInfoConfigHw : public HwInfoConfig {
bool isMaxThreadsForWorkgroupWARequired(const HardwareInfo &hwInfo) const override;
uint32_t getMaxThreadsForWorkgroupInDSSOrSS(const HardwareInfo &hwInfo, uint32_t maxNumEUsPerSubSlice, uint32_t maxNumEUsPerDualSubSlice) const override;
uint32_t getMaxThreadsForWorkgroup(const HardwareInfo &hwInfo, uint32_t maxNumEUsPerSubSlice) const override;
void setForceNonCoherent(void *const commandPtr, const StateComputeModeProperties &properties) override;
protected:
HwInfoConfigHw() = default;

View File

@ -95,4 +95,7 @@ uint32_t HwInfoConfigHw<gfxProduct>::getMaxThreadsForWorkgroup(const HardwareInf
uint32_t numThreadsPerEU = hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount;
return maxNumEUsPerSubSlice * numThreadsPerEU;
}
template <PRODUCT_FAMILY gfxProduct>
void HwInfoConfigHw<gfxProduct>::setForceNonCoherent(void *const commandPtr, const StateComputeModeProperties &properties) {}
} // namespace NEO

View File

@ -32,7 +32,7 @@ GEN12LPTEST_F(CommandEncoderTest, givenAdjustStateComputeModeThenStateComputeMod
auto usedSpaceBefore = cmdContainer.getCommandStream()->getUsed();
// Adjust the State Compute Mode which sets FORCE_NON_COHERENT_FORCE_GPU_NON_COHERENT
EncodeStates<FamilyType>::adjustStateComputeMode(*cmdContainer.getCommandStream(), cmdContainer.lastSentNumGrfRequired, nullptr, false, 0);
EncodeStates<FamilyType>::adjustStateComputeMode(*cmdContainer.getCommandStream(), cmdContainer.lastSentNumGrfRequired, nullptr, false, 0, *defaultHwInfo);
auto usedSpaceAfter = cmdContainer.getCommandStream()->getUsed();
ASSERT_GT(usedSpaceAfter, usedSpaceBefore);

View File

@ -7,6 +7,7 @@
#include "shared/source/command_container/command_encoder.h"
#include "shared/source/command_stream/stream_properties.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "test.h"
@ -22,21 +23,21 @@ GEN12LPTEST_F(CommandEncodeGen12LpTest, whenProgrammingStateComputeModeThenPrope
StateComputeModeProperties properties;
auto pLinearStream = std::make_unique<LinearStream>(buffer, sizeof(buffer));
EncodeComputeMode<FamilyType>::adjustComputeMode(*pLinearStream, nullptr, properties);
EncodeComputeMode<FamilyType>::adjustComputeMode(*pLinearStream, nullptr, properties, *defaultHwInfo);
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());
properties.isCoherencyRequired.value = 0;
pLinearStream = std::make_unique<LinearStream>(buffer, sizeof(buffer));
EncodeComputeMode<FamilyType>::adjustComputeMode(*pLinearStream, nullptr, properties);
EncodeComputeMode<FamilyType>::adjustComputeMode(*pLinearStream, nullptr, properties, *defaultHwInfo);
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());
properties.isCoherencyRequired.isDirty = true;
pLinearStream = std::make_unique<LinearStream>(buffer, sizeof(buffer));
EncodeComputeMode<FamilyType>::adjustComputeMode(*pLinearStream, nullptr, properties);
EncodeComputeMode<FamilyType>::adjustComputeMode(*pLinearStream, nullptr, properties, *defaultHwInfo);
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());

View File

@ -26,7 +26,7 @@ XE_HP_CORE_TEST_F(CommandEncodeXeHpCoreTest, whenProgrammingStateComputeModeThen
StateComputeModeProperties properties;
auto pLinearStream = std::make_unique<LinearStream>(buffer, sizeof(buffer));
EncodeComputeMode<FamilyType>::adjustComputeMode(*pLinearStream, nullptr, properties);
EncodeComputeMode<FamilyType>::adjustComputeMode(*pLinearStream, nullptr, properties, *defaultHwInfo);
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());
@ -35,7 +35,7 @@ XE_HP_CORE_TEST_F(CommandEncodeXeHpCoreTest, whenProgrammingStateComputeModeThen
properties.isCoherencyRequired.value = 0;
properties.largeGrfMode.value = 1;
pLinearStream = std::make_unique<LinearStream>(buffer, sizeof(buffer));
EncodeComputeMode<FamilyType>::adjustComputeMode(*pLinearStream, nullptr, properties);
EncodeComputeMode<FamilyType>::adjustComputeMode(*pLinearStream, nullptr, properties, *defaultHwInfo);
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());
@ -44,7 +44,7 @@ XE_HP_CORE_TEST_F(CommandEncodeXeHpCoreTest, whenProgrammingStateComputeModeThen
properties.isCoherencyRequired.isDirty = true;
properties.largeGrfMode.isDirty = true;
pLinearStream = std::make_unique<LinearStream>(buffer, sizeof(buffer));
EncodeComputeMode<FamilyType>::adjustComputeMode(*pLinearStream, nullptr, properties);
EncodeComputeMode<FamilyType>::adjustComputeMode(*pLinearStream, nullptr, properties, *defaultHwInfo);
pScm = reinterpret_cast<STATE_COMPUTE_MODE *>(pLinearStream->getCpuBase());
auto expectedMask = FamilyType::stateComputeModeForceNonCoherentMask |
FamilyType::stateComputeModeLargeGrfModeMask;

View File

@ -295,6 +295,6 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, whenAdjustPipelineSelectIsC
HWTEST2_F(CommandEncodeStatesTest, whenAdjustStateComputeModeIsCalledThenNothingHappens, IsAtMostGen11) {
using PIPELINE_SELECT = typename FamilyType::PIPELINE_SELECT;
auto initialUsed = cmdContainer->getCommandStream()->getUsed();
NEO::EncodeStates<FamilyType>::adjustStateComputeMode(*cmdContainer->getCommandStream(), 0, nullptr, false, 0);
NEO::EncodeStates<FamilyType>::adjustStateComputeMode(*cmdContainer->getCommandStream(), 0, nullptr, false, 0, *defaultHwInfo);
EXPECT_EQ(initialUsed, cmdContainer->getCommandStream()->getUsed());
}