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

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