mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 08:53:55 +08:00
Update StreamProperties
Update ThreadArbitrationPolicy enum. Remove adjustThreadArbitionPolicy from CommandStreamReceiverHw. Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
b25c0e4fc0
commit
573d01f085
@@ -1869,9 +1869,10 @@ void CommandListCoreFamily<gfxCoreFamily>::updateStreamProperties(Kernel &kernel
|
||||
|
||||
auto &kernelAttributes = kernel.getKernelDescriptor().kernelAttributes;
|
||||
auto &neoDevice = *device->getNEODevice();
|
||||
auto threadArbitrationPolicy = NEO::HwHelper::get(hwInfo.platform.eRenderCoreFamily).getDefaultThreadArbitrationPolicy();
|
||||
finalStreamState.stateComputeMode.setProperties(false, kernelAttributes.numGrfRequired, isMultiOsContextCapable,
|
||||
kernelAttributes.flags.useGlobalAtomics,
|
||||
(neoDevice.getNumAvailableDevices() > 1));
|
||||
(neoDevice.getNumAvailableDevices() > 1), threadArbitrationPolicy);
|
||||
if (finalStreamState.stateComputeMode.isDirty()) {
|
||||
NEO::EncodeWA<GfxFamily>::encodeAdditionalPipelineSelect(neoDevice, *commandContainer.getCommandStream(), true);
|
||||
NEO::EncodeComputeMode<GfxFamily>::adjustComputeMode(*commandContainer.getCommandStream(), nullptr, finalStreamState.stateComputeMode);
|
||||
|
||||
@@ -100,7 +100,9 @@ struct EncodeStates {
|
||||
const void *fnDynamicStateHeap,
|
||||
BindlessHeapsHelper *bindlessHeapHelper);
|
||||
|
||||
static void adjustStateComputeMode(LinearStream &csr, uint32_t numGrfRequired, void *const stateComputeModePtr, bool isMultiOsContextCapable, bool requiresCoherency, bool useGlobalAtomics, bool areMultipleSubDevicesInContext);
|
||||
static void adjustStateComputeMode(LinearStream &csr, uint32_t numGrfRequired, void *const stateComputeModePtr,
|
||||
bool isMultiOsContextCapable, bool requiresCoherency, bool useGlobalAtomics,
|
||||
bool areMultipleSubDevicesInContext, uint32_t threadArbitrationPolicy);
|
||||
|
||||
static size_t getAdjustStateComputeModeSize();
|
||||
};
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
|
||||
namespace NEO {
|
||||
template <typename Family>
|
||||
void EncodeStates<Family>::adjustStateComputeMode(LinearStream &csr, uint32_t numGrfRequired, void *const stateComputeModePtr, bool isMultiOsContextCapable, bool requiresCoherency, bool useGlobalAtomics, bool areMultipleSubDevicesInContext) {
|
||||
void EncodeStates<Family>::adjustStateComputeMode(LinearStream &csr, uint32_t numGrfRequired, void *const stateComputeModePtr,
|
||||
bool isMultiOsContextCapable, bool requiresCoherency, bool useGlobalAtomics,
|
||||
bool areMultipleSubDevicesInContext, uint32_t threadArbitrationPolicy) {
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
|
||||
@@ -12,9 +12,11 @@
|
||||
namespace NEO {
|
||||
template <typename Family>
|
||||
void EncodeStates<Family>::adjustStateComputeMode(LinearStream &csr, uint32_t numGrfRequired, void *const stateComputeModePtr,
|
||||
bool isMultiOsContextCapable, bool requiresCoherency, bool useGlobalAtomics, bool areMultipleSubDevicesInContext) {
|
||||
bool isMultiOsContextCapable, bool requiresCoherency, bool useGlobalAtomics,
|
||||
bool areMultipleSubDevicesInContext, uint32_t threadArbitrationPolicy) {
|
||||
StreamProperties properties{};
|
||||
properties.stateComputeMode.setProperties(requiresCoherency, numGrfRequired, isMultiOsContextCapable, useGlobalAtomics, areMultipleSubDevicesInContext);
|
||||
properties.stateComputeMode.setProperties(requiresCoherency, numGrfRequired, isMultiOsContextCapable, useGlobalAtomics,
|
||||
areMultipleSubDevicesInContext, threadArbitrationPolicy);
|
||||
EncodeComputeMode<Family>::adjustComputeMode(csr, stateComputeModePtr, properties.stateComputeMode);
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,6 @@ class CommandStreamReceiverHw : public CommandStreamReceiver {
|
||||
bool isComputeModeNeeded() const;
|
||||
bool isPipelineSelectAlreadyProgrammed() const;
|
||||
void programComputeMode(LinearStream &csr, DispatchFlags &dispatchFlags);
|
||||
void adjustThreadArbitionPolicy(void *const stateComputeMode);
|
||||
|
||||
void waitForTaskCountWithKmdNotifyFallback(uint32_t taskCountToWait, FlushStamp flushStampToWait, bool useQuickKmdSleep, bool forcePowerSavingMode) override;
|
||||
const HardwareInfo &peekHwInfo() const;
|
||||
|
||||
@@ -67,9 +67,6 @@ void CommandStreamReceiverHw<GfxFamily>::programPipelineSelect(LinearStream &com
|
||||
}
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void CommandStreamReceiverHw<GfxFamily>::adjustThreadArbitionPolicy(void *const stateComputeMode) {}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void CommandStreamReceiverHw<GfxFamily>::createScratchSpaceController() {
|
||||
scratchSpaceController = std::make_unique<ScratchSpaceControllerBase>(rootDeviceIndex, executionEnvironment, *internalAllocationStorage.get());
|
||||
|
||||
@@ -20,9 +20,9 @@ void CommandStreamReceiverHw<GfxFamily>::programComputeMode(LinearStream &stream
|
||||
this->lastSentCoherencyRequest = static_cast<int8_t>(dispatchFlags.requiresCoherency);
|
||||
|
||||
auto stateComputeMode = GfxFamily::cmdInitStateComputeMode;
|
||||
adjustThreadArbitionPolicy(&stateComputeMode);
|
||||
EncodeStates<GfxFamily>::adjustStateComputeMode(stream, dispatchFlags.numGrfRequired, &stateComputeMode, isMultiOsContextCapable(), dispatchFlags.requiresCoherency,
|
||||
dispatchFlags.useGlobalAtomics, dispatchFlags.areMultipleSubDevicesInContext);
|
||||
EncodeStates<GfxFamily>::adjustStateComputeMode(
|
||||
stream, dispatchFlags.numGrfRequired, &stateComputeMode, isMultiOsContextCapable(), dispatchFlags.requiresCoherency,
|
||||
dispatchFlags.useGlobalAtomics, dispatchFlags.areMultipleSubDevicesInContext, this->requiredThreadArbitrationPolicy);
|
||||
|
||||
if (csrSizeRequestFlags.hasSharedHandles) {
|
||||
auto pc = stream.getSpaceForCmd<PIPE_CONTROL>();
|
||||
|
||||
@@ -13,7 +13,7 @@ struct StateComputeModeProperties {
|
||||
StreamProperty isCoherencyRequired{};
|
||||
|
||||
void setProperties(bool requiresCoherency, uint32_t numGrfRequired, bool isMultiOsContextCapable,
|
||||
bool useGlobalAtomics, bool areMultipleSubDevicesInContext);
|
||||
bool useGlobalAtomics, bool areMultipleSubDevicesInContext, uint32_t threadArbitrationPolicy);
|
||||
void setProperties(const StateComputeModeProperties &properties);
|
||||
bool isDirty();
|
||||
void clearIsDirty();
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
using namespace NEO;
|
||||
|
||||
void StateComputeModeProperties::setProperties(bool requiresCoherency, uint32_t numGrfRequired, bool isMultiOsContextCapable,
|
||||
bool useGlobalAtomics, bool areMultipleSubDevicesInContext) {
|
||||
bool useGlobalAtomics, bool areMultipleSubDevicesInContext,
|
||||
uint32_t threadArbitrationPolicy) {
|
||||
clearIsDirty();
|
||||
|
||||
int32_t isCoherencyRequired = (requiresCoherency ? 1 : 0);
|
||||
|
||||
@@ -9,13 +9,14 @@
|
||||
|
||||
#include <stdint.h>
|
||||
namespace NEO {
|
||||
|
||||
namespace ThreadArbitrationPolicy {
|
||||
enum {
|
||||
|
||||
enum : uint32_t {
|
||||
AgeBased = 0x0u,
|
||||
RoundRobin = 0x1u,
|
||||
RoundRobinAfterDependency = 0x2u,
|
||||
NotPresent = 0xffffffffu
|
||||
NotPresent = 0xffffu
|
||||
};
|
||||
|
||||
} // namespace ThreadArbitrationPolicy
|
||||
} // namespace NEO
|
||||
|
||||
@@ -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, false, false, false);
|
||||
EncodeStates<FamilyType>::adjustStateComputeMode(*cmdContainer.getCommandStream(), cmdContainer.lastSentNumGrfRequired, nullptr, false, false, false, false, 0);
|
||||
|
||||
auto usedSpaceAfter = cmdContainer.getCommandStream()->getUsed();
|
||||
ASSERT_GT(usedSpaceAfter, usedSpaceBefore);
|
||||
|
||||
@@ -44,7 +44,7 @@ TEST(StreamPropertiesTests, whenPropertyValueIsChangedThenProperStateIsSet) {
|
||||
TEST(StreamPropertiesTests, whenSettingStateComputeModePropertiesThenCorrectValuesAreSet) {
|
||||
StreamProperties properties;
|
||||
for (auto requiresCoherency : ::testing::Bool()) {
|
||||
properties.stateComputeMode.setProperties(requiresCoherency, 0u, false, false, false);
|
||||
properties.stateComputeMode.setProperties(requiresCoherency, 0u, false, false, false, 0u);
|
||||
EXPECT_EQ(requiresCoherency, properties.stateComputeMode.isCoherencyRequired.value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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, false, false, false);
|
||||
NEO::EncodeStates<FamilyType>::adjustStateComputeMode(*cmdContainer->getCommandStream(), 0, nullptr, false, false, false, false, 0);
|
||||
EXPECT_EQ(initialUsed, cmdContainer->getCommandStream()->getUsed());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user