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 - http://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 
85  typedef enum
86  {
88  /* @todo Add more appropriate error codes */
91 
92 #define MMALIB_CONVOLVE_COL_SHIFT_SINGLE 0
93 #define MMALIB_CONVOLVE_COL_SHIFT_PER_GROUP 1
94 
102  typedef struct
103  {
104  int8_t funcStyle;
105  int32_t Ni;
106  int32_t No;
107  int32_t Fr;
108  int32_t Fc;
109  uint8_t shift;
110  int8_t shiftMethod;
111  int32_t strideX;
112  int32_t strideY;
113  int32_t dilationX;
114  int32_t dilationY;
115  int32_t topPad;
116  int32_t bottomPad;
117  int32_t leftPad;
118  int32_t rightPad;
119  uint8_t activationType;
120  int32_t featureWidth;
123  int32_t columnOffset;
124  int32_t inPairOffset;
125  int32_t groupOffset;
126  int32_t pSatMin;
127  int32_t pSatMax;
128  int32_t inChOffset;
129  int32_t outPairOffset;
132 
133 
141  typedef struct
142  {
144  int32_t padFillValue;
145  MMALIB_enableDynamicRange_type enableDynamicRange;
146  MMALIB_initDynamicRange_type initDynamicRange;
148 
149 
157  typedef struct
158  {
159  int32_t validColsOut;
160  int64_t dynamicRangeMin;
161  int64_t dynamicRangeMax;
163 
164 
177 
178 
204  const MMALIB_bufParams3D_t * src0_addr,
205  const MMALIB_bufParams2D_t * src1_addr,
206  const MMALIB_bufParams2D_t * src2_addr,
207  const MMALIB_bufParams1D_t * src3_addr,
208  const MMALIB_bufParams3D_t * dst_addr ,
210 
211 
236  const MMALIB_bufParams3D_t * src0_addr,
237  const MMALIB_bufParams2D_t * src1_addr,
238  const MMALIB_bufParams2D_t * src2_addr,
239  const MMALIB_bufParams1D_t * src3_addr,
240  const MMALIB_bufParams3D_t * dst_addr,
242 
243 
292  const void *src0,
293  const void *src1,
294  const void *src2,
295  const void *src3,
296  const uint8_t *shiftValues,
297  const void *lutValues,
298  void *restrict dst,
301 
302 
328  const void *src0,
329  const void *src1,
330  const void *src2,
331  const void *src3,
332  const uint8_t *shiftValues,
333  const void *lutValues,
334  const void *dst,
336 
337 
366  const MMALIB_bufParams3D_t * src0_addr,
367  const MMALIB_bufParams2D_t * src1_addr,
368  const MMALIB_bufParams2D_t * src2_addr,
369  const MMALIB_bufParams1D_t * src3_addr,
370  const MMALIB_bufParams3D_t * dst_addr,
374  uint64_t *archCycles, uint64_t *estCycles);
375 
377 #ifdef __cplusplus
378 }
379 #endif
380 #endif /* MMALIB_CNN_CONVOLVE_COL_SMALLNO_HIGHPRECISION_POINTWISEPOST_H_ */
381 
382 /* ============================================================================= */
383 /* End of file: MMALIB_CNN_convolve_col_smallNo_highPrecision_pointwisePost.h */
384 /* ============================================================================= */
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 ...
void MMALIB_CNN_convolve_col_smallNo_highPrecision_pointwisePost_perfEst(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, const MMALIB_CNN_convolve_col_smallNo_highPrecision_pointwisePost_ExecInArgs *pExecInArgs, MMALIB_CNN_convolve_col_smallNo_highPrecision_pointwisePost_ExecOutArgs *pExecOutArgs, uint64_t *archCycles, uint64_t *estCycles)
This function estimates the cycles consumed for the kernel execution.
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_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
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.