Helper for MI_SET_PREDICATE programming

Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2022-11-08 11:05:43 +00:00
committed by Compute-Runtime-Automation
parent c027d2c494
commit 918d7b1da4
16 changed files with 45 additions and 0 deletions

View File

@ -55,6 +55,12 @@ struct EncodeDispatchKernelArgs {
bool dcFlushEnable = false;
};
enum class MiPredicateType : uint32_t {
Disable = 0,
NoopOnResult2Clear = 1,
NoopOnResult2Set = 2
};
struct EncodeWalkerArgs {
KernelExecutionType kernelExecutionType = KernelExecutionType::Default;
bool requiredSystemFence = false;
@ -165,6 +171,19 @@ struct EncodeMath {
AluRegisters finalResultRegister);
};
template <typename GfxFamily>
struct EncodeMiPredicate {
static void encode(LinearStream &cmdStream, MiPredicateType predicateType);
static constexpr size_t getCmdSize() {
if constexpr (GfxFamily::isUsingMiSetPredicate) {
return sizeof(typename GfxFamily::MI_SET_PREDICATE);
} else {
return 0;
}
}
};
template <typename GfxFamily>
struct EncodeMathMMIO {
using MI_STORE_REGISTER_MEM = typename GfxFamily::MI_STORE_REGISTER_MEM;

View File

@ -975,4 +975,16 @@ size_t EncodeKernelArgsBuffer<Family>::getKernelArgsBufferCmdsSize(const Graphic
template <typename Family>
void EncodeKernelArgsBuffer<Family>::encodeKernelArgsBufferCmds(const GraphicsAllocation *kernelArgsBufferAllocation, LogicalStateHelper *logicalStateHelper) {}
template <typename Family>
void EncodeMiPredicate<Family>::encode(LinearStream &cmdStream, [[maybe_unused]] MiPredicateType predicateType) {
if constexpr (Family::isUsingMiSetPredicate) {
using MI_SET_PREDICATE = typename Family::MI_SET_PREDICATE;
using PREDICATE_ENABLE = typename MI_SET_PREDICATE::PREDICATE_ENABLE;
auto miSetPredicate = Family::cmdInitSetPredicate;
miSetPredicate.setPredicateEnable(static_cast<PREDICATE_ENABLE>(predicateType));
*cmdStream.getSpaceForCmd<MI_SET_PREDICATE>() = miSetPredicate;
}
}
} // namespace NEO

View File

@ -84,6 +84,7 @@ template struct EncodeAtomic<Family>;
template struct EncodeSempahore<Family>;
template struct EncodeBatchBufferStartOrEnd<Family>;
template struct EncodeMiFlushDW<Family>;
template struct EncodeMiPredicate<Family>;
template struct EncodeMemoryPrefetch<Family>;
template struct EncodeWA<Family>;
template struct EncodeMiArbCheck<Family>;

View File

@ -24,6 +24,7 @@ struct Gen11 {
static constexpr bool supportsSampler = true;
static constexpr bool isUsingGenericMediaStateClear = true;
static constexpr bool isUsingMiMemFence = false;
static constexpr bool isUsingMiSetPredicate = false;
struct FrontEndStateSupport {
static constexpr bool scratchSize = true;

View File

@ -124,6 +124,7 @@ template struct EncodeAtomic<Family>;
template struct EncodeSempahore<Family>;
template struct EncodeBatchBufferStartOrEnd<Family>;
template struct EncodeMiFlushDW<Family>;
template struct EncodeMiPredicate<Family>;
template struct EncodeWA<Family>;
template struct EncodeMemoryPrefetch<Family>;
template struct EncodeMiArbCheck<Family>;

View File

@ -26,6 +26,7 @@ struct Gen12Lp {
static constexpr bool isUsingGenericMediaStateClear = true;
static constexpr uint32_t stateComputeModeForceNonCoherentMask = (0b11u << 3);
static constexpr bool isUsingMiMemFence = false;
static constexpr bool isUsingMiSetPredicate = false;
struct FrontEndStateSupport {
static constexpr bool scratchSize = true;

View File

@ -68,6 +68,7 @@ template struct EncodeAtomic<Family>;
template struct EncodeSempahore<Family>;
template struct EncodeBatchBufferStartOrEnd<Family>;
template struct EncodeMiFlushDW<Family>;
template struct EncodeMiPredicate<Family>;
template struct EncodeMemoryPrefetch<Family>;
template struct EncodeWA<Family>;
template struct EncodeMiArbCheck<Family>;

View File

@ -26,6 +26,7 @@ struct Gen8 {
static constexpr bool supportsSampler = true;
static constexpr bool isUsingGenericMediaStateClear = true;
static constexpr bool isUsingMiMemFence = false;
static constexpr bool isUsingMiSetPredicate = false;
struct FrontEndStateSupport {
static constexpr bool scratchSize = true;

View File

@ -69,6 +69,7 @@ template struct EncodeAtomic<Family>;
template struct EncodeSempahore<Family>;
template struct EncodeBatchBufferStartOrEnd<Family>;
template struct EncodeMiFlushDW<Family>;
template struct EncodeMiPredicate<Family>;
template struct EncodeMemoryPrefetch<Family>;
template struct EncodeWA<Family>;
template struct EncodeMiArbCheck<Family>;

View File

@ -25,6 +25,7 @@ struct Gen9 {
static constexpr bool supportsSampler = true;
static constexpr bool isUsingGenericMediaStateClear = true;
static constexpr bool isUsingMiMemFence = false;
static constexpr bool isUsingMiSetPredicate = false;
struct FrontEndStateSupport {
static constexpr bool scratchSize = true;

View File

@ -102,6 +102,7 @@ template struct EncodeAtomic<Family>;
template struct EncodeSempahore<Family>;
template struct EncodeBatchBufferStartOrEnd<Family>;
template struct EncodeMiFlushDW<Family>;
template struct EncodeMiPredicate<Family>;
template struct EncodeMemoryPrefetch<Family>;
template struct EncodeMiArbCheck<Family>;
template struct EncodeWA<Family>;

View File

@ -32,6 +32,7 @@ struct XeHpCore {
static constexpr bool supportsSampler = true;
static constexpr bool isUsingGenericMediaStateClear = true;
static constexpr bool isUsingMiMemFence = false;
static constexpr bool isUsingMiSetPredicate = true;
struct FrontEndStateSupport {
static constexpr bool scratchSize = true;

View File

@ -327,6 +327,7 @@ template struct EncodeAtomic<Family>;
template struct EncodeSempahore<Family>;
template struct EncodeBatchBufferStartOrEnd<Family>;
template struct EncodeMiFlushDW<Family>;
template struct EncodeMiPredicate<Family>;
template struct EncodeMemoryPrefetch<Family>;
template struct EncodeMiArbCheck<Family>;
template struct EncodeWA<Family>;

View File

@ -32,6 +32,7 @@ struct XeHpcCore {
static constexpr bool supportsSampler = false;
static constexpr bool isUsingGenericMediaStateClear = true;
static constexpr bool isUsingMiMemFence = true;
static constexpr bool isUsingMiSetPredicate = true;
struct DataPortBindlessSurfaceExtendedMessageDescriptor {
union {

View File

@ -210,6 +210,7 @@ template struct EncodeAtomic<Family>;
template struct EncodeSempahore<Family>;
template struct EncodeBatchBufferStartOrEnd<Family>;
template struct EncodeMiFlushDW<Family>;
template struct EncodeMiPredicate<Family>;
template struct EncodeMemoryPrefetch<Family>;
template struct EncodeMiArbCheck<Family>;
template struct EncodeWA<Family>;

View File

@ -32,6 +32,7 @@ struct XeHpgCore {
static constexpr bool supportsSampler = true;
static constexpr bool isUsingGenericMediaStateClear = true;
static constexpr bool isUsingMiMemFence = false;
static constexpr bool isUsingMiSetPredicate = true;
struct FrontEndStateSupport {
static constexpr bool scratchSize = true;