MMALIB User Guide
MMALIB_LINALG_matrixMatrixMultiplyBias_ixX_ixX_oxX

Introduction

Kernel for multiplying two matrices with bias, scale and shift.

Data Structures

struct  MMALIB_LINALG_matrixMatrixMultiplyBias_ixX_ixX_oxX_InitArgs
 

Functions

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. More...
 
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 operations are performed and results are stored in the handle. More...
 
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 once. More...
 
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. More...
 
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 once. More...
 
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. More...
 

Enumerations

enum  MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_STATUS_NAME { MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_ERR_SMALL_K = MMALIB_ERROR_MAX , MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_ERR_MAX }
 Enumeration of different error codes for the MMALIB_LINALG_matrixMatrixMultiply kernel. More...
 
enum  MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_B_TRANSPOSE_STATUS { MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_B_NON_TRANSPOSED = 0 , MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_B_TRANSPOSED = 1 }
 
enum  MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_BIAS_ORDER { MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_BIAS_ORDER_ROW = 0 , MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_BIAS_ORDER_COL = 1 }
 
enum  MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_SCALE_SHIFT_ORDER { MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_SCALE_SHIFT_ORDER_ROW = 0 , MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_SCALE_SHIFT_ORDER_COL = 1 }
 
enum  MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_SCALE_SHIFT_ENABLE_STATUS { MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_SCALE_SHIFT_SCALAR = 0 , MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_SCALE_SHIFT_VECTOR = 1 }
 

Enumeration Type Documentation

◆ MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_STATUS_NAME

Enumeration of different error codes for the MMALIB_LINALG_matrixMatrixMultiply kernel.

Enumerator
MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_ERR_SMALL_K 
MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_ERR_MAX 

Definition at line 66 of file MMALIB_LINALG_matrixMatrixMultiplyBias_ixX_ixX_oxX.h.

◆ MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_B_TRANSPOSE_STATUS

Enumerator
MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_B_NON_TRANSPOSED 
MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_B_TRANSPOSED 

Definition at line 72 of file MMALIB_LINALG_matrixMatrixMultiplyBias_ixX_ixX_oxX.h.

◆ MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_BIAS_ORDER

Enumerator
MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_BIAS_ORDER_ROW 
MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_BIAS_ORDER_COL 

Definition at line 78 of file MMALIB_LINALG_matrixMatrixMultiplyBias_ixX_ixX_oxX.h.

◆ MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_SCALE_SHIFT_ORDER

Enumerator
MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_SCALE_SHIFT_ORDER_ROW 
MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_SCALE_SHIFT_ORDER_COL 

Definition at line 84 of file MMALIB_LINALG_matrixMatrixMultiplyBias_ixX_ixX_oxX.h.

◆ MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_SCALE_SHIFT_ENABLE_STATUS

Enumerator
MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_SCALE_SHIFT_SCALAR 
MMALIB_LINALG_MATRIXMATRIXMULTIPLYBIAS_IXX_IXX_OXX_SCALE_SHIFT_VECTOR 

Definition at line 90 of file MMALIB_LINALG_matrixMatrixMultiplyBias_ixX_ixX_oxX.h.

Function Documentation

◆ MMALIB_LINALG_matrixMatrixMultiplyBias_ixX_ixX_oxX_getHandleSize()

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.

Parameters
[in]pKerInitArgs: Pointer to structure holding init parameters
Returns
Size of the buffer in bytes
Remarks
Application is expected to allocate buffer of the requested size and provide it during init and exec function calls

◆ MMALIB_LINALG_matrixMatrixMultiplyBias_ixX_ixX_oxX_init()

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 operations are performed and results are stored in the handle.

Parameters
[in]handle: Active handle to the kernel
[in]src0_addr: Pointer to the structure (MMALIB_bufParams3D_t) containing dimensional information of src0 (i.e. A)
[in]src1_addr: Pointer to the structure (MMALIB_bufParams3D_t) containing dimensional information of src1 (i.e. B)
[in]src2_addr: Pointer to the structure containing dimensional information of src2, which is the bias vector
[in]src3_addr: Pointer to the structure containing dimensional information of src3, which is the scale vector
[out]dst_addr: Pointer to the structure containing dimensional information of dst (i.e. C)
[in]pKerInitArgs: Pointer to the structure holding init parameters
Returns
Status value indicating success or failure. Refer to MMALIB_STATUS.
Remarks
Application is expected to provide a valid handle

◆ MMALIB_LINALG_matrixMatrixMultiplyBias_ixX_ixX_oxX_init_checkParams()

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 once.

Parameters
[in]handle: Active handle to the kernel
[in]src0_addr: Pointer to the structure (MMALIB_bufParams3D_t) containing dimensional information of src0 (i.e. A)
[in]src1_addr: Pointer to the structure (MMALIB_bufParams3D_t) containing dimensional information of src1 (i.e. B)
[in]src2_addr: Pointer to the structure containing dimensional information of src2, which is the bias vector
[out]dst_addr: Pointer to the structure containing dimensional information of dst (i.e. C)
[in]pKerInitArgs: Pointer to the structure holding init parameters
Returns
Status value indicating success or failure. Refer to MMALIB_STATUS.
Remarks
None

◆ MMALIB_LINALG_matrixMatrixMultiplyBias_ixX_ixX_oxX_exec()

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.

The flow and the expectations of this function are as follows

Parameters
[in]handle: Active handle to the kernel
[in]src0[]: Pointer to the structure (MMALIB_bufParams3D_t) containing dimensional information of src0 (i.e. A)
[in]src1[]: Pointer to the structure (MMALIB_bufParams3D_t) containing dimensional information of src1 (i.e. B)
[in]src2[]: Pointer to buffer holding the bias vector
[in]src3[]: Pointer to buffer holding the scale vector
[in]src4[]: Pointer to buffer holding the shift vector
[out]dst[]: Pointer to buffer holding the output matrix [ C matrix]
Returns
Status value indicating success or failure. Refer to MMALIB_STATUS.
Remarks
Application is expected to call the checkParams function prior to this function as it avoids check of paramaters for each invocation.

◆ MMALIB_LINALG_matrixMatrixMultiplyBias_ixX_ixX_oxX_exec_checkParams()

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 once.

Parameters
[in]handle: Active handle to the kernel
[in]src0[]: Pointer to buffer holding the first matrix input [ A matrix]
[in]src1[]: Pointer to buffer holding the second matrix input [ B matrix]
[in]src2[]: Pointer to buffer holding the bias vector
[out]dst[]: Pointer to buffer holding the output matrix [ C matrix]
Returns
Status value indicating success or failure. Refer to MMALIB_STATUS.
Remarks
None

◆ MMALIB_LINALG_matrixMatrixMultiplyBias_ixX_ixX_oxX_perfEst()

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.

Parameters
[in]handle: Active handle to the kernel
[in]src0_addr: Pointer to the structure containing dimensional information of src0
[in]src1_addr: Pointer to the structure containing dimensional information of src1
[out]dst_addr: Pointer to the structure containing dimensional information of dst
[out]idealCycles: Cycles estimated for the compute, ideally
[out]archCycles: Cycles estimated for the compute, startup and teardown
[out]estCycles: Cycles estimated for the compute, startup, teardown and any associated overhead
[out]caseNumber: The case (execution path) taken insided the execution of the kernel
Remarks
None