MMALIB User Guide
MMALIB_CNN_convolve_col_smallNo_highPrecision_pointwisePost.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 - https://www.ti.com/ *
8  * ALL RIGHTS RESERVED *
9  * *
10  ******************************************************************************/
11 
12 /********************************************************************************
13  * @file MMALIB_CNN_convolve_col_smallNo_highPrecision_pointwisePost.h
14  *
15  * @brief Public header file for MMALIB_CNN_convolve_col_smallNo_highPrecision_pointwisePost
16  * function
17  *
18  * @version 0.1 - Feb 2018 : Initial Version
19  *
20  ********************************************************************************/
21 
22 #ifndef MMALIB_CNN_CONVOLVE_COL_SMALLNO_HIGHPRECISION_POINTWISEPOST_H_
23 #define MMALIB_CNN_CONVOLVE_COL_SMALLNO_HIGHPRECISION_POINTWISEPOST_H_
24 
25 #include "../../common/MMALIB_types.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 // MMALIB-1103: Macro to enable/disable src1_addr bufParams check for splitGroups = 1 with an odd numGroupsPerKernel
33 #define ENABLE_FEATURE_MAP_DIM_SPLIT_GROUPS_ODD_CHECK 0
34 
88  typedef enum
89  {
91  /* @todo Add more appropriate error codes */
94 
95 #define MMALIB_CONVOLVE_COL_SHIFT_PER_GROUP 1
96 
104  typedef struct
105  {
106  int8_t funcStyle;
107  int32_t Ni;
108  int32_t No;
109  int32_t Fr;
110  int32_t Fc;
111  uint8_t shift;
112  int8_t shiftMethod;
113  int32_t strideX;
114  int32_t strideY;
115  int32_t dilationX;
116  int32_t dilationY;
117  int32_t topPad;
118  int32_t bottomPad;
119  int32_t leftPad;
120  int32_t rightPad;
121 #if defined(__C7100__)
122  int32_t bias;
123  int32_t biasDataType;
124  int32_t numBiasVals;
125 #endif
126  uint8_t activationType;
127  int32_t featureWidth;
130  int32_t columnOffset;
131  int32_t inPairOffset;
132 #if defined(MMALIB_CONVOLVE_COL_IN_KERNEL_PADDING)
133  int32_t groupOffset;
134 #endif
135 #if defined(MMALIB_ENABLE_DYNAMIC_RANGE_TRACKING)
136  int32_t pSatMin;
137  int32_t pSatMax;
138 #endif
139  int32_t inChOffset;
140  int32_t outPairOffset;
143 
144 
152  typedef struct
153  {
155  int32_t padFillValue;
156 #if defined(MMALIB_ENABLE_DYNAMIC_RANGE_TRACKING)
159 #endif
161 
162 
170  typedef struct
171  {
172  int32_t validColsOut;
173 #if defined(MMALIB_ENABLE_DYNAMIC_RANGE_TRACKING)
174  int64_t dynamicRangeMin;
175  int64_t dynamicRangeMax;
176 #endif
178 
179 
192 
193 
219  const MMALIB_bufParams3D_t * src0_addr,
220  const MMALIB_bufParams2D_t * src1_addr,
221  const MMALIB_bufParams2D_t * src2_addr,
222  const MMALIB_bufParams1D_t * src3_addr,
223  const MMALIB_bufParams3D_t * dst_addr ,
225 
226 
251  const MMALIB_bufParams3D_t * src0_addr,
252  const MMALIB_bufParams2D_t * src1_addr,
253  const MMALIB_bufParams2D_t * src2_addr,
254  const MMALIB_bufParams1D_t * src3_addr,
255  const MMALIB_bufParams3D_t * dst_addr,
257 
258 
306  const void *src0,
307  const void *src1,
308  const void *src2,
309  const void *src3,
310  const uint8_t *shiftValues,
311  const void *lutValues,
312  void *restrict dst,
315 
316 
342  const void *src0,
343  const void *src1,
344  const void *src2,
345  const void *src3,
346  const uint8_t *shiftValues,
347  const void *lutValues,
348  const void *dst,
350 
351 
379 // void MMALIB_CNN_convolve_col_smallNo_highPrecision_pointwisePost_perfEst( MMALIB_kernelHandle handle,
380 // const MMALIB_bufParams3D_t * src0_addr,
381 // const MMALIB_bufParams2D_t * src1_addr,
382 // const MMALIB_bufParams2D_t * src2_addr,
383 // const MMALIB_bufParams1D_t * src3_addr,
384 // const MMALIB_bufParams3D_t * dst_addr,
385 // const MMALIB_CNN_convolve_col_smallNo_highPrecision_pointwisePost_InitArgs *pKerInitArgs,
386 // const MMALIB_CNN_convolve_col_smallNo_highPrecision_pointwisePost_ExecInArgs *pExecInArgs,
387 // MMALIB_CNN_convolve_col_smallNo_highPrecision_pointwisePost_ExecOutArgs *pExecOutArgs,
388 // uint64_t *archCycles, uint64_t *estCycles);
389 
391 #ifdef __cplusplus
392 }
393 #endif
394 #endif /* MMALIB_CNN_CONVOLVE_COL_SMALLNO_HIGHPRECISION_POINTWISEPOST_H_ */
395 
396 /* ============================================================================= */
397 /* End of file: MMALIB_CNN_convolve_col_smallNo_highPrecision_pointwisePost.h */
398 /* ============================================================================= */
MMALIB_CNN_CONVOLVE_COL_SMALLNO_HIGHPRECISION_POINTWISEPOST_STATUS_NAME
Enumeration for different error codes for MMALIB_CNN_convolve_col_smallNo_highPrecision_pointwisePost...
MMALIB_STATUS MMALIB_CNN_convolve_col_smallNo_highPrecision_pointwisePost_exec(MMALIB_kernelHandle handle, const void *src0, const void *src1, const void *src2, const void *src3, const uint8_t *shiftValues, const void *lutValues, void *restrict dst, const MMALIB_CNN_convolve_col_smallNo_highPrecision_pointwisePost_ExecInArgs *pKerInArgs, MMALIB_CNN_convolve_col_smallNo_highPrecision_pointwisePost_ExecOutArgs *pKerOutArgs)
This function is the main compute function, and performs the convolution primitive (conv + ReLU) for ...
MMALIB_STATUS MMALIB_CNN_convolve_col_smallNo_highPrecision_pointwisePost_init(MMALIB_kernelHandle handle, const MMALIB_bufParams3D_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_convolve_col_smallNo_highPrecision_pointwisePost_InitArgs *pKerInitArgs)
This function call is required to initialize the handle. In this function most of the one time operat...
MMALIB_STATUS MMALIB_CNN_convolve_col_smallNo_highPrecision_pointwisePost_exec_checkParams(MMALIB_kernelHandle handle, const void *src0, const void *src1, const void *src2, const void *src3, const uint8_t *shiftValues, const void *lutValues, const void *dst, const MMALIB_CNN_convolve_col_smallNo_highPrecision_pointwisePost_ExecInArgs *pKerInArgs)
This function checks the parameters and should be called before kernel execution. It can be called on...
int32_t MMALIB_CNN_convolve_col_smallNo_highPrecision_pointwisePost_getHandleSize(MMALIB_CNN_convolve_col_smallNo_highPrecision_pointwisePost_InitArgs *pKerInitArgs)
This is a query function to kernel to get the size of internal handle.
MMALIB_STATUS MMALIB_CNN_convolve_col_smallNo_highPrecision_pointwisePost_init_checkParams(MMALIB_kernelHandle handle, const MMALIB_bufParams3D_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_convolve_col_smallNo_highPrecision_pointwisePost_InitArgs *pKerInitArgs)
This function checks the parameters and should be called before kernel execution. It can be called on...
MMALIB_enableDynamicRange_type_e
The enumeration of possible dynamic range enable settings.
MMALIB_STATUS_NAME
The enumeration of all status codes.
Definition: MMALIB_types.h:152
MMALIB_initDynamicRange_type_e
The enumeration of possible dynamic range reset options.
void * MMALIB_kernelHandle
Handle type for MMALIB operations.
Definition: MMALIB_types.h:265
@ MMALIB_ERROR_MAX
Definition: MMALIB_types.h:169
This structure holds all the execution input parameters for the CNN column based convolution kernel.
MMALIB_initDynamicRange_type initDynamicRange
Flag indicating whether to reset dynamic range (min,max) calculation at beginning of compute.
MMALIB_enableDynamicRange_type enableDynamicRange
Flag indicating whether to enable dynamic range range (min,max) calculation.
This structure holds all the runtime output parameters for CNN column based convolution kernel.
int64_t dynamicRangeMin
Minimum computed value, controlled with MMALIB_CNN_convolve_col_smallNo_highPrecision_pointwisePost_E...
int64_t dynamicRangeMax
Maximum computed value, controlled with MMALIB_CNN_convolve_col_smallNo_highPrecision_pointwisePost_E...
This structure holds all the initialization parameters for CNN column based convolution kernel.
int32_t outPairOffset
Distance, in elements, between the output of the even- and odd-numbered output feature map block colu...
int8_t shiftMethod
Control behavior of MMALIB_CNN_convolve_col_smallNo_highPrecision_pointwisePost_InitArgs....
int32_t inPairOffset
Distance, in elements, between the even- and odd-numbered input feature map block columns (i....
int32_t blockFeatureHeight
Number of rows from the input feature map to be processed, without pad.
int32_t columnOffset
Distance, in elements, between starting points of even-numbered input feature map block columns (0,...
A structure for a 1 dimensional buffer descriptor.
A structure for a 2 dimensional buffer descriptor.
A structure for a 3 dimensional buffer descriptor.