DSPLIB User Guide
DSPLIB_maxIndex_priv.h
Go to the documentation of this file.
1 /******************************************************************************
2  * *
3  * module name :DSPLIB *
4  * *
5  * module descripton :Matrix Multiply Accelerator Library module for C7x+MMA *
6  * *
7  * Copyright (C) 2017-2018 Texas Instruments Incorporated - https://www.ti.com/ *
8  * ALL RIGHTS RESERVED *
9  * *
10  ******************************************************************************/
11 
12 /********************************************************************************
13  * @file DSPLIB_maxIndex_priv.h
14  *
15  * @brief File to hold private parameter of function DSPLIB_maxIndex
16  *
17  * @version 0.1 - Mar 2022 : Initial Version
18  *
19  ********************************************************************************/
20 
21 #ifndef DSPLIB_MAXINDEX_IXX_IXX_OXX_PRIV_H_
22 #define DSPLIB_MAXINDEX_IXX_IXX_OXX_PRIV_H_
23 
24 #include "../common/DSPLIB_utility.h"
25 #include "DSPLIB_maxIndex.h"
26 
32 /*******************************************************************************
33  *
34  * DEFINES
35  *
36  ******************************************************************************/
37 #define SE_PARAM_BASE (0x0000)
38 #define SE_SE0_PARAM_OFFSET (SE_PARAM_BASE)
39 #define SE_SE1_PARAM_OFFSET (SE_SE0_PARAM_OFFSET + SE_PARAM_SIZE)
40 
46 #define DSPLIB_MAXINDEX_IXX_IXX_OXX_PBLOCK_SIZE (1 * SE_PARAM_SIZE + 1 * DSPLIB_PARAM_SIZE + 2 * sizeof(int32_t))
47 
53 typedef DSPLIB_STATUS (*pFxnDSPLIB_maxIndex_exec)(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut);
54 
81 template <typename dataType>
83  const DSPLIB_bufParams1D_t *bufParamsIn,
84  const DSPLIB_bufParams1D_t *bufParamsOut,
85  const DSPLIB_maxIndex_InitArgs *pKerInitArgs);
86 
111 template <typename T, typename TIndex>
112 extern DSPLIB_STATUS DSPLIB_maxIndex_exec_ci(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut);
113 
128 template <typename dataType>
129 extern DSPLIB_STATUS DSPLIB_maxIndex_exec_cn(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut);
130 
134 typedef struct {
142  int32_t blockSize;
145 
146 template <typename T, typename TIndex> struct metadata {
147  // derive c7x vector type from value template and index template
148  typedef typename c7x::make_full_vector<T>::type vec;
149  typedef typename c7x::make_full_vector<TIndex>::type index_vec;
150 
152  index_vec maxIndices; // maxIndices[i] = index of location of maxVals[i]
153 };
154 
170 template <typename T, typename TIndex> metadata<T, TIndex> DSPLIB_maxIndex_loopLogic(size_t length, void *pSrc);
171 #endif /* DSPLIB_MAXINDEX_IXX_IXX_OXX_PRIV_H_ */
172 
173 /* ======================================================================== */
174 /* End of file: DSPLIB_maxIndex.h */
175 /* ======================================================================== */
DSPLIB_STATUS DSPLIB_maxIndex_exec_cn(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
This function is the main execution function for the natural C implementation of the kernel....
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....
#define DSPLIB_MAXINDEX_IXX_IXX_OXX_PBLOCK_SIZE
Macro to define the size of bufPblock array of DSPLIB_maxIndex_PrivArgs structure.
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....
DSPLIB_STATUS(* pFxnDSPLIB_maxIndex_exec)(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
This is a function pointer type that conforms to the declaration of DSPLIB_maxIndex_exec_ci and DSPLI...
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....
DSPLIB_STATUS_NAME DSPLIB_STATUS
Return value for DSPLIB functions.
Definition: DSPLIB_types.h:170
DSPLIB_STATUS_NAME
The enumeration of all status codes.
Definition: DSPLIB_types.h:151
void * DSPLIB_kernelHandle
Handle type for DSPLIB operations.
Definition: DSPLIB_types.h:172
A structure for a 1 dimensional buffer descriptor.
Structure containing the parameters to initialize the kernel.
Structure that is reserved for internal use by the kernel.
pFxnDSPLIB_maxIndex_exec execute
Function pointer to point to the right execution variant between DSPLIB_maxIndex_exec_cn and DSPLIB_m...
int32_t blockSize
Size of input buffer for different batches DSPLIB_maxIndex_init that will be retrieved and used by DS...
c7x::make_full_vector< T >::type vec
c7x::make_full_vector< TIndex >::type index_vec
index_vec maxIndices