SortPayloadVpu#

Fully qualified name: pvaApl::SortPayloadVpu

Defined in public/src/primitive/pvaAplSortPayloadVpu.hpp

template<typename DataType, int Size>
class SortPayloadVpu#

SortPayload primitive template class.

Template Parameters:
  • DataType – Data Type of the input array. Must be one of: uint32_t, int32_t.

  • Size – Number of elements to sort. For 32-bit data type, must be one of: 512, 1024, 2048, 4096, 8192.

Public Functions

inline SortPayloadVpu()#
inline void Init(
DataType *src,
DataType *dst,
SortPayloadContext *context,
)#

Initialize the SortPayload algorithm parameters, setup agens for the Execute method.

The SortPayload primitive treats two consecutive elements as a key-payload pair and sort them based on the key value. Template parameter Size is the number of elements (including key and payload) in the input data. The SortPayload primitive only supports ascending sort.

Parameters:
  • src – Pointer to the src buffer which contains the input data. The input data should be consecutively stored in a 1D array with no pitch. Input buffer size should be at least MIN_INPUT_BUFFER_SIZE.

  • dst – Pointer to the dst buffer where the result is written to. The output data will be stored in a 2D array with width = Size / 8, height = 8, pitch = Size / 8 + 2. Output buffer size should be at least MIN_OUTPUT_BUFFER_SIZE.

  • context – Pointer to the SortPayload algorithm context parameters.

inline void Execute(SortPayloadContext *context)#

Execute the SortPayload algorithm.

Public Static Attributes

static constexpr size_t MIN_INPUT_BUFFER_SIZE{(pva_elementsof(DVTYPEX) + 2) * (Size / pva_elementsof(DVTYPEX)) * sizeof(DataType)}#

Minimum required size in bytes for the input buffer.

Can be used to allocate appropriately sized input buffers or verify buffer sizes with static_assert.

static constexpr size_t MIN_OUTPUT_BUFFER_SIZE{(2 * Size / pva_elementsof(DVTYPEX) + 2) * (pva_elementsof(DVTYPEX) / 2) * sizeof(DataType)}#

Minimum required size in bytes for the output buffer.

Can be used to allocate appropriately sized output buffers or verify buffer sizes with static_assert.