mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Helper for MI_SET_PREDICATE programming
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
c027d2c494
commit
918d7b1da4
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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>;
|
||||
|
@ -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;
|
||||
|
@ -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>;
|
||||
|
@ -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;
|
||||
|
@ -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>;
|
||||
|
@ -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;
|
||||
|
@ -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>;
|
||||
|
@ -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;
|
||||
|
@ -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>;
|
||||
|
@ -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;
|
||||
|
@ -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>;
|
||||
|
@ -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 {
|
||||
|
@ -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>;
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user