refactor: reorganize command encode classes 6/n

- unify programBarrierEnable

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2024-11-13 10:04:45 +00:00
committed by Compute-Runtime-Automation
parent 7bf22ed33e
commit 71c6bfc439
3 changed files with 19 additions and 38 deletions

View File

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