Kernel for computing the pointwise multiplication of two matrices.
- The kernel takes two matrices of the same dimensions and multiplies each pair of elements.
- C = A.*B where C(i,j) = A(i,j) * B(i,j) for all valid i,j
|
int32_t | MMALIB_LINALG_pointwiseMatrixMatrixMultiply_ixX_ixX_oxX_getHandleSize (MMALIB_LINALG_pointwiseMatrixMatrixMultiply_ixX_ixX_oxX_InitArgs *pKerInitArgs) |
| This is a query function to return the size of internal handle. More...
|
|
MMALIB_STATUS | MMALIB_LINALG_pointwiseMatrixMatrixMultiply_ixX_ixX_oxX_init (MMALIB_kernelHandle handle, const MMALIB_bufParams2D_t *src0_addr, const MMALIB_bufParams2D_t *src1_addr, const MMALIB_bufParams2D_t *dst_addr, const MMALIB_LINALG_pointwiseMatrixMatrixMultiply_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_pointwiseMatrixMatrixMultiply_ixX_ixX_oxX_init_checkParams (MMALIB_kernelHandle handle, const MMALIB_bufParams2D_t *src0_addr, const MMALIB_bufParams2D_t *src1_addr, const MMALIB_bufParams2D_t *dst_addr, const MMALIB_LINALG_pointwiseMatrixMatrixMultiply_ixX_ixX_oxX_InitArgs *pKerInitArgs) |
| This function checks the parameters and should be called before kernel executuon. It can be called once. More...
|
|
MMALIB_STATUS | MMALIB_LINALG_pointwiseMatrixMatrixMultiply_ixX_ixX_oxX_exec (MMALIB_kernelHandle handle, const void *src0, const void *src1, void *dst) |
| This function is the main compute function, and performs pointwise matrix-matrix multiplication. More...
|
|
MMALIB_STATUS | MMALIB_LINALG_pointwiseMatrixMatrixMultiply_ixX_ixX_oxX_exec_checkParams (MMALIB_kernelHandle handle, const void *src0, const void *src1, const void *dst) |
| This function checks the parameters and should be called before kernel executuon. It can be called once. More...
|
|
void | MMALIB_LINALG_pointwiseMatrixMatrixMultiply_ixX_ixX_oxX_perfEst (MMALIB_kernelHandle handle, const MMALIB_bufParams2D_t *src0_addr, const MMALIB_bufParams2D_t *src1_addr, const MMALIB_bufParams2D_t *dst_addr, uint64_t *archCycles, uint64_t *estCycles) |
| This function estimates the cycles consumed for the kernel execution. More...
|
|
◆ MMALIB_LINALG_POINTWISEMATRIXMATRIXMULTIPY_IXX_IXX_OXX_STATUS_NAME
Enumeration of different error codes for the MMALIB_LINALG_MATRIXMATRIXMULTIPLY kernel.
Enumerator |
---|
MMALIB_LINALG_POINTWISEMATRIXMATRIXMULTIPY_IXX_IXX_OXX_ERR_SMALL_K | |
MMALIB_LINALG_POINTWISEMATRIXMATRIXMULTIPY_IXX_IXX_OXX_ERR_MAX | |
Definition at line 106 of file MMALIB_LINALG_pointwiseMatrixMatrixMultiply_ixX_ixX_oxX.h.
◆ MMALIB_LINALG_pointwiseMatrixMatrixMultiply_ixX_ixX_oxX_getHandleSize()
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
◆ MMALIB_LINALG_pointwiseMatrixMatrixMultiply_ixX_ixX_oxX_init()
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 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 |
[in] | pKerInitArgs | : Pointer to the structure holding init parameters |
- Returns
- Status of success or error with error codes, refer to MMALIB_STATUS.
◆ MMALIB_LINALG_pointwiseMatrixMatrixMultiply_ixX_ixX_oxX_init_checkParams()
This function checks the parameters and should be called before kernel executuon. It can be called once.
- 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 |
[in] | pKerInitArgs | : Pointer to the structure holding init parameters |
- Returns
- Status of success or error with error codes, refer to MMALIB_STATUS.
◆ MMALIB_LINALG_pointwiseMatrixMatrixMultiply_ixX_ixX_oxX_exec()
This function is the main compute function, and performs pointwise matrix-matrix multiplication.
- 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] |
[out] | dst[] | : Pointer to buffer holding the output matrix [ C matrix] |
- Returns
- Status of success or error with error codes, refer to MMALIB_STATUS.
- Assumptions:
- I/O buffer pointers are assumed to be not aliased.
- Performance Considerations:
- For best performance, the following parameter settings are recommended:
- Align all pointers to 8 byte boundaries
- Set all matrix dimensions to a multiple of
- 64 for 8-bit data
- 32 for 16-bit data
- 16 for 32-bit data
◆ MMALIB_LINALG_pointwiseMatrixMatrixMultiply_ixX_ixX_oxX_exec_checkParams()
MMALIB_STATUS MMALIB_LINALG_pointwiseMatrixMatrixMultiply_ixX_ixX_oxX_exec_checkParams |
( |
MMALIB_kernelHandle |
handle, |
|
|
const void * |
src0, |
|
|
const void * |
src1, |
|
|
const void * |
dst |
|
) |
| |
This function checks the parameters and should be called before kernel executuon. 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] |
[out] | dst[] | : Pointer to buffer holding the output matrix [ C matrix] |
- Returns
- Status of success or error with error codes, refer to MMALIB_STATUS.
◆ MMALIB_LINALG_pointwiseMatrixMatrixMultiply_ixX_ixX_oxX_perfEst()
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] | archCycles | : Cycles estimated for the compute, startup and teardown |
[out] | estCycles | : Cycles estimated for the compute, startup, teardown and any associated overhead |