mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
refactor: reorganize command encode classes 6/n
- unify programBarrierEnable Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
7bf22ed33e
commit
71c6bfc439
@@ -8,6 +8,7 @@
|
||||
#include "shared/source/command_container/command_encoder.h"
|
||||
#include "shared/source/command_stream/linear_stream.h"
|
||||
#include "shared/source/memory_manager/graphics_allocation.h"
|
||||
#include "shared/source/utilities/lookup_array.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
@@ -37,4 +38,22 @@ inline void EncodeAtomic<Family>::setMiAtomicAddress(MI_ATOMIC &atomic, uint64_t
|
||||
atomic.setMemoryAddress(writeAddress);
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
template <typename InterfaceDescriptorType>
|
||||
void EncodeDispatchKernel<Family>::programBarrierEnable(InterfaceDescriptorType &interfaceDescriptor,
|
||||
uint32_t value,
|
||||
const HardwareInfo &hwInfo) {
|
||||
using BARRIERS = typename InterfaceDescriptorType::NUMBER_OF_BARRIERS;
|
||||
static const LookupArray<uint32_t, BARRIERS, 8> barrierLookupArray({{{0, BARRIERS::NUMBER_OF_BARRIERS_NONE},
|
||||
{1, BARRIERS::NUMBER_OF_BARRIERS_B1},
|
||||
{2, BARRIERS::NUMBER_OF_BARRIERS_B2},
|
||||
{4, BARRIERS::NUMBER_OF_BARRIERS_B4},
|
||||
{8, BARRIERS::NUMBER_OF_BARRIERS_B8},
|
||||
{16, BARRIERS::NUMBER_OF_BARRIERS_B16},
|
||||
{24, BARRIERS::NUMBER_OF_BARRIERS_B24},
|
||||
{32, BARRIERS::NUMBER_OF_BARRIERS_B32}}});
|
||||
BARRIERS numBarriers = barrierLookupArray.lookUp(value);
|
||||
interfaceDescriptor.setNumberOfBarriers(numBarriers);
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
@@ -17,7 +17,6 @@
|
||||
#include "shared/source/helpers/constants.h"
|
||||
#include "shared/source/kernel/grf_config.h"
|
||||
#include "shared/source/release_helper/release_helper.h"
|
||||
#include "shared/source/utilities/lookup_array.h"
|
||||
#include "shared/source/xe2_hpg_core/hw_cmds_base.h"
|
||||
|
||||
using Family = NEO::Xe2HpgCoreFamily;
|
||||
@@ -128,24 +127,6 @@ void EncodeMemoryPrefetch<Family>::programMemoryPrefetch(LinearStream &commandSt
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
template <>
|
||||
void EncodeDispatchKernel<Family>::programBarrierEnable(INTERFACE_DESCRIPTOR_DATA &interfaceDescriptor,
|
||||
uint32_t value,
|
||||
const HardwareInfo &hwInfo) {
|
||||
using BARRIERS = INTERFACE_DESCRIPTOR_DATA::NUMBER_OF_BARRIERS;
|
||||
static const LookupArray<uint32_t, BARRIERS, 8> barrierLookupArray({{{0, BARRIERS::NUMBER_OF_BARRIERS_NONE},
|
||||
{1, BARRIERS::NUMBER_OF_BARRIERS_B1},
|
||||
{2, BARRIERS::NUMBER_OF_BARRIERS_B2},
|
||||
{4, BARRIERS::NUMBER_OF_BARRIERS_B4},
|
||||
{8, BARRIERS::NUMBER_OF_BARRIERS_B8},
|
||||
{16, BARRIERS::NUMBER_OF_BARRIERS_B16},
|
||||
{24, BARRIERS::NUMBER_OF_BARRIERS_B24},
|
||||
{32, BARRIERS::NUMBER_OF_BARRIERS_B32}}});
|
||||
BARRIERS numBarriers = barrierLookupArray.lookUp(value);
|
||||
interfaceDescriptor.setNumberOfBarriers(numBarriers);
|
||||
}
|
||||
|
||||
template <>
|
||||
void EncodeSurfaceState<Family>::setAuxParamsForMCSCCS(R_SURFACE_STATE *surfaceState, const ReleaseHelper *releaseHelper) {
|
||||
if (releaseHelper && releaseHelper->isAuxSurfaceModeOverrideRequired())
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include "shared/source/helpers/constants.h"
|
||||
#include "shared/source/kernel/grf_config.h"
|
||||
#include "shared/source/release_helper/release_helper.h"
|
||||
#include "shared/source/utilities/lookup_array.h"
|
||||
#include "shared/source/xe_hpc_core/hw_cmds_xe_hpc_core_base.h"
|
||||
|
||||
using Family = NEO::XeHpcCoreFamily;
|
||||
@@ -135,24 +134,6 @@ inline void EncodeMiFlushDW<Family>::adjust(MI_FLUSH_DW *miFlushDwCmd, const Pro
|
||||
miFlushDwCmd->setFlushLlc(1);
|
||||
}
|
||||
|
||||
template <>
|
||||
template <>
|
||||
void EncodeDispatchKernel<Family>::programBarrierEnable(INTERFACE_DESCRIPTOR_DATA &interfaceDescriptor,
|
||||
uint32_t value,
|
||||
const HardwareInfo &hwInfo) {
|
||||
using BARRIERS = INTERFACE_DESCRIPTOR_DATA::NUMBER_OF_BARRIERS;
|
||||
static const LookupArray<uint32_t, BARRIERS, 8> barrierLookupArray({{{0, BARRIERS::NUMBER_OF_BARRIERS_NONE},
|
||||
{1, BARRIERS::NUMBER_OF_BARRIERS_B1},
|
||||
{2, BARRIERS::NUMBER_OF_BARRIERS_B2},
|
||||
{4, BARRIERS::NUMBER_OF_BARRIERS_B4},
|
||||
{8, BARRIERS::NUMBER_OF_BARRIERS_B8},
|
||||
{16, BARRIERS::NUMBER_OF_BARRIERS_B16},
|
||||
{24, BARRIERS::NUMBER_OF_BARRIERS_B24},
|
||||
{32, BARRIERS::NUMBER_OF_BARRIERS_B32}}});
|
||||
BARRIERS numBarriers = barrierLookupArray.lookUp(value);
|
||||
interfaceDescriptor.setNumberOfBarriers(numBarriers);
|
||||
}
|
||||
|
||||
template <>
|
||||
void EncodeDispatchKernel<Family>::adjustBindingTablePrefetch(INTERFACE_DESCRIPTOR_DATA &interfaceDescriptor, uint32_t samplerCount, uint32_t bindingTableEntryCount) {
|
||||
auto enablePrefetch = EncodeSurfaceState<Family>::doBindingTablePrefetch();
|
||||
|
||||
Reference in New Issue
Block a user