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 - https://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 
32 #if defined(__C7100__)
33 
91 #else
92 
118 #endif // defined(__C7100__)
119 
126 typedef struct {
128  int8_t funcStyle;
130  int32_t inPad;
134  int32_t outPad;
135 
136 #if defined(__C7100__)
139  int32_t numRowsQuant;
140 #endif
141 
148 
150 
156 typedef struct {
157 
158  /* bool lastCall; */
160  uint32_t srcDimZ;
162  uint32_t srcDimY;
163 
165 
171 typedef struct {
173  int32_t validColsOut;
175 
186 
206  MMALIB_kernelHandle handle,
207  const MMALIB_bufParams3D_t *src_addr,
208  const MMALIB_bufParams1D_t *scale_addr,
209  const MMALIB_bufParams3D_t *dst_addr,
210  const MMALIB_CNN_tensor_convert_ixX_oxX_InitArgs *pKerInitArgs);
211 
230  MMALIB_kernelHandle handle,
231  const MMALIB_bufParams3D_t *src_addr,
232  const MMALIB_bufParams1D_t *scale_addr,
233  const MMALIB_bufParams3D_t *dst_addr,
234  const MMALIB_CNN_tensor_convert_ixX_oxX_InitArgs *pKerInitArgs);
235 
236 #if defined(__C7100__)
237 
271  MMALIB_kernelHandle handle,
272  const void *src,
273  const void *scale,
274  const uint8_t *shift,
275  const void *q1,
276  const void *q2,
277  void *dst,
280 
305  MMALIB_kernelHandle handle,
306  const void *src,
307  const void *scale,
308  const uint8_t *shift,
309  const void *q1,
310  const void *q2,
311  void *dst,
314 
315 #else
316 
348  MMALIB_kernelHandle handle,
349  const void *src,
350  const void *scale,
351  const uint8_t *shift,
352  const void *q,
353  void *dst,
356 
379  MMALIB_kernelHandle handle,
380  const void *src,
381  const void *scale,
382  const uint8_t *shift,
383  const void *q,
384  void *dst,
387 
388 #endif // defined(__C7100__)
389 
408 // void MMALIB_CNN_tensor_convert_ixX_oxX_perfEst (
409 // MMALIB_kernelHandle handle,
410 // const MMALIB_bufParams3D_t *src_addr,
411 // const MMALIB_bufParams3D_t *dst_addr,
412 // uint64_t *idealCycles,
413 // uint64_t *archCycles,
414 // uint64_t *estCycles);
415 
417 #ifdef __cplusplus
418 }
419 #endif
420 #endif /* _MMALIB_CNN_TENSOR_CONVERT_IXX_IXX_OXX_H_ */
421 
422 /* ======================================================================== */
423 /* End of file: MMALIB_CNN_tensor_convert_ixX_oxX.h */
424 /* ======================================================================== */
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...
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:173
void * MMALIB_kernelHandle
Handle type for MMALIB operations.
Definition: MMALIB_types.h:284
MMALIB_tensor_format_e
Tensor format.
Definition: MMALIB_types.h:304
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.