MMALIB User Guide
MMALIB_CNN_convolveBias_row_ixX_ixX_oxX.h
Go to the documentation of this file.
1 /******************************************************************************
2 * *
3 * module name :MMALIB *
4 * *
5 * module descripton :Matrix Multiply Accelerator Library module for C7x+MMA *
6 * *
7 * Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/ *
8 * ALL RIGHTS RESERVED *
9 * *
10 ******************************************************************************/
23 #ifndef MMALIB_CNN_CONVOLVEBIAS_ROW_IXX_IXX_OXX_H_
24 #define MMALIB_CNN_CONVOLVEBIAS_ROW_IXX_IXX_OXX_H_
25 
26 #include "../../common/MMALIB_types.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
88 typedef enum
89 {
93 
94 
99 typedef struct
100 {
102  int8_t funcStyle;
104  int32_t No;
107  int32_t inChOffset;
111  int32_t validColsIn;
119  int32_t validRowsIn;
127  int32_t inWidth;
130  int32_t pad;
133  int32_t padLeft;
136  int32_t padRight;
139  int32_t padTop;
142  int32_t padBottom;
146  int32_t maxHeight;
148  int32_t subMChannels;
149 // /*! @brief Scale parameter for output precision */
150 // uint8_t scale;
151 // /*! @brief Shift parameter for output precision */
152 // int32_t shift;
157  int32_t Fr;
159  int32_t Fc;
161  int32_t strideX;
163  int32_t strideY;
165  int32_t dilationX;
167  int32_t dilationY;
169  int32_t bias;
171  uint8_t activationType;
173  int32_t pSatMin;
175  int32_t pSatMax;
178  uint8_t mode;
180  int32_t col;
181 // {
185 
187 
194 typedef struct
195 {
199  int32_t validColsIn; // Width of buffer C
207  int32_t validRowsIn;
210  int32_t col;
212  int32_t subMChannels;
214  int32_t quantMethod;
216  int32_t padFillValue;
218  MMALIB_enableDynamicRange_type enableDynamicRange;
220  MMALIB_initDynamicRange_type initDynamicRange;
221 
223 
224 
229 typedef struct
230 {
234  int32_t validColsOut;
242  int32_t validRowsOut;
247 
249 
260 
261 
286  MMALIB_kernelHandle handle,
287  const MMALIB_bufParams2D_t * src0_addr,
288  const MMALIB_bufParams2D_t * src1_addr,
289  const MMALIB_bufParams2D_t * src2_addr,
290  const MMALIB_bufParams1D_t * src3_addr,
291 // const MMALIB_bufParams2D_t * src4_addr,
292  const MMALIB_bufParams3D_t * dst_addr ,
294 
321  MMALIB_kernelHandle handle,
322  const MMALIB_bufParams2D_t * src0_addr,
323  const MMALIB_bufParams2D_t * src1_addr,
324  const MMALIB_bufParams2D_t * src2_addr,
325  const MMALIB_bufParams1D_t * src3_addr,
326 // const MMALIB_bufParams2D_t * src4_addr,
327  const MMALIB_bufParams3D_t * dst_addr,
329 
386  MMALIB_kernelHandle handle,
387  const void *src0,
388  const void *src1,
389  const void *src2,
390  const void *src3,
391  const uint8_t *src4,
392  void *dst,
395 
396 
416  MMALIB_kernelHandle handle,
417  const void *src0,
418  const void *src1,
419  const void *src2,
420  const void *src3,
421  const uint8_t *src4,
422  void *dst,
424 
444  const MMALIB_bufParams2D_t *src0_addr,
445  const MMALIB_bufParams2D_t *src1_addr,
446  const MMALIB_bufParams3D_t *dst_addr,
450  int32_t iterN,
451  uint64_t *archCycles,
452  uint64_t *estCycles);
453 
455 #ifdef __cplusplus
456 }
457 #endif
458 #endif /* _MMALIB_CNN_CONVOLVEBIAS_ROW_IXX_IXX_OXX_H_ */
459 
460 /* ======================================================================== */
461 /* End of file: MMALIB_CNN_convolveBias_row_ixX_ixX_oxX.h */
462 /* ======================================================================== */
463 
MMALIB_STATUS MMALIB_CNN_convolveBias_row_ixX_ixX_oxX_exec_checkParams(MMALIB_kernelHandle handle, const void *src0, const void *src1, const void *src2, const void *src3, const uint8_t *src4, void *dst, const MMALIB_CNN_convolveBias_row_ixX_ixX_oxX_ExecInArgs *pKerInArgs)
This function checks the parameters and should be called before kernel executuon. It can be called on...
MMALIB_CNN_CONVOLVEBIAS_ROW_IXX_IXX_OXX_STATUS_NAME
Enum to define the error codes.
MMALIB_STATUS MMALIB_CNN_convolveBias_row_ixX_ixX_oxX_init(MMALIB_kernelHandle handle, const MMALIB_bufParams2D_t *src0_addr, const MMALIB_bufParams2D_t *src1_addr, const MMALIB_bufParams2D_t *src2_addr, const MMALIB_bufParams1D_t *src3_addr, const MMALIB_bufParams3D_t *dst_addr, const MMALIB_CNN_convolveBias_row_ixX_ixX_oxX_InitArgs *pKerInitArgs)
This function call is required to initialize the handle. In this function most of the one time operat...
MMALIB_STATUS MMALIB_CNN_convolveBias_row_ixX_ixX_oxX_exec(MMALIB_kernelHandle handle, const void *src0, const void *src1, const void *src2, const void *src3, const uint8_t *src4, void *dst, const MMALIB_CNN_convolveBias_row_ixX_ixX_oxX_ExecInArgs *pKerInArgs, MMALIB_CNN_convolveBias_row_ixX_ixX_oxX_ExecOutArgs *pKerOutArgs)
This function is the main compute function, and performs the convolution primitive (conv + ReLU) for ...
void MMA_CNNLIB_convolveBias_ixX_ixX_oxX_perfEst(const MMALIB_bufParams2D_t *src0_addr, const MMALIB_bufParams2D_t *src1_addr, const MMALIB_bufParams3D_t *dst_addr, MMALIB_CNN_convolveBias_row_ixX_ixX_oxX_InitArgs *pKerInitArgs, const MMALIB_CNN_convolveBias_row_ixX_ixX_oxX_ExecInArgs *pKerInArgs, MMALIB_CNN_convolveBias_row_ixX_ixX_oxX_ExecOutArgs *pKerOutArgs, int32_t iterN, uint64_t *archCycles, uint64_t *estCycles)
This function generates the performance of MMALIB kernels.
int32_t MMALIB_CNN_convolveBias_row_ixX_ixX_oxX_getHandleSize(MMALIB_CNN_convolveBias_row_ixX_ixX_oxX_InitArgs *pKerInitArgs)
This is a query function to calculate the size of internal handle.
MMALIB_STATUS MMALIB_CNN_convolveBias_row_ixX_ixX_oxX_init_checkParams(MMALIB_kernelHandle handle, const MMALIB_bufParams2D_t *src0_addr, const MMALIB_bufParams2D_t *src1_addr, const MMALIB_bufParams2D_t *src2_addr, const MMALIB_bufParams1D_t *src3_addr, const MMALIB_bufParams3D_t *dst_addr, const MMALIB_CNN_convolveBias_row_ixX_ixX_oxX_InitArgs *pKerInitArgs)
This function call is required to initialize the handle. In this function most of the one time operat...
@ MMALIB_CNN_CONVOLVEBIAS_ROW_IXX_IXX_OXX_ERR_SMALL_K
@ MMALIB_CNN_CONVOLVEBIAS_ROW_IXX_IXX_OXX_ERR_MAX
MMALIB_STATUS_NAME
The enumeration of all status codes.
Definition: MMALIB_types.h:152
void * MMALIB_kernelHandle
Handle type for MMALIB operations.
Definition: MMALIB_types.h:262
@ MMALIB_ERROR_MAX
Definition: MMALIB_types.h:167
Structure containing the parameters for input to the execute phase of CNN convolution computation The...
int32_t col
column offset of each row of input feature map enables with a flag in execute phase
int32_t validColsPerRowIn
Valid columns in a row of input feature maps for one call of processing of the kernel for strided con...
int32_t validColsIn
Valid columns in a row of input feature maps for one call of processing of the kernel for non strided...
int32_t validRowsIn
Valid input rows of input feature maps for one call of processing of the kernel for strided convoluti...
int32_t subMChannels
Number of output channels per kernel call in execute phase
MMALIB_enableDynamicRange_type enableDynamicRange
Flag indicating whether to enable dynamic range range (min,max) calculation.
MMALIB_initDynamicRange_type initDynamicRange
Flag indicating whether to reset dynamic range (min,max) calculation at beginning of compute.
Structure containing the parameters for output from the execute phase of CNN convolution computation.
int32_t validRowsOut
Valid output rows of output feature maps for one call of processing of the kernel for strided convolu...
int32_t validColsPerRowOut
Valid columns in a row of output feature maps for one call of processing of the kernel for strided co...
int64_t dynamicRangeMax
Maximum computed value, controlled with MMALIB_CNN_convolve_col_smallNo_ixX_ixX_oxX_ExecInArgs....
int32_t validColsOut
Valid columns out in a row of output feature maps for one call of processing of the kernel for non st...
int64_t dynamicRangeMin
Minimum computed value, controlled with MMALIB_CNN_convolve_col_smallNo_ixX_ixX_oxX_ExecInArgs....
Structure containing the parameters initialization of CNN convolution computation.
int32_t inWidth
Width of each row of input feature map in units of data type
int32_t validColsPerRowIn
Valid columns in a row of input feature maps for one call of processing of the kernel for non strided...
int32_t pad
Pad of each row of input feature map, specify pad only one one side. specific to J7ES
int8_t packetizeMode
packetizeMode is 0 then weights are not packetized. When 1 then they are packetized
int32_t maxHeight
Height of the input feature map in units of data type
uint8_t mode
mode for input feature map in Circular or Linear mode in B matrix
int32_t padBottom
Pad of each row of input feature map, specify pad only on bottom side
int32_t subMChannels
Number of output channels per kernel call
int32_t inChOffset
offset of the input feature maps in B matrix. This is power of 2 for circular buffer and atleast 64 b...
uint8_t activationType
activation RELU, SAT or none for output
int32_t padTop
Pad of each row of input feature map, specify pad only on top side
int32_t validColsIn
Valid columns of input feature maps in B matrix for one call of processing of the kernel for non stri...
int32_t inputPitchPerRow
Valid pitch for each input rows of input feature maps for strided convolution. This is units of bytes
int32_t outputPitchPerRow
Valid output pitch for each output rows of output feature maps for strided convolution....
int32_t bias
bias value in B matrix same as data type of B matrix
int32_t numGroupsPerKernel
Scale parameter for output precision ‍/ uint8_t scale; /!
int32_t validColsOutBottom
Output pixels for stride 1 flow when padBotton > 0
int32_t validRowsIn
Valid input rows of input feature maps for one call of processing of the kernel for strided convoluti...
int32_t padRight
Pad of each row of input feature map, specify pad only on right side
int32_t padLeft
Pad of each row of input feature map, specify pad only on left side
int8_t funcStyle
Variant of the function refer to MMALIB_FUNCTION_STYLE
A structure for a 1 dimensional buffer descriptor.
A structure for a 2 dimensional buffer descriptor.
A structure for a 3 dimensional buffer descriptor.