mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-19 06:24:51 +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
|
||||
Reference in New Issue
Block a user