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 
64 typedef struct {
66  int8_t funcStyle;
68  int32_t inPad;
72  int32_t outPad;
73 
80 
82 
88 typedef struct {
89 
90  /* bool lastCall; */
92  uint32_t srcDimZ;
94  uint32_t srcDimY;
95 
97 
103 typedef struct {
105  int32_t validColsOut;
107 
118 
138  MMALIB_kernelHandle handle,
139  const MMALIB_bufParams3D_t *src_addr,
140  const MMALIB_bufParams1D_t *scale_addr,
141  const MMALIB_bufParams3D_t *dst_addr,
142  const MMALIB_CNN_tensor_convert_ixX_oxX_InitArgs *pKerInitArgs);
143 
162  MMALIB_kernelHandle handle,
163  const MMALIB_bufParams3D_t *src_addr,
164  const MMALIB_bufParams1D_t *scale_addr,
165  const MMALIB_bufParams3D_t *dst_addr,
166  const MMALIB_CNN_tensor_convert_ixX_oxX_InitArgs *pKerInitArgs);
167 
199  MMALIB_kernelHandle handle,
200  const void *src,
201  const void *scale,
202  const uint8_t *shift,
203  const void *q,
204  void *dst,
207 
230  MMALIB_kernelHandle handle,
231  const void *src,
232  const void *scale,
233  const uint8_t *shift,
234  const void *q,
235  void *dst,
238 
258  MMALIB_kernelHandle handle,
259  const MMALIB_bufParams3D_t *src_addr,
260  const MMALIB_bufParams3D_t *dst_addr,
261  uint64_t *idealCycles,
262  uint64_t *archCycles,
263  uint64_t *estCycles);
264 
266 #ifdef __cplusplus
267 }
268 #endif
269 #endif /* _MMALIB_CNN_TENSOR_CONVERT_IXX_IXX_OXX_H_ */
270 
271 /* ======================================================================== */
272 /* End of file: MMALIB_CNN_tensor_convert_ixX_oxX.h */
273 /* ======================================================================== */
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 *q, 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...
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(MMALIB_kernelHandle handle, const void *src, const void *scale, const uint8_t *shift, const void *q, 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 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_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_tensor_format_e
Tensor format.
Definition: MMALIB_types.h:282
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.
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.