mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-19 16:24:18 +08:00
Extend multi tile debug flags to state compute mode command
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
8502e72c0f
commit
c73f10c2be
@@ -542,6 +542,16 @@ void EncodeComputeMode<Family>::adjustComputeMode(LinearStream &csr, void *const
|
||||
maskBits |= Family::stateComputeModeLargeGrfModeMask;
|
||||
}
|
||||
|
||||
if (DebugManager.flags.ForceMultiGpuAtomics.get() != -1) {
|
||||
stateComputeMode.setForceDisableSupportForMultiGpuAtomics(!!DebugManager.flags.ForceMultiGpuAtomics.get());
|
||||
maskBits |= Family::stateComputeModeForceDisableSupportMultiGpuAtomics;
|
||||
}
|
||||
|
||||
if (DebugManager.flags.ForceMultiGpuPartialWrites.get() != -1) {
|
||||
stateComputeMode.setForceDisableSupportForMultiGpuPartialWrites(!!DebugManager.flags.ForceMultiGpuPartialWrites.get());
|
||||
maskBits |= Family::stateComputeModeForceDisableSupportMultiGpuPartialWrites;
|
||||
}
|
||||
|
||||
stateComputeMode.setMaskBits(maskBits);
|
||||
|
||||
auto buffer = csr.getSpaceForCmd<STATE_COMPUTE_MODE>();
|
||||
|
||||
@@ -24,6 +24,8 @@ struct XeHpCore {
|
||||
|
||||
static constexpr uint32_t stateComputeModeForceNonCoherentMask = (0b11u << 3);
|
||||
static constexpr uint32_t stateComputeModeLargeGrfModeMask = (1u << 15);
|
||||
static constexpr uint32_t stateComputeModeForceDisableSupportMultiGpuPartialWrites = (1u << 2);
|
||||
static constexpr uint32_t stateComputeModeForceDisableSupportMultiGpuAtomics = (1u << 1);
|
||||
|
||||
static constexpr bool isUsingL3Control = true;
|
||||
|
||||
|
||||
@@ -53,6 +53,90 @@ XE_HP_CORE_TEST_F(CommandEncodeXeHpCoreTest, whenProgrammingStateComputeModeThen
|
||||
EXPECT_TRUE(pScm->getLargeGrfMode());
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(CommandEncodeXeHpCoreTest, givenForceDisableMultiAtomicsWhenDebugFlagIsZeroThenExpectForceDisableMultiAtomicsSetToFalse) {
|
||||
using STATE_COMPUTE_MODE = typename FamilyType::STATE_COMPUTE_MODE;
|
||||
|
||||
DebugManagerStateRestore dbgRestorer;
|
||||
DebugManager.flags.ForceMultiGpuAtomics.set(0);
|
||||
|
||||
uint8_t buffer[64]{};
|
||||
|
||||
STATE_COMPUTE_MODE scmCommandTemplate = FamilyType::cmdInitStateComputeMode;
|
||||
scmCommandTemplate.setForceDisableSupportForMultiGpuAtomics(true);
|
||||
|
||||
StateComputeModeProperties properties;
|
||||
LinearStream cmdStream(buffer, sizeof(buffer));
|
||||
EncodeComputeMode<FamilyType>::adjustComputeMode(cmdStream, &scmCommandTemplate, properties, *defaultHwInfo);
|
||||
auto scmCommand = reinterpret_cast<STATE_COMPUTE_MODE *>(cmdStream.getCpuBase());
|
||||
|
||||
uint32_t expectedMaskBits = FamilyType::stateComputeModeForceDisableSupportMultiGpuAtomics;
|
||||
EXPECT_EQ(expectedMaskBits, scmCommand->getMaskBits());
|
||||
EXPECT_FALSE(scmCommand->getForceDisableSupportForMultiGpuAtomics());
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(CommandEncodeXeHpCoreTest, givenForceDisableMultiAtomicsWhenDebugFlagIsOneThenExpectForceDisableMultiAtomicsSetToTrue) {
|
||||
using STATE_COMPUTE_MODE = typename FamilyType::STATE_COMPUTE_MODE;
|
||||
|
||||
DebugManagerStateRestore dbgRestorer;
|
||||
DebugManager.flags.ForceMultiGpuAtomics.set(1);
|
||||
|
||||
uint8_t buffer[64]{};
|
||||
|
||||
STATE_COMPUTE_MODE scmCommandTemplate = FamilyType::cmdInitStateComputeMode;
|
||||
scmCommandTemplate.setForceDisableSupportForMultiGpuAtomics(false);
|
||||
|
||||
StateComputeModeProperties properties;
|
||||
LinearStream cmdStream(buffer, sizeof(buffer));
|
||||
EncodeComputeMode<FamilyType>::adjustComputeMode(cmdStream, &scmCommandTemplate, properties, *defaultHwInfo);
|
||||
auto scmCommand = reinterpret_cast<STATE_COMPUTE_MODE *>(cmdStream.getCpuBase());
|
||||
|
||||
uint32_t expectedMaskBits = FamilyType::stateComputeModeForceDisableSupportMultiGpuAtomics;
|
||||
EXPECT_EQ(expectedMaskBits, scmCommand->getMaskBits());
|
||||
EXPECT_TRUE(scmCommand->getForceDisableSupportForMultiGpuAtomics());
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(CommandEncodeXeHpCoreTest, givenForceDisableMultiPartialWritesWhenDebugFlagIsZeroThenExpectForceDisableMultiPartialWritesSetToFalse) {
|
||||
using STATE_COMPUTE_MODE = typename FamilyType::STATE_COMPUTE_MODE;
|
||||
|
||||
DebugManagerStateRestore dbgRestorer;
|
||||
DebugManager.flags.ForceMultiGpuPartialWrites.set(0);
|
||||
|
||||
uint8_t buffer[64]{};
|
||||
|
||||
STATE_COMPUTE_MODE scmCommandTemplate = FamilyType::cmdInitStateComputeMode;
|
||||
scmCommandTemplate.setForceDisableSupportForMultiGpuPartialWrites(true);
|
||||
|
||||
StateComputeModeProperties properties;
|
||||
LinearStream cmdStream(buffer, sizeof(buffer));
|
||||
EncodeComputeMode<FamilyType>::adjustComputeMode(cmdStream, &scmCommandTemplate, properties, *defaultHwInfo);
|
||||
auto scmCommand = reinterpret_cast<STATE_COMPUTE_MODE *>(cmdStream.getCpuBase());
|
||||
|
||||
uint32_t expectedMaskBits = FamilyType::stateComputeModeForceDisableSupportMultiGpuPartialWrites;
|
||||
EXPECT_EQ(expectedMaskBits, scmCommand->getMaskBits());
|
||||
EXPECT_FALSE(scmCommand->getForceDisableSupportForMultiGpuAtomics());
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(CommandEncodeXeHpCoreTest, givenForceDisableMultiPartialWritesWhenDebugFlagIsOneThenExpectForceDisableMultiPartialWritesSetToTrue) {
|
||||
using STATE_COMPUTE_MODE = typename FamilyType::STATE_COMPUTE_MODE;
|
||||
|
||||
DebugManagerStateRestore dbgRestorer;
|
||||
DebugManager.flags.ForceMultiGpuPartialWrites.set(1);
|
||||
|
||||
uint8_t buffer[64]{};
|
||||
|
||||
STATE_COMPUTE_MODE scmCommandTemplate = FamilyType::cmdInitStateComputeMode;
|
||||
scmCommandTemplate.setForceDisableSupportForMultiGpuPartialWrites(false);
|
||||
|
||||
StateComputeModeProperties properties;
|
||||
LinearStream cmdStream(buffer, sizeof(buffer));
|
||||
EncodeComputeMode<FamilyType>::adjustComputeMode(cmdStream, &scmCommandTemplate, properties, *defaultHwInfo);
|
||||
auto scmCommand = reinterpret_cast<STATE_COMPUTE_MODE *>(cmdStream.getCpuBase());
|
||||
|
||||
uint32_t expectedMaskBits = FamilyType::stateComputeModeForceDisableSupportMultiGpuPartialWrites;
|
||||
EXPECT_EQ(expectedMaskBits, scmCommand->getMaskBits());
|
||||
EXPECT_TRUE(scmCommand->getForceDisableSupportForMultiGpuPartialWrites());
|
||||
}
|
||||
|
||||
struct EncodeKernelGlobalAtomicsFixture : public CommandEncodeStatesFixture, public ::testing::Test {
|
||||
void SetUp() override {
|
||||
DebugManager.flags.CreateMultipleSubDevices.set(2);
|
||||
|
||||
Reference in New Issue
Block a user