Strided Matrix Addition
Module: Strided Matrix operations
Modules
Name |
---|
Strided Matrix Addition Kernels |
Functions
Name | |
---|---|
void | plp_mat_add_stride_f32(const float restrict pSrcA, const float restrict pSrcB, uint32_t M, uint32_t N, uint32_t strideA, uint32_t strideB, uint32_t strideY, float *restrict pDst) Glue code for strided matrix addition of 32-bit floating-point matrices. |
void | plp_mat_add_stride_f32_parallel(const float restrict pSrcA, const float restrict pSrcB, uint32_t M, uint32_t N, uint32_t strideA, uint32_t strideB, uint32_t strideY, uint32_t nPE, float *restrict pDst) Glue code for parallel strided matrix addition of 32-bit floating-point matrices. |
void | plp_mat_add_stride_i16(const int16_t restrict pSrcA, const int16_t restrict pSrcB, uint32_t M, uint32_t N, uint32_t strideA, uint32_t strideB, uint32_t strideY, int16_t *restrict pDst) Glue code for strided matrix addition of 16-bit integer matrices. |
void | plp_mat_add_stride_i16_parallel(const int16_t restrict pSrcA, const int16_t restrict pSrcB, uint32_t M, uint32_t N, uint32_t strideA, uint32_t strideB, uint32_t strideY, uint32_t nPE, int16_t *restrict pDst) Glue code for parallel strided matrix addition of 16-bit integer matrices. |
void | plp_mat_add_stride_i32(const int32_t restrict pSrcA, const int32_t restrict pSrcB, uint32_t M, uint32_t N, uint32_t strideA, uint32_t strideB, uint32_t strideY, int32_t *restrict pDst) Glue code for strided matrix addition of 16-bit integer matrices. |
void | plp_mat_add_stride_i32_parallel(const int32_t restrict pSrcA, const int32_t restrict pSrcB, uint32_t M, uint32_t N, uint32_t strideA, uint32_t strideB, uint32_t strideY, uint32_t nPE, int32_t *restrict pDst) Glue code for parallel strided matrix addition of 16-bit integer matrices. |
void | plp_mat_add_stride_i8(const int8_t restrict pSrcA, const int8_t restrict pSrcB, uint32_t M, uint32_t N, uint32_t strideA, uint32_t strideB, uint32_t strideY, int8_t *restrict pDst) Glue code for strided matrix addition of 16-bit integer matrices. |
void | plp_mat_add_stride_i8_parallel(const int8_t restrict pSrcA, const int8_t restrict pSrcB, uint32_t M, uint32_t N, uint32_t strideA, uint32_t strideB, uint32_t strideY, uint32_t nPE, int8_t *restrict pDst) Glue code for parallel strided matrix addition of 16-bit integer matrices. |
Detailed Description
This module contains the glue code for strided matrix addition. The kernel codes (kernels) are in the Module strided matrix addition Kernels.
The Matrx Addition adds two matrices, element wise. Both matrices, and the output matrix have dimension MxN.
`pDst[m, n] = pSrcA[m, n] + pSrcB[m, n]`
There are functions for integer 32- 16- and 8-bit data types, as well as for floating-point. These functions can also be used for fix-point matrices, if they have their fix-point at the same location. The outpt matrix will then also have the fix-point at the same location.
The naming scheme of the functions follows the following pattern (for example plp_mat_add_stride_i32
):
`plp_<function name>_<data type><precision>[_parallel]`
name | description |
---|---|
function_name | mat_add_stride |
data type | {f, i, q} respectively for floats, integers, fixed points |
precision | {32, 16, 8} bits |
The strideX
argument tells how many elements are in between the start of each row of the matrix. In other words, it is the width of the original matrix. Strided Matrix operations
Functions Documentation
function plp_mat_add_stride_f32
void plp_mat_add_stride_f32(
const float *__restrict__ pSrcA,
const float *__restrict__ pSrcB,
uint32_t M,
uint32_t N,
uint32_t strideA,
uint32_t strideB,
uint32_t strideY,
float *__restrict__ pDst
)
Glue code for strided matrix addition of 32-bit floating-point matrices.
Parameters:
- pSrcA Points to the first input matrix
- pSrcB Points to the second input matrix
- M Height of all matrices
- N Width of all matrices
- strideA Stride of matrix A (elements between each row)
- strideB Stride of matrid B (elements between each row)
- strideY Stride of output matrix (elements between each row)
- pDst Points to the output matrix
Return: none
Glue code for matrix addition of a 32-bit floating-point matrices.
function plp_mat_add_stride_f32_parallel
void plp_mat_add_stride_f32_parallel(
const float *__restrict__ pSrcA,
const float *__restrict__ pSrcB,
uint32_t M,
uint32_t N,
uint32_t strideA,
uint32_t strideB,
uint32_t strideY,
uint32_t nPE,
float *__restrict__ pDst
)
Glue code for parallel strided matrix addition of 32-bit floating-point matrices.
Parameters:
- pSrcA Points to the first input matrix
- pSrcB Points to the second input matrix
- M Height of all matrices
- N Width of all matrices
- strideA Stride of matrix A (elements between each row)
- strideB Stride of matrid B (elements between each row)
- strideY Stride of output matrix (elements between each row)
- nPE Number of cores to use for computation
- pDst Points to the output matrix
Return: none
Glue code for parallel matrix addition of a 32-bit floating-point matrices.
function plp_mat_add_stride_i16
void plp_mat_add_stride_i16(
const int16_t *__restrict__ pSrcA,
const int16_t *__restrict__ pSrcB,
uint32_t M,
uint32_t N,
uint32_t strideA,
uint32_t strideB,
uint32_t strideY,
int16_t *__restrict__ pDst
)
Glue code for strided matrix addition of 16-bit integer matrices.
Parameters:
- pSrcA Points to the first input matrix
- pSrcB Points to the second input matrix
- M Height of all matrices
- N Width of all matrices
- strideA Stride of matrix A (elements between each row)
- strideB Stride of matrid B (elements between each row)
- strideY Stride of output matrix (elements between each row)
- pDst Points to the output matrix
Return: none
Glue code for matrix addition of a 16-bit integer matrices.
function plp_mat_add_stride_i16_parallel
void plp_mat_add_stride_i16_parallel(
const int16_t *__restrict__ pSrcA,
const int16_t *__restrict__ pSrcB,
uint32_t M,
uint32_t N,
uint32_t strideA,
uint32_t strideB,
uint32_t strideY,
uint32_t nPE,
int16_t *__restrict__ pDst
)
Glue code for parallel strided matrix addition of 16-bit integer matrices.
Parameters:
- pSrcA Points to the first input matrix
- pSrcB Points to the second input matrix
- M Height of all matrices
- N Width of all matrices
- strideA Stride of matrix A (elements between each row)
- strideB Stride of matrid B (elements between each row)
- strideY Stride of output matrix (elements between each row)
- nPE Number of cores to use for computation
- pDst Points to the output matrix
Return: none
Glue code for parallel matrix addition of a 16-bit integer matrices.
function plp_mat_add_stride_i32
void plp_mat_add_stride_i32(
const int32_t *__restrict__ pSrcA,
const int32_t *__restrict__ pSrcB,
uint32_t M,
uint32_t N,
uint32_t strideA,
uint32_t strideB,
uint32_t strideY,
int32_t *__restrict__ pDst
)
Glue code for strided matrix addition of 16-bit integer matrices.
Parameters:
- pSrcA Points to the first input matrix
- pSrcB Points to the second input matrix
- M Height of all matrices
- N Width of all matrices
- strideA Stride of matrix A (elements between each row)
- strideB Stride of matrid B (elements between each row)
- strideY Stride of output matrix (elements between each row)
- pDst Points to the output matrix
Return: none
Glue code for matrix addition of a 32-bit integer matrices.
function plp_mat_add_stride_i32_parallel
void plp_mat_add_stride_i32_parallel(
const int32_t *__restrict__ pSrcA,
const int32_t *__restrict__ pSrcB,
uint32_t M,
uint32_t N,
uint32_t strideA,
uint32_t strideB,
uint32_t strideY,
uint32_t nPE,
int32_t *__restrict__ pDst
)
Glue code for parallel strided matrix addition of 16-bit integer matrices.
Parameters:
- pSrcA Points to the first input matrix
- pSrcB Points to the second input matrix
- M Height of all matrices
- N Width of all matrices
- strideA Stride of matrix A (elements between each row)
- strideB Stride of matrid B (elements between each row)
- strideY Stride of output matrix (elements between each row)
- nPE Number of cores to use for computation
- pDst Points to the output matrix
Return: none
Glue code for parallel matrix addition of a 32-bit integer matrices.
function plp_mat_add_stride_i8
void plp_mat_add_stride_i8(
const int8_t *__restrict__ pSrcA,
const int8_t *__restrict__ pSrcB,
uint32_t M,
uint32_t N,
uint32_t strideA,
uint32_t strideB,
uint32_t strideY,
int8_t *__restrict__ pDst
)
Glue code for strided matrix addition of 16-bit integer matrices.
Parameters:
- pSrcA Points to the first input matrix
- pSrcB Points to the second input matrix
- M Height of all matrices
- N Width of all matrices
- strideA Stride of matrix A (elements between each row)
- strideB Stride of matrid B (elements between each row)
- strideY Stride of output matrix (elements between each row)
- pDst Points to the output matrix
Return: none
Glue code for matrix addition of a 8-bit integer matrices.
function plp_mat_add_stride_i8_parallel
void plp_mat_add_stride_i8_parallel(
const int8_t *__restrict__ pSrcA,
const int8_t *__restrict__ pSrcB,
uint32_t M,
uint32_t N,
uint32_t strideA,
uint32_t strideB,
uint32_t strideY,
uint32_t nPE,
int8_t *__restrict__ pDst
)
Glue code for parallel strided matrix addition of 16-bit integer matrices.
Parameters:
- pSrcA Points to the first input matrix
- pSrcB Points to the second input matrix
- M Height of all matrices
- N Width of all matrices
- strideA Stride of matrix A (elements between each row)
- strideB Stride of matrid B (elements between each row)
- strideY Stride of output matrix (elements between each row)
- nPE Number of cores to use for computation
- pDst Points to the output matrix
Return: none
Glue code for parallel matrix addition of a 8-bit integer matrices.
Updated on 2023-03-01 at 16:16:31 +0000