MMALIB User Guide
MMALIB_LINALG_matrixMatrixMultiplyBias_ixX_ixX_oxX.h
Go to the documentation of this file.
1 /******************************************************************************/
5 /* Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  *
14  * Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in the
16  * documentation and/or other materials provided with the
17  * distribution.
18  *
19  * Neither the name of Texas Instruments Incorporated nor the names of
20  * its contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  *
35  ******************************************************************************/
36 
37 #ifndef MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_H_
38 #define MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_H_
39 
40 #include "../../common/MMALIB_types.h"
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 // clang-format off
58 // clang-format on
66 typedef enum {
68  /*@todo Add more appropriate error codes */
71 
72 typedef enum
73 {
77 
78 typedef enum
79 {
83 
84 typedef enum
85 {
89 
90 typedef enum
91 {
95 
100 typedef struct {
102  int8_t funcStyle;
107  int32_t pSatMax;
109  int32_t pSatMin;
112  int8_t bTranspose;
115  int8_t biasOrder;
123 
135 
161  MMALIB_kernelHandle handle,
162  const MMALIB_bufParams3D_t *src0_addr,
163  const MMALIB_bufParams3D_t *src1_addr,
164  const MMALIB_bufParams2D_t *src2_addr,
165  const MMALIB_bufParams2D_t *src3_addr,
166  const MMALIB_bufParams3D_t *dst_addr,
168 
191  MMALIB_kernelHandle handle,
192  const MMALIB_bufParams3D_t *src0_addr,
193  const MMALIB_bufParams3D_t *src1_addr,
194  const MMALIB_bufParams2D_t *src2_addr,
195  const MMALIB_bufParams3D_t *dst_addr,
197 
224  MMALIB_kernelHandle handle,
225  const void *src0,
226  const void *src1,
227  const void *src2,
228  const void *src3,
229  const void *src4,
230  void *dst);
231 
253  MMALIB_kernelHandle handle,
254  const void *src0,
255  const void *src1,
256  const void *src2,
257  const void *dst);
258 
283  MMALIB_kernelHandle handle,
284  const MMALIB_bufParams3D_t *src0_addr,
285  const MMALIB_bufParams3D_t *src1_addr,
286  const MMALIB_bufParams3D_t *dst_addr,
287  uint64_t *idealCycles,
288  uint64_t *archCycles,
289  uint64_t *estCycles,
290  int32_t *caseNumber);
291 
294 #ifdef __cplusplus
295 }
296 #endif
297 
298 #endif /* MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_H_ */
299 
300 /* ======================================================================== */
301 /* End of file: MMALIB_LINALG_matrixMatrixMultiplyBias_ixX_ixX_oxX.h */
302 /* ======================================================================== */
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_ERROR_MAX
Definition: MMALIB_types.h:167
MMALIB_STATUS MMALIB_LINALG_matrixMatrixMultiplyBias_ixX_ixX_oxX_exec_checkParams(MMALIB_kernelHandle handle, const void *src0, const void *src1, const void *src2, const void *dst)
This function checks the parameters and should be called before kernel execution. It can be called on...
MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_STATUS_NAME
Enumeration of different error codes for the MMALIB_LINALG_matrixMatrixMultiply kernel.
MMALIB_STATUS MMALIB_LINALG_matrixMatrixMultiplyBias_ixX_ixX_oxX_init_checkParams(MMALIB_kernelHandle handle, const MMALIB_bufParams3D_t *src0_addr, const MMALIB_bufParams3D_t *src1_addr, const MMALIB_bufParams2D_t *src2_addr, const MMALIB_bufParams3D_t *dst_addr, const MMALIB_LINALG_matrixMatrixMultiplyBias_ixX_ixX_oxX_InitArgs *pKerInitArgs)
This function checks the parameters and should be called before kernel execution. It can be called on...
MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_SCALE_SHIFT_ENABLE_STATUS
MMALIB_STATUS MMALIB_LINALG_matrixMatrixMultiplyBias_ixX_ixX_oxX_exec(MMALIB_kernelHandle handle, const void *src0, const void *src1, const void *src2, const void *src3, const void *src4, void *dst)
This function is the main compute function, and performs matrix-matrix multiplication.
MMALIB_STATUS MMALIB_LINALG_matrixMatrixMultiplyBias_ixX_ixX_oxX_init(MMALIB_kernelHandle handle, const MMALIB_bufParams3D_t *src0_addr, const MMALIB_bufParams3D_t *src1_addr, const MMALIB_bufParams2D_t *src2_addr, const MMALIB_bufParams2D_t *src3_addr, const MMALIB_bufParams3D_t *dst_addr, const MMALIB_LINALG_matrixMatrixMultiplyBias_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_LINALG_matrixMatrixMultiplyBias_ixX_ixX_oxX_getHandleSize(MMALIB_LINALG_matrixMatrixMultiplyBias_ixX_ixX_oxX_InitArgs *pKerInitArgs)
This is a query function to return the size of internal handle.
void MMALIB_LINALG_matrixMatrixMultiplyBias_ixX_ixX_oxX_perfEst(MMALIB_kernelHandle handle, const MMALIB_bufParams3D_t *src0_addr, const MMALIB_bufParams3D_t *src1_addr, const MMALIB_bufParams3D_t *dst_addr, uint64_t *idealCycles, uint64_t *archCycles, uint64_t *estCycles, int32_t *caseNumber)
This function estimates the cycles consumed for the kernel execution.
@ MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_SCALE_SHIFT_ORDER_ROW
@ MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_SCALE_SHIFT_ORDER_COL
@ MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_SCALE_SHIFT_VECTOR
@ MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_SCALE_SHIFT_SCALAR
int8_t scaleShiftOrder
flag to indicate scale and shift order (row vector or column vector) MMALIB_LINALG_MATRIXMATRIXMULTIP...
bool scaleAndShiftFlag
flag to indicate whether the scale and shift are vectors or scalars MMALIB_LINALG_MATRIXMATRIXMULTIPL...
int8_t bTranspose
flag signifies whether the B matrix is transposed or not MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_I...
int8_t activationType
Output activation type: Saturation or ReLU MMALIB_activation_type_e.
int8_t biasOrder
flag to indicate bias order (row vector or column vector) MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_...
A structure for a 2 dimensional buffer descriptor.
A structure for a 3 dimensional buffer descriptor.