DSPLIB User Guide
DSPLIB_maxIndex_ci.cpp File Reference

Go to the source code of this file.

Macros

#define INDEX_UNROLL_FACTOR   2
 

Functions

template<typename dataType >
DSPLIB_STATUS DSPLIB_maxIndex_init_ci (DSPLIB_kernelHandle handle, const DSPLIB_bufParams1D_t *bufParamsIn, const DSPLIB_bufParams1D_t *bufParamsOut, const DSPLIB_maxIndex_InitArgs *pKerInitArgs)
 This function is the initialization function for the C7x implementation of the kernel. The function declaration conforms to the declaration of DSPLIB_maxIndex_init. More...
 
template DSPLIB_STATUS DSPLIB_maxIndex_init_ci< int16_t > (DSPLIB_kernelHandle handle, const DSPLIB_bufParams1D_t *bufParamsIn, const DSPLIB_bufParams1D_t *bufParamsOut, const DSPLIB_maxIndex_InitArgs *pKerInitArgs)
 
template DSPLIB_STATUS DSPLIB_maxIndex_init_ci< uint16_t > (DSPLIB_kernelHandle handle, const DSPLIB_bufParams1D_t *bufParamsIn, const DSPLIB_bufParams1D_t *bufParamsOut, const DSPLIB_maxIndex_InitArgs *pKerInitArgs)
 
template DSPLIB_STATUS DSPLIB_maxIndex_init_ci< int32_t > (DSPLIB_kernelHandle handle, const DSPLIB_bufParams1D_t *bufParamsIn, const DSPLIB_bufParams1D_t *bufParamsOut, const DSPLIB_maxIndex_InitArgs *pKerInitArgs)
 
template DSPLIB_STATUS DSPLIB_maxIndex_init_ci< uint32_t > (DSPLIB_kernelHandle handle, const DSPLIB_bufParams1D_t *bufParamsIn, const DSPLIB_bufParams1D_t *bufParamsOut, const DSPLIB_maxIndex_InitArgs *pKerInitArgs)
 
template DSPLIB_STATUS DSPLIB_maxIndex_init_ci< int8_t > (DSPLIB_kernelHandle handle, const DSPLIB_bufParams1D_t *bufParamsIn, const DSPLIB_bufParams1D_t *bufParamsOut, const DSPLIB_maxIndex_InitArgs *pKerInitArgs)
 
template DSPLIB_STATUS DSPLIB_maxIndex_init_ci< uint8_t > (DSPLIB_kernelHandle handle, const DSPLIB_bufParams1D_t *bufParamsIn, const DSPLIB_bufParams1D_t *bufParamsOut, const DSPLIB_maxIndex_InitArgs *pKerInitArgs)
 
template DSPLIB_STATUS DSPLIB_maxIndex_init_ci< float > (DSPLIB_kernelHandle handle, const DSPLIB_bufParams1D_t *bufParamsIn, const DSPLIB_bufParams1D_t *bufParamsOut, const DSPLIB_maxIndex_InitArgs *pKerInitArgs)
 
template DSPLIB_STATUS DSPLIB_maxIndex_init_ci< double > (DSPLIB_kernelHandle handle, const DSPLIB_bufParams1D_t *bufParamsIn, const DSPLIB_bufParams1D_t *bufParamsOut, const DSPLIB_maxIndex_InitArgs *pKerInitArgs)
 
template<typename T , typename TIndex >
DSPLIB_STATUS DSPLIB_maxIndex_exec_ci (DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
 This function is the main execution function for the C7x implementation of the kernel. The function declaration conforms to the declaration of DSPLIB_maxIndex_exec. More...
 
template DSPLIB_STATUS DSPLIB_maxIndex_exec_ci< int8_t, uint8_t > (DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
 
template DSPLIB_STATUS DSPLIB_maxIndex_exec_ci< uint8_t, uint8_t > (DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
 
template DSPLIB_STATUS DSPLIB_maxIndex_exec_ci< int16_t, uint16_t > (DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
 
template DSPLIB_STATUS DSPLIB_maxIndex_exec_ci< uint16_t, uint16_t > (DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
 
template DSPLIB_STATUS DSPLIB_maxIndex_exec_ci< int32_t, uint32_t > (DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
 
template DSPLIB_STATUS DSPLIB_maxIndex_exec_ci< uint32_t, uint32_t > (DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
 
template DSPLIB_STATUS DSPLIB_maxIndex_exec_ci< float, uint32_t > (DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
 
template DSPLIB_STATUS DSPLIB_maxIndex_exec_ci< double, uint64_t > (DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
 
template<typename T , typename TIndex >
metadata< T, TIndex > DSPLIB_maxIndex_loopLogic (size_t length, void *pSrc)
 This function is the kernel loop helper function for the optimized implementation of the kernel. The function is called within DSPLIB_maxIndex_exec_c and this method performs the loops needed to calculate the vector containing all of the maxIndeximum values. More...
 
template<>
metadata< int8_t, uint8_t > DSPLIB_maxIndex_loopLogic< int8_t, uint8_t > (size_t length, void *pSrc)
 
template<>
metadata< uint8_t, uint8_t > DSPLIB_maxIndex_loopLogic< uint8_t, uint8_t > (size_t length, void *pSrc)
 
template<>
metadata< int16_t, uint16_t > DSPLIB_maxIndex_loopLogic< int16_t, uint16_t > (size_t length, void *pSrc)
 
template<>
metadata< uint16_t, uint16_t > DSPLIB_maxIndex_loopLogic< uint16_t, uint16_t > (size_t length, void *pSrc)
 
template<>
metadata< float, uint32_t > DSPLIB_maxIndex_loopLogic< float, uint32_t > (size_t length, void *pSrc)
 
template<>
metadata< double, uint64_t > DSPLIB_maxIndex_loopLogic< double, uint64_t > (size_t length, void *pSrc)
 

Variables

const c7x::uint_vec jumpFactor = c7x::uint_vec(32)
 
const c7x::uint_vec lastRunOffsets = c7x::uint_vec(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)
 
const c7x::ushort_vec jumpFactorShort = c7x::ushort_vec(64)
 
const c7x::ushort_vec lastRunOffsetsShort
 
const c7x::ulong_vec jumpFactorDp = c7x::ulong_vec(16)
 
const c7x::ulong_vec lastRunOffsetsDp = c7x::ulong_vec(0, 1, 2, 3, 4, 5, 6, 7)
 
const c7x::uchar_vec jumpFactorChar = c7x::uchar_vec(128)
 
const c7x::uchar_vec lastRunOffsetsChar
 

Macro Definition Documentation

◆ INDEX_UNROLL_FACTOR

#define INDEX_UNROLL_FACTOR   2

Definition at line 59 of file DSPLIB_maxIndex_ci.cpp.

Function Documentation

◆ DSPLIB_maxIndex_init_ci()

template<typename dataType >
DSPLIB_STATUS DSPLIB_maxIndex_init_ci ( DSPLIB_kernelHandle  handle,
const DSPLIB_bufParams1D_t bufParamsIn,
const DSPLIB_bufParams1D_t bufParamsOut,
const DSPLIB_maxIndex_InitArgs pKerInitArgs 
)

This function is the initialization function for the C7x implementation of the kernel. The function declaration conforms to the declaration of DSPLIB_maxIndex_init.

This function determines the configuration for the streaming engine and MMA hardware resources based on the function call parameters, and the configuration is saved in bufPBlock array. In the kernel call sequence, DSPLIB_maxIndex_exec_ci would be called later independently by the application. When DSPLIB_maxIndex_exec_ci runs, it merely retrieves the configuration from the bufPBlock and uses it to set up the hardware resources. This arrangement is so that DSPLIB_maxIndex_exec_ci does not lose cycles to determine the hardware configuration.

Parameters
[in]handle: Active handle to the kernel
[in]bufParamsIn: Pointer to the structure containing dimensional information of input buffer
[out]bufParamsOut: Pointer to the structure containing dimensional information of ouput buffer
[in]pKerInitArgs: Pointer to the structure holding init parameters
Returns
Status value indicating success or failure. Refer to DSPLIB_STATUS.

Definition at line 82 of file DSPLIB_maxIndex_ci.cpp.

◆ DSPLIB_maxIndex_init_ci< int16_t >()

template DSPLIB_STATUS DSPLIB_maxIndex_init_ci< int16_t > ( DSPLIB_kernelHandle  handle,
const DSPLIB_bufParams1D_t bufParamsIn,
const DSPLIB_bufParams1D_t bufParamsOut,
const DSPLIB_maxIndex_InitArgs pKerInitArgs 
)

◆ DSPLIB_maxIndex_init_ci< uint16_t >()

template DSPLIB_STATUS DSPLIB_maxIndex_init_ci< uint16_t > ( DSPLIB_kernelHandle  handle,
const DSPLIB_bufParams1D_t bufParamsIn,
const DSPLIB_bufParams1D_t bufParamsOut,
const DSPLIB_maxIndex_InitArgs pKerInitArgs 
)

◆ DSPLIB_maxIndex_init_ci< int32_t >()

template DSPLIB_STATUS DSPLIB_maxIndex_init_ci< int32_t > ( DSPLIB_kernelHandle  handle,
const DSPLIB_bufParams1D_t bufParamsIn,
const DSPLIB_bufParams1D_t bufParamsOut,
const DSPLIB_maxIndex_InitArgs pKerInitArgs 
)

◆ DSPLIB_maxIndex_init_ci< uint32_t >()

template DSPLIB_STATUS DSPLIB_maxIndex_init_ci< uint32_t > ( DSPLIB_kernelHandle  handle,
const DSPLIB_bufParams1D_t bufParamsIn,
const DSPLIB_bufParams1D_t bufParamsOut,
const DSPLIB_maxIndex_InitArgs pKerInitArgs 
)

◆ DSPLIB_maxIndex_init_ci< int8_t >()

template DSPLIB_STATUS DSPLIB_maxIndex_init_ci< int8_t > ( DSPLIB_kernelHandle  handle,
const DSPLIB_bufParams1D_t bufParamsIn,
const DSPLIB_bufParams1D_t bufParamsOut,
const DSPLIB_maxIndex_InitArgs pKerInitArgs 
)

◆ DSPLIB_maxIndex_init_ci< uint8_t >()

template DSPLIB_STATUS DSPLIB_maxIndex_init_ci< uint8_t > ( DSPLIB_kernelHandle  handle,
const DSPLIB_bufParams1D_t bufParamsIn,
const DSPLIB_bufParams1D_t bufParamsOut,
const DSPLIB_maxIndex_InitArgs pKerInitArgs 
)

◆ DSPLIB_maxIndex_init_ci< float >()

template DSPLIB_STATUS DSPLIB_maxIndex_init_ci< float > ( DSPLIB_kernelHandle  handle,
const DSPLIB_bufParams1D_t bufParamsIn,
const DSPLIB_bufParams1D_t bufParamsOut,
const DSPLIB_maxIndex_InitArgs pKerInitArgs 
)

◆ DSPLIB_maxIndex_init_ci< double >()

template DSPLIB_STATUS DSPLIB_maxIndex_init_ci< double > ( DSPLIB_kernelHandle  handle,
const DSPLIB_bufParams1D_t bufParamsIn,
const DSPLIB_bufParams1D_t bufParamsOut,
const DSPLIB_maxIndex_InitArgs pKerInitArgs 
)

◆ DSPLIB_maxIndex_exec_ci()

template<typename T , typename TIndex >
DSPLIB_STATUS DSPLIB_maxIndex_exec_ci ( DSPLIB_kernelHandle  handle,
void *restrict  pIn,
void *restrict  pOut 
)

This function is the main execution function for the C7x implementation of the kernel. The function declaration conforms to the declaration of DSPLIB_maxIndex_exec.

The function uses MMA hardware accelerator to perform the convolution computation. Filter data is loaded into B panel of the MMA from memory using one streaming engine, while the input data is loaded into A vectors of the MMA using the other streaming engine. Result of the compute from MMA C panel is stored into memory using a stream minress generator.

Parameters
[in]handle: Active handle to the kernel
[in]pIn: Pointer to buffer holding the input data
[out]pOut: Pointer to buffer holding the output data
Returns
Status value indicating success or failure. Refer to DSPLIB_STATUS.
Performance Considerations:
For best performance,
  • the input and output data buffers are expected to be in L2 memory
  • the buffer pointers are assumed to be 64-byte aligned

Definition at line 221 of file DSPLIB_maxIndex_ci.cpp.

◆ DSPLIB_maxIndex_exec_ci< int8_t, uint8_t >()

template DSPLIB_STATUS DSPLIB_maxIndex_exec_ci< int8_t, uint8_t > ( DSPLIB_kernelHandle  handle,
void *restrict  pIn,
void *restrict  pOut 
)

◆ DSPLIB_maxIndex_exec_ci< uint8_t, uint8_t >()

template DSPLIB_STATUS DSPLIB_maxIndex_exec_ci< uint8_t, uint8_t > ( DSPLIB_kernelHandle  handle,
void *restrict  pIn,
void *restrict  pOut 
)

◆ DSPLIB_maxIndex_exec_ci< int16_t, uint16_t >()

template DSPLIB_STATUS DSPLIB_maxIndex_exec_ci< int16_t, uint16_t > ( DSPLIB_kernelHandle  handle,
void *restrict  pIn,
void *restrict  pOut 
)

◆ DSPLIB_maxIndex_exec_ci< uint16_t, uint16_t >()

template DSPLIB_STATUS DSPLIB_maxIndex_exec_ci< uint16_t, uint16_t > ( DSPLIB_kernelHandle  handle,
void *restrict  pIn,
void *restrict  pOut 
)

◆ DSPLIB_maxIndex_exec_ci< int32_t, uint32_t >()

template DSPLIB_STATUS DSPLIB_maxIndex_exec_ci< int32_t, uint32_t > ( DSPLIB_kernelHandle  handle,
void *restrict  pIn,
void *restrict  pOut 
)

◆ DSPLIB_maxIndex_exec_ci< uint32_t, uint32_t >()

template DSPLIB_STATUS DSPLIB_maxIndex_exec_ci< uint32_t, uint32_t > ( DSPLIB_kernelHandle  handle,
void *restrict  pIn,
void *restrict  pOut 
)

◆ DSPLIB_maxIndex_exec_ci< float, uint32_t >()

template DSPLIB_STATUS DSPLIB_maxIndex_exec_ci< float, uint32_t > ( DSPLIB_kernelHandle  handle,
void *restrict  pIn,
void *restrict  pOut 
)

◆ DSPLIB_maxIndex_exec_ci< double, uint64_t >()

template DSPLIB_STATUS DSPLIB_maxIndex_exec_ci< double, uint64_t > ( DSPLIB_kernelHandle  handle,
void *restrict  pIn,
void *restrict  pOut 
)

◆ DSPLIB_maxIndex_loopLogic()

template<typename T , typename TIndex >
metadata<T, TIndex> DSPLIB_maxIndex_loopLogic ( size_t  length,
void *  pSrc 
)

This function is the kernel loop helper function for the optimized implementation of the kernel. The function is called within DSPLIB_maxIndex_exec_c and this method performs the loops needed to calculate the vector containing all of the maxIndeximum values.

Parameters
[in]length: length of the input buffer
[in]width: width of one SIMD buffer
[out]pSrc: Pointer to buffer holding the input buffer
Returns
Scalar containing max index.

Definition at line 355 of file DSPLIB_maxIndex_ci.cpp.

◆ DSPLIB_maxIndex_loopLogic< int8_t, uint8_t >()

template<>
metadata<int8_t, uint8_t> DSPLIB_maxIndex_loopLogic< int8_t, uint8_t > ( size_t  length,
void *  pSrc 
)

Definition at line 355 of file DSPLIB_maxIndex_ci.cpp.

◆ DSPLIB_maxIndex_loopLogic< uint8_t, uint8_t >()

template<>
metadata<uint8_t, uint8_t> DSPLIB_maxIndex_loopLogic< uint8_t, uint8_t > ( size_t  length,
void *  pSrc 
)

Definition at line 355 of file DSPLIB_maxIndex_ci.cpp.

◆ DSPLIB_maxIndex_loopLogic< int16_t, uint16_t >()

template<>
metadata<int16_t, uint16_t> DSPLIB_maxIndex_loopLogic< int16_t, uint16_t > ( size_t  length,
void *  pSrc 
)

Definition at line 355 of file DSPLIB_maxIndex_ci.cpp.

◆ DSPLIB_maxIndex_loopLogic< uint16_t, uint16_t >()

template<>
metadata<uint16_t, uint16_t> DSPLIB_maxIndex_loopLogic< uint16_t, uint16_t > ( size_t  length,
void *  pSrc 
)

Definition at line 355 of file DSPLIB_maxIndex_ci.cpp.

◆ DSPLIB_maxIndex_loopLogic< float, uint32_t >()

template<>
metadata<float, uint32_t> DSPLIB_maxIndex_loopLogic< float, uint32_t > ( size_t  length,
void *  pSrc 
)

Definition at line 355 of file DSPLIB_maxIndex_ci.cpp.

◆ DSPLIB_maxIndex_loopLogic< double, uint64_t >()

template<>
metadata<double, uint64_t> DSPLIB_maxIndex_loopLogic< double, uint64_t > ( size_t  length,
void *  pSrc 
)

Definition at line 355 of file DSPLIB_maxIndex_ci.cpp.

Variable Documentation

◆ jumpFactor

const c7x::uint_vec jumpFactor = c7x::uint_vec(32)

Definition at line 61 of file DSPLIB_maxIndex_ci.cpp.

◆ lastRunOffsets

const c7x::uint_vec lastRunOffsets = c7x::uint_vec(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)

Definition at line 62 of file DSPLIB_maxIndex_ci.cpp.

◆ jumpFactorShort

const c7x::ushort_vec jumpFactorShort = c7x::ushort_vec(64)

Definition at line 63 of file DSPLIB_maxIndex_ci.cpp.

◆ lastRunOffsetsShort

const c7x::ushort_vec lastRunOffsetsShort
Initial value:
= c7x::ushort_vec(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31)

Definition at line 66 of file DSPLIB_maxIndex_ci.cpp.

◆ jumpFactorDp

const c7x::ulong_vec jumpFactorDp = c7x::ulong_vec(16)

Definition at line 70 of file DSPLIB_maxIndex_ci.cpp.

◆ lastRunOffsetsDp

const c7x::ulong_vec lastRunOffsetsDp = c7x::ulong_vec(0, 1, 2, 3, 4, 5, 6, 7)

Definition at line 71 of file DSPLIB_maxIndex_ci.cpp.

◆ jumpFactorChar

const c7x::uchar_vec jumpFactorChar = c7x::uchar_vec(128)

Definition at line 72 of file DSPLIB_maxIndex_ci.cpp.

◆ lastRunOffsetsChar

const c7x::uchar_vec lastRunOffsetsChar
Initial value:
= c7x::uchar_vec(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63)

Definition at line 75 of file DSPLIB_maxIndex_ci.cpp.