MMALIB User Guide
MMALIB_CNN_pixelShuffle_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_PIXELSHUFFLE_ROW_IXX_IXX_OXX_H_
24 #define MMALIB_CNN_PIXELSHUFFLE_ROW_IXX_IXX_OXX_H_
25 
26 #include "../../common/MMALIB_types.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
56 /* @{ */
57 
61 typedef enum {
66 
71 typedef struct {
73  int8_t funcStyle;
75  int32_t No;
78  int32_t inChOffset;
99  int32_t validColsIn;
107  int32_t validRowsIn;
116  int32_t inWidth;
119  int32_t pad;
121  int32_t maxHeight;
136  int32_t subMChannels;
138  int32_t shift;
140  int32_t Fr;
142  int32_t Fc;
144  int32_t strideX;
146  int32_t strideY;
148  int32_t dilationX;
150  int32_t dilationY;
152  int32_t upscaleFactor;
154  int32_t bias;
156  uint8_t activationType;
159  uint8_t mode;
161 
167 typedef struct {
173  int32_t validColsIn;
183  int32_t validRowsIn;
187  int32_t pad;
190  int32_t subMChannels;
192 
197 typedef struct {
205  int32_t validColsOut;
213  int32_t validRowsOut;
215 
226 
247  MMALIB_kernelHandle handle,
248  const MMALIB_bufParams2D_t * src0_addr,
249  const MMALIB_bufParams2D_t * src1_addr,
250  const MMALIB_bufParams2D_t * dst_addr,
252 
273  MMALIB_kernelHandle handle,
274  const MMALIB_bufParams2D_t * src0_addr,
275  const MMALIB_bufParams2D_t * src1_addr,
276  const MMALIB_bufParams2D_t * dst_addr,
278 
327  MMALIB_kernelHandle handle,
328  const void * src0,
329  const void * src1,
330  void * dst,
333 
350  MMALIB_kernelHandle handle,
351  const void * src0,
352  const void * src1,
353  void * dst,
355 
376 int32_t
378  int32_t inputWidth,
379  int32_t pad,
380  int32_t inputHeight,
381  int32_t mmaWidth,
382  int32_t MChannels,
383  int32_t subMChannels);
401  int32_t pad,
402  int32_t inputHeight,
403  int32_t mmaWidth,
404  int32_t MChannels,
405  int32_t subMChannels);
406 
415 
435  const MMALIB_bufParams2D_t * src0_addr,
436  const MMALIB_bufParams2D_t * src1_addr,
437  const MMALIB_bufParams2D_t * dst_addr,
441  int32_t iterN,
442  uint64_t * archCycles,
443  uint64_t * estCycles);
444 
446 #ifdef __cplusplus
447 }
448 #endif
449 #endif /* _MMALIB_CNN_PIXELSHUFFLE_ROW_IXX_IXX_OXX_H_ */
450 
451 /* ======================================================================== */
452 /* End of file: MMALIB_CNN_pixelShuffle_row_ixX_ixX_oxX.h */
453 /* ======================================================================== */
MMALIB_STATUS MMALIB_CNN_pixelShuffle_row_ixX_ixX_oxX_init(MMALIB_kernelHandle handle, const MMALIB_bufParams2D_t *src0_addr, const MMALIB_bufParams2D_t *src1_addr, const MMALIB_bufParams2D_t *dst_addr, const MMALIB_CNN_pixelShuffle_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_PIXELSHUFFLE_ROW_IXX_IXX_OXX_STATUS_NAME
Enum to define the error codes.
@ MMALIB_CNN_PIXELSHUFFLE_ROW_IXX_IXX_OXX_ERR_MAX
@ MMALIB_CNN_PIXELSHUFFLE_ROW_IXX_IXX_OXX_ERR_SMALL_K
int32_t MMALIB_CNN_generateFillSeamPredicateRegistersPixelShuffle(MMALIB_kernelHandle handle, int32_t inputWidth, int32_t pad, int32_t inputHeight, int32_t mmaWidth, int32_t MChannels, int32_t subMChannels)
This function generates the predicate registers once per layer Predicate buffers are create to identi...
int32_t MMALIB_CNN_seamPredicateRegistersSizeDefaultPixelShuffle()
This function generates the predicate registers once per layer.
MMALIB_STATUS MMALIB_CNN_pixelShuffle_row_ixX_ixX_oxX_exec_checkParams(MMALIB_kernelHandle handle, const void *src0, const void *src1, void *dst, const MMALIB_CNN_pixelShuffle_row_ixX_ixX_oxX_ExecInArgs *pKerInArgs)
This function checks the parameters and should be called before kernel executuon. It can be called on...
MMALIB_STATUS MMALIB_CNN_pixelShuffle_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 *dst_addr, const MMALIB_CNN_pixelShuffle_row_ixX_ixX_oxX_InitArgs *pKerInitArgs)
This function call is required to initialize the handle. In this function most of the one time operat...
int32_t MMALIB_CNN_seamPredicateRegistersSizePixelShuffle(int32_t inputWidth, int32_t pad, int32_t inputHeight, int32_t mmaWidth, int32_t MChannels, int32_t subMChannels)
This function provides total bytes needed for seam insertion buffer.
int32_t MMALIB_CNN_pixelShuffle_row_ixX_ixX_oxX_getHandleSize(MMALIB_CNN_pixelShuffle_row_ixX_ixX_oxX_InitArgs *pKerInitArgs)
This is a query function to calculate the size of internal handle.
MMALIB_STATUS MMALIB_CNN_pixelShuffle_row_ixX_ixX_oxX_exec(MMALIB_kernelHandle handle, const void *src0, const void *src1, void *dst, const MMALIB_CNN_pixelShuffle_row_ixX_ixX_oxX_ExecInArgs *pKerInArgs, MMALIB_CNN_pixelShuffle_row_ixX_ixX_oxX_ExecOutArgs *pKerOutArgs)
This function is the main compute function, and performs the convolution primitive (conv + ReLU) for ...
void MMA_CNNLIB_pixelShuffle_rowBiasReLUCompute_ixX_ixX_oxX_perfEst(const MMALIB_bufParams2D_t *src0_addr, const MMALIB_bufParams2D_t *src1_addr, const MMALIB_bufParams2D_t *dst_addr, MMALIB_CNN_pixelShuffle_row_ixX_ixX_oxX_InitArgs *pKerInitArgs, const MMALIB_CNN_pixelShuffle_row_ixX_ixX_oxX_ExecInArgs *pKerInArgs, MMALIB_CNN_pixelShuffle_row_ixX_ixX_oxX_ExecOutArgs *pKerOutArgs, int32_t iterN, uint64_t *archCycles, uint64_t *estCycles)
This function generates the performance of MMALIB kernels.
MMALIB_STATUS_NAME
The enumeration of all status codes.
Definition: MMALIB_types.h:176
@ MMALIB_ERROR_MAX
Definition: MMALIB_types.h:190
void * MMALIB_kernelHandle
Handle type for MMALIB operations.
Definition: MMALIB_types.h:279
Structure containing the parameters for input to the execute phase of CNN convolution computation.
int32_t validRowsIn
Valid input rows of input feature maps for one call of processing of the kernel for strided convoluti...
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 subMChannels
Number of output channels per kernel call after convolution and before pixel shuffle; in execute phas...
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 pad
Pad of each row of input feature map, specify pad only on one side in execute phase....
Structure containing the parameters for output from the execute phase of CNN convolution computation.
int32_t validColsPerRowOut
Valid columns in a row of output feature maps for one call of processing of the kernel for strided co...
int32_t validColsOut
Valid columns out in a row of output feature maps for one call of processing of the kernel for non st...
int32_t validRowsOut
Valid output rows of output feature maps after convolution for one call of processing of the kernel f...
Structure containing the parameters initialization of CNN convolution computation.
int8_t funcStyle
Variant of the function refer to MMALIB_FUNCTION_STYLE
int32_t bias
bias value in B matrix same as data type of B matrix
int32_t maxHeight
Height of the 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 strided con...
uint8_t mode
mode for input feature map in Circular or Linear mode in B matrix
uint8_t activationType
activation RELU, SAT or none for output
int32_t inWidth
Width of each row of input feature map in units of data type
int32_t inputPitchPerRow
Valid pitch for each input rows of input feature maps for strided convolution. This is in units of by...
int32_t pad
Pad of each row of input feature map, specify pad only on one side and for strided flow the Pad is on...
int32_t subMChannels
Number of output channels per kernel call after convolution and before pixel shuffle operation.
int32_t inChOffset
offset of the input feature maps in B matrix. This is power of 2 for circular buffer and atleast 64 b...
int32_t outputPitchPerRow
Valid output pitch for each output rows of output feature maps for strided convolution....
int32_t validRowsIn
Valid input rows of input feature maps for one call of processing of the kernel for strided convoluti...
int32_t validColsIn
Valid columns of input feature maps in B matrix for one call of processing of the kernel for non stri...
A structure for a 2 dimensional buffer descriptor.