23 #ifndef MMALIB_CNN_CONVOLVE_ROW_IXX_IXX_OXX_H_
24 #define MMALIB_CNN_CONVOLVE_ROW_IXX_IXX_OXX_H_
26 #include "../../common/MMALIB_types.h"
434 int32_t subMChannels);
456 int32_t subMChannels);
479 const void *restrict pWeights,
480 void *restrict pReorderWeights,
481 void *restrict pBias,
553 uint64_t *archCycles,
554 uint64_t *estCycles);
int32_t MMALIB_CNN_seamPredicateRegistersSizeDefault()
This function generates the predicate registers once per layer.
void MMA_CNNLIB_convolveBiasReLUCompute_ixX_ixX_oxX_perfEst(const MMALIB_bufParams2D_t *src0_addr, const MMALIB_bufParams2D_t *src1_addr, const MMALIB_bufParams3D_t *dst_addr, MMALIB_CNN_convolve_row_ixX_ixX_oxX_InitArgs *pKerInitArgs, const MMALIB_CNN_convolve_row_ixX_ixX_oxX_ExecInArgs *pKerInArgs, MMALIB_CNN_convolve_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_convolve_row_reorderWeightsBufferSize(MMALIB_bufParams2D_t *src0_addr, MMALIB_CNN_convolve_row_ixX_ixX_oxX_reorderWeights_Args *reorderWeights, const MMALIB_CNN_convolve_row_ixX_ixX_oxX_InitArgs *pKerInitArgs)
This function return the buffer size for M < 1 and K < 1 cases.
int32_t MMALIB_CNN_seamPredicateRegistersSize(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.
MMALIB_STATUS MMALIB_CNN_convolve_row_ixX_ixX_oxX_exec_checkParams(MMALIB_kernelHandle handle, const void *src0, const void *src1, void *dst, const MMALIB_CNN_convolve_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_convolve_row_ixX_ixX_oxX_exec(MMALIB_kernelHandle handle, const void *src0, const void *src1, void *dst, const MMALIB_CNN_convolve_row_ixX_ixX_oxX_ExecInArgs *pKerInArgs, MMALIB_CNN_convolve_row_ixX_ixX_oxX_ExecOutArgs *pKerOutArgs)
This function is the main compute function, and performs the convolution primitive (conv + ReLU) for ...
int32_t MMALIB_CNN_convolve_row_reorderWeights(const void *restrict pWeights, void *restrict pReorderWeights, void *restrict pBias, const MMALIB_bufParams2D_t *src0_addr, const MMALIB_bufParams2D_t *src2_addr, MMALIB_CNN_convolve_row_ixX_ixX_oxX_reorderWeights_Args *reorderWeights, const MMALIB_CNN_convolve_row_ixX_ixX_oxX_InitArgs *pKerInitArgs)
This function reorder the weights for M < 1 and K < 1 cases.
int32_t MMALIB_CNN_generateFillSeamPredicateRegisters(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...
MMALIB_STATUS MMALIB_CNN_convolve_row_ixX_ixX_oxX_init_checkParams(MMALIB_kernelHandle handle, const MMALIB_bufParams2D_t *src0_addr, const MMALIB_bufParams2D_t *src1_addr, const MMALIB_bufParams3D_t *dst_addr, const MMALIB_CNN_convolve_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_convolve_row_reorderWeightsFlag(MMALIB_CNN_convolve_row_ixX_ixX_oxX_reorderWeights_Args *reorderWeights)
This function return the flag for M < 1 and K < 1 cases.
MMALIB_STATUS MMALIB_CNN_convolve_row_ixX_ixX_oxX_init(MMALIB_kernelHandle handle, const MMALIB_bufParams2D_t *src0_addr, const MMALIB_bufParams2D_t *src1_addr, const MMALIB_bufParams3D_t *dst_addr, const MMALIB_CNN_convolve_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_convolve_row_ixX_ixX_oxX_getHandleSize(MMALIB_CNN_convolve_row_ixX_ixX_oxX_InitArgs *pKerInitArgs)
This is a query function to calculate the size of internal handle.
MMALIB_CNN_CONVOLVE_ROW_IXX_IXX_OXX_STATUS_NAME
Enum to define the error codes.
@ MMALIB_CNN_CONVOLVE_ROW_IXX_IXX_OXX_ERR_MAX
@ MMALIB_CNN_CONVOLVE_ROW_IXX_IXX_OXX_ERR_SMALL_K
MMALIB_STATUS_NAME
The enumeration of all status codes.
void * MMALIB_kernelHandle
Handle type for MMALIB operations.
Structure containing the parameters for input to the execute phase of CNN convolution computation.
int32_t bufferReset
Reset the buffers so that handle is not reloaded 0: no reset 1: reset. SE, SA, MMA and Predicate buff...
int32_t subMChannels
Number of output channels per kernel call in execute phase This parameter is not used,...
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 validRowsIn
Valid input rows of input feature maps for one call of processing of the kernel for strided convoluti...
int32_t pad
Pad of each row of input feature map, specify pad only on one side in execute phase....
int32_t validColsIn
Valid columns in a row of input feature maps for one call of processing of the kernel for non strided...
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 validColsOut
Valid columns out in a row of output feature maps for one call of processing of the kernel for non st...
int32_t validColsPerRowOut
Valid columns in a row of output feature maps for one call of processing of the kernel for strided co...
Structure containing the parameters initialization of CNN convolution computation.
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 dilationY
dilation of coefficients of rows
int8_t funcStyle
Variant of the function refer to MMALIB_FUNCTION_STYLE
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 bias
bias value in B matrix same as data type of B matrix
uint8_t mode
mode for input feature map in Circular or Linear mode in B matrix
int32_t dilationX
dilation of coefficients of columns
int32_t No
Number of output feature maps
int32_t subMChannels
Number of output channels per kernel call.
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 in units of by...
int32_t Fr
coefficient rows (height)
uint8_t weightReorderFlag
MChannel < mma width and NiFrFc < mma width for non strided cases blocks processing > 2,...
int32_t numGroupsPerKernel
number of groups per kernel call > 1 will enable processing when No <= MMA size for non strided kerne...
int32_t outputPitchPerRow
Valid output pitch for each output rows of output feature maps for strided convolution....
int32_t numBiasVals
Number of elements used for the bias (cols in weights, rows in feature maps)
int32_t strideY
stride of rows
uint8_t activationType
activation RELU, SAT or none for output
int32_t validRowsIn
Valid input rows of input feature maps for one call of processing of the kernel for strided convoluti...
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 Fc
coefficient columns (width)
int32_t strideX
stride of columns
int32_t shift
Shift parameter for output precision
int32_t maxHeight
Height of the input feature map in units of data type
int32_t inWidth
Width of each row of input feature map in units of data type
This structure holds all the input parameters for reordering CNN filter weights for row convolution k...
int32_t strideX
Stride in the horizontal dimension.
int32_t numBiasVals
Number of elements used for the bias (cols in weights, rows in feature maps)
int32_t dataType
Data type must be a member of MMALIB_data_type_e.
int32_t strideY
Stride in the vertical dimension.
int32_t Ni
Number of input channels to be processed.
int32_t No
Number of output channels to be processed.
int32_t dilationY
Dilation in the vertical dimension.
int32_t numGroupsPerKernel
Number of groups to be processed in kernel call.
int32_t dilationX
Dilation in the horizontal dimension.
A structure for a 2 dimensional buffer descriptor.
A structure for a 3 dimensional buffer descriptor.