DSPLIB User Guide
DSPLIB_recip_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_recip_priv.h
14  *
15  * @brief File to hold private parameter of function DSPLIB_recip
16  *
17  * @version 0.1 - Mar 2022 : Initial Version
18  *
19  ********************************************************************************/
20 
21 #ifndef DSPLIB_RECIP_IXX_IXX_OXX_PRIV_H_
22 #define DSPLIB_RECIP_IXX_IXX_OXX_PRIV_H_
23 
24 #include "../common/DSPLIB_utility.h"
25 #include "DSPLIB_recip.h"
26 #include "DSPLIB_types.h"
27 
39 #define DSPLIB_RECIP_IXX_IXX_OXX_PBLOCK_SIZE (2 * SE_PARAM_SIZE + 1 * DSPLIB_PARAM_SIZE + 2 * sizeof(int32_t))
40 
46 typedef DSPLIB_STATUS (*pFxnDSPLIB_recip_exec)(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut);
47 
74 template <typename dataType>
76  const DSPLIB_bufParams1D_t *bufParamsIn,
77  const DSPLIB_bufParams1D_t *bufParamsOut,
78  const DSPLIB_recip_InitArgs *pKerInitArgs);
79 
105 template <typename dataType, int32_t dataIn>
106 extern DSPLIB_STATUS DSPLIB_recip_exec_ci(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut);
107 
122 template <typename dataType, int32_t dataIn>
123 extern DSPLIB_STATUS DSPLIB_recip_exec_cn(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut);
124 
128 typedef struct {
136  int32_t blockSize;
138 
139  // init args dsplib_recip
142 
143 // declare and define permute operation masks
144 /* #if defined(_HOST_BUILD) */
145 
146 /* // clang-format off */
147 /* #if __C7X_VEC_SIZE_BYTES__ == 64 */
148 /* const c7x::uchar_vec DSPLIB_vperm_mask_hstack = c7x::uchar_vec(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
149  * 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,
150  * 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63); */
151 
152 /* const c7x::uchar_vec DSPLIB_vperm_mask_interleave = c7x::uchar_vec(0, 1, 32, 33, 2, 3, 34, 35, 4, 5, 36, 37, 6, 7,
153  * 38, 39, 8, 9, 40, 41, 10, 11, 42, 43, 12, 13, 44, 45, 14, 15, 46, 47, 16, 17, 48, 49, 18, 19, 50, 51, 20, 21, 52, 53,
154  * 22, 23, 54, 55, 24, 25, 56, 57, 26, 27, 58, 59, 28, 29, 60, 61, 30, 31, 62, 63); */
155 
156 /* #elif __C7X_VEC_SIZE_BYTES__ == 32 */
157 /* const c7x::uchar_vec DSPLIB_vperm_mask_hstack = c7x::uchar_vec(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
158  * 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31); */
159 
160 /* const c7x::uchar_vec DSPLIB_vperm_mask_interleave = c7x::uchar_vec(0, 1, 16, 17, 2, 3, 18, 19, 4, 5, 20, 21, 6, 7,
161  * 22, 23, 8, 9, 24, 25, 10, 11, 26, 27, 12, 13, 28, 29, 14, 15, 30, 31); */
162 
163 /* #endif /\* #if __C7X_VEC_SIZE_BYTES__ *\/ */
164 
165 /* #else /\* not host build *\/ */
166 /* #if __C7X_VEC_SIZE_BYTES__ == 64 */
167 /* const c7x::uchar_vec DSPLIB_vperm_mask_hstack = (const c7x::uchar_vec)(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
168  * 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,
169  * 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63); */
170 
171 /* const c7x::uchar_vec DSPLIB_vperm_mask_interleave = (const c7x::uchar_vec)(0, 1, 32, 33, 2, 3, 34, 35, 4, 5, 36, 37,
172  * 6, 7, 38, 39, 8, 9, 40, 41, 10, 11, 42, 43, 12, 13, 44, 45, 14, 15, 46, 47, 16, 17, 48, 49, 18, 19, 50, 51, 20, 21,
173  * 52, 53, 22, 23, 54, 55, 24, 25, 56, 57, 26, 27, 58, 59, 28, 29, 60, 61, 30, 31, 62, 63); */
174 
175 /* #elif __C7X_VEC_SIZE_BYTES__ == 32 */
176 /* const c7x::uchar_vec DSPLIB_vperm_mask_hstack = (const c7x::uchar_vec)(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
177  * 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31); */
178 
179 /* const c7x::uchar_vec DSPLIB_vperm_mask_interleave = (const c7x::uchar_vec)(0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21,
180  * 24, 25, 28, 29, 2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31); */
181 
182 /* #endif /\* #if __C7X_VEC_SIZE_BYTES__ *\/ */
183 
184 /* #endif /\* _HOST_BUILD *\/ */
185 /* // clang-format on */
186 
206 
207 #endif /* DSPLIB_RECIP_IXX_IXX_OXX_PRIV_H_ */
208 
209 /* ======================================================================== */
210 /* End of file: DSPLIB_recip.h */
211 /* ======================================================================== */
#define DSPLIB_RECIP_IXX_IXX_OXX_PBLOCK_SIZE
Macro to define the size of bufPblock array of DSPLIB_recip_PrivArgs structure.
DSPLIB_STATUS DSPLIB_recip_init_ci(DSPLIB_kernelHandle handle, const DSPLIB_bufParams1D_t *bufParamsIn, const DSPLIB_bufParams1D_t *bufParamsOut, const DSPLIB_recip_InitArgs *pKerInitArgs)
This function is the initialization function for the C7x implementation of the kernel....
DSPLIB_STATUS DSPLIB_recip_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(* pFxnDSPLIB_recip_exec)(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
This is a function pointer type that conforms to the declaration of DSPLIB_recip_exec_ci and DSPLIB_r...
DSPLIB_STATUS DSPLIB_recip_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_recip_init_cn(DSPLIB_kernelHandle handle, DSPLIB_bufParams2D_t *bufParamsIn, DSPLIB_bufParams2D_t *bufParamsOut)
This function is the initialization function for the natural C 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.
A structure for a 2 dimensional buffer descriptor.
Structure containing the parameters to initialize the kernel.
Definition: DSPLIB_recip.h:120
Structure that is reserved for internal use by the kernel.
int32_t blockSize
Size of input buffer for different batches DSPLIB_recip_init that will be retrieved and used by DSPLI...
pFxnDSPLIB_recip_exec execute
Function pointer to point to the right execution variant between DSPLIB_recip_exec_cn and DSPLIB_reci...
DSPLIB_recip_InitArgs initArgs