MMALIB User Guide
MMALIB_CNN_tensor_convert_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_TENSOR_CONVERT_IXX_IXX_OXX_H_
24 #define MMALIB_CNN_TENSOR_CONVERT_IXX_IXX_OXX_H_
25 
26 #include "../../common/MMALIB_types.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
89 /* @{ */
90 
95 typedef struct {
97  int8_t funcStyle;
99  int32_t inPad;
103  int32_t outPad;
104 
107  int32_t numRowsQuant;
108 
115 
117 
123 typedef struct {
124 
125  /* bool lastCall; */
127  uint32_t srcDimZ;
129  uint32_t srcDimY;
130 
132 
138 typedef struct {
140  int32_t validColsOut;
142 
153 
173  MMALIB_kernelHandle handle,
174  const MMALIB_bufParams3D_t *src_addr,
175  const MMALIB_bufParams1D_t *scale_addr,
176  const MMALIB_bufParams3D_t *dst_addr,
177  const MMALIB_CNN_tensor_convert_ixX_oxX_InitArgs *pKerInitArgs);
178 
197  MMALIB_kernelHandle handle,
198  const MMALIB_bufParams3D_t *src_addr,
199  const MMALIB_bufParams1D_t *scale_addr,
200  const MMALIB_bufParams3D_t *dst_addr,
201  const MMALIB_CNN_tensor_convert_ixX_oxX_InitArgs *pKerInitArgs);
202 
236  MMALIB_kernelHandle handle,
237  const void *src,
238  const void *scale,
239  const uint8_t *shift,
240  const void *q1,
241  const void *q2,
242  void *dst,
245 
270  MMALIB_kernelHandle handle,
271  const void *src,
272  const void *scale,
273  const uint8_t *shift,
274  const void *q1,
275  const void *q2,
276  void *dst,
279 
299  MMALIB_kernelHandle handle,
300  const MMALIB_bufParams3D_t *src_addr,
301  const MMALIB_bufParams3D_t *dst_addr,
302  uint64_t *idealCycles,
303  uint64_t *archCycles,
304  uint64_t *estCycles);
305 
307 #ifdef __cplusplus
308 }
309 #endif
310 #endif /* _MMALIB_CNN_TENSOR_CONVERT_IXX_IXX_OXX_H_ */
311 
312 /* ======================================================================== */
313 /* End of file: MMALIB_CNN_tensor_convert_ixX_oxX.h */
314 /* ======================================================================== */
void MMALIB_CNN_tensor_convert_ixX_oxX_perfEst(MMALIB_kernelHandle handle, const MMALIB_bufParams3D_t *src_addr, const MMALIB_bufParams3D_t *dst_addr, uint64_t *idealCycles, uint64_t *archCycles, uint64_t *estCycles)
This function estimates the kernel performance.
int32_t MMALIB_CNN_tensor_convert_ixX_oxX_getHandleSize(MMALIB_CNN_tensor_convert_ixX_oxX_InitArgs *pKerInitArgs)
This is a query function to calculate the size of internal handle.
MMALIB_STATUS MMALIB_CNN_tensor_convert_ixX_oxX_exec_checkParams(MMALIB_kernelHandle handle, const void *src, const void *scale, const uint8_t *shift, const void *q1, const void *q2, void *dst, const MMALIB_CNN_tensor_convert_ixX_oxX_ExecInArgs *pKerInArgs, MMALIB_CNN_tensor_convert_ixX_oxX_ExecOutArgs *pKerOutArgs)
This function checks the parameters and should be called before kernel executuon. It can be called on...
MMALIB_STATUS MMALIB_CNN_tensor_convert_ixX_oxX_init_checkParams(MMALIB_kernelHandle handle, const MMALIB_bufParams3D_t *src_addr, const MMALIB_bufParams1D_t *scale_addr, const MMALIB_bufParams3D_t *dst_addr, const MMALIB_CNN_tensor_convert_ixX_oxX_InitArgs *pKerInitArgs)
This function checks the validity of the input parameters.
MMALIB_STATUS MMALIB_CNN_tensor_convert_ixX_oxX_init(MMALIB_kernelHandle handle, const MMALIB_bufParams3D_t *src_addr, const MMALIB_bufParams1D_t *scale_addr, const MMALIB_bufParams3D_t *dst_addr, const MMALIB_CNN_tensor_convert_ixX_oxX_InitArgs *pKerInitArgs)
This function call is required to initialize the handle. In this function, most of the one-time opera...
MMALIB_STATUS MMALIB_CNN_tensor_convert_ixX_oxX_exec(MMALIB_kernelHandle handle, const void *src, const void *scale, const uint8_t *shift, const void *q1, const void *q2, void *dst, const MMALIB_CNN_tensor_convert_ixX_oxX_ExecInArgs *pKerInArgs, MMALIB_CNN_tensor_convert_ixX_oxX_ExecOutArgs *pKerOutArgs)
This function is the main compute function, and performs the tensor datatype conversion.
MMALIB_STATUS_NAME
The enumeration of all status codes.
Definition: MMALIB_types.h:176
void * MMALIB_kernelHandle
Handle type for MMALIB operations.
Definition: MMALIB_types.h:279
MMALIB_tensor_format_e
Tensor format.
Definition: MMALIB_types.h:299
This structure holds all the runtime input parameters for tensor convert kernel.
uint32_t srcDimY
update if this is different from init src_addr.dimy
uint32_t srcDimZ
update if this is different from init src_addr.dimz
This structure holds all the runtime output parameters for tensor convert kernel.
Structure containing the parameters initialization of tensor convert function.
int32_t numRowsQuant
Number of rows allocated for quantization matrix, Q2.
int8_t funcStyle
Variant of the function refer to MMALIB_FUNCTION_STYLE
int32_t inPad
input pad of each row of output feature map, unused for now
int32_t outPad
output pad of each row of output feature map, specify pad only on one side
MMALIB_tensor_format tensorFormatOut
output tensor format: CHW or HWC
MMALIB_tensor_format tensorFormatIn
input tensor format: CHW or HWC
A structure for a 1 dimensional buffer descriptor.
A structure for a 3 dimensional buffer descriptor.