PULP DSP  Version 1.0
Digital Signal Processing library for PULP processors (pulp-platform.org)
 All Classes Files Functions Groups Pages
Modules | Functions
Matrix Matrix Multiplication

Modules

 Matrix Multiplication Kernels
 

Functions

void plp_mat_mult_i16 (const int16_t *__restrict__ pSrcA, const int16_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, int32_t *__restrict__ pDstC)
 Glue code for matrix mutliplication of 16-bit integer matrices. More...
 
void plp_mat_mult_i16_parallel (const int16_t *__restrict__ pSrcA, const int16_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, uint32_t nPE, int32_t *__restrict__ pDstC)
 Glue code for parallel matrix mutliplication of 16-bit integer matrices. More...
 
void plp_mat_mult_i32 (const int32_t *__restrict__ pSrcA, const int32_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, int32_t *__restrict__ pDstC)
 Glue code for matrix mutliplication of 32-bit integer matrices. More...
 
void plp_mat_mult_i32_parallel (const int32_t *__restrict__ pSrcA, const int32_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, uint32_t nPE, int32_t *__restrict__ pDstC)
 Glue code for parallel matrix mutliplication of 32-bit integer matrices. More...
 
void plp_mat_mult_i8 (const int8_t *__restrict__ pSrcA, const int8_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, int32_t *__restrict__ pDstC)
 Glue code for matrix mutliplication of 8-bit integer matrices. More...
 
void plp_mat_mult_i8_parallel (const int8_t *__restrict__ pSrcA, const int8_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, uint32_t nPE, int32_t *__restrict__ pDstC)
 Glue code for parallel matrix mutliplication of 8-bit integer matrices. More...
 

Detailed Description

This module contains the glue code for Matrix Matrix Multiplication. The kernel codes (kernels) are in the Moducle Matrix Matrix Multiplication Kernels.

The Matrix Matrix Multiplication computes the product of two matrices with dimensions MxN and NxO. The first matrix is accessed row wise, the second column wise, all values form the first are multiplied with the values of the second and then sum of the result gives the value for the result matrix.

    pDst[i,k] = pSrcA[i*M]*pSrcB[k] + pSrcA[i*M+1]*pSrcB[O+k] + ... + pSrcA[i*M+N-1]*pSrcB[O*(N-1)+k]

There are functions for integer 32- 16- and 8-bit data types. For lower precision integers (16- and 8-bit), functions exploiting SIMD instructions are provided.

The naming scheme of the functions follows the following pattern (for example plp_mat_mult_i32s):

<pulp> _ <function name> _ <data type> <precision> <method> _ <isa extension>, with
data type = {f, i, q} respectively for floats, integers, fixed points
precision = {32, 16, 8} bits
method = {s, v, p} meaning single (or scalar, i.e. not using packed SIMD), vectorized (i.e. using SIMD instructions), and parallel (for multicore parallel computing), respectively.
isa extension = rv32im, xpulpv2, etc. of which rv32im is the most general one.
 

Function Documentation

void plp_mat_mult_i16 ( const int16_t *__restrict__  pSrcA,
const int16_t *__restrict__  pSrcB,
uint32_t  M,
uint32_t  N,
uint32_t  O,
int32_t *__restrict__  pDstC 
)

Glue code for matrix mutliplication of 16-bit integer matrices.

Glue code for matrix matrix multiplication of a 16-bit integer matrices.

Parameters
[in]pSrcApoints to the first input matrix
[in]pSrcBpoints to the second input matrix
[in]Mheight of the first input matrix
[in]Nwidth of the first input matrix and hight of the second
[in]Owidth of the second input matrix
[out]pDstCpoints to the output matrix
Returns
none
void plp_mat_mult_i16_parallel ( const int16_t *__restrict__  pSrcA,
const int16_t *__restrict__  pSrcB,
uint32_t  M,
uint32_t  N,
uint32_t  O,
uint32_t  nPE,
int32_t *__restrict__  pDstC 
)

Glue code for parallel matrix mutliplication of 16-bit integer matrices.

Glue code for parallel matrix matrix multiplication of a 16-bit integer matrices.

Parameters
[in]pSrcApoints to the first input matrix
[in]pSrcBpoints to the second input matrix
[in]Mheight of the first input matrix
[in]Nwidth of the first input matrix and hight of the second
[in]Owidth of the second input matrix
[in]nPENumber of cores to use
[out]pDstCpoints to the output matrix
Returns
none
void plp_mat_mult_i32 ( const int32_t *__restrict__  pSrcA,
const int32_t *__restrict__  pSrcB,
uint32_t  M,
uint32_t  N,
uint32_t  O,
int32_t *__restrict__  pDstC 
)

Glue code for matrix mutliplication of 32-bit integer matrices.

Glue code for matrix matrix multiplication of a 32-bit integer matrices.

Parameters
[in]pSrcApoints to the first input matrix
[in]pSrcBpoints to the second input matrix
[in]Mheight of the first input matrix
[in]Nwidth of the first input matrix and hight of the second
[in]Owidth of the second input matrix
[out]pDstCpoints to the output matrix
Returns
none
void plp_mat_mult_i32_parallel ( const int32_t *__restrict__  pSrcA,
const int32_t *__restrict__  pSrcB,
uint32_t  M,
uint32_t  N,
uint32_t  O,
uint32_t  nPE,
int32_t *__restrict__  pDstC 
)

Glue code for parallel matrix mutliplication of 32-bit integer matrices.

Glue code for parallel matrix matrix multiplication of a 32-bit integer matrices.

Parameters
[in]pSrcApoints to the first input matrix
[in]pSrcBpoints to the second input matrix
[in]Mheight of the first input matrix
[in]Nwidth of the first input matrix and hight of the second
[in]Owidth of the second input matrix
[in]nPENumber of cores to use
[out]pDstCpoints to the output matrix
Returns
none
void plp_mat_mult_i8 ( const int8_t *__restrict__  pSrcA,
const int8_t *__restrict__  pSrcB,
uint32_t  M,
uint32_t  N,
uint32_t  O,
int32_t *__restrict__  pDstC 
)

Glue code for matrix mutliplication of 8-bit integer matrices.

Glue code for matrix matrix multiplication of a 8-bit integer matrices.

Parameters
[in]pSrcApoints to the first input matrix
[in]pSrcBpoints to the second input matrix
[in]Mheight of the first input matrix
[in]Nwidth of the first input matrix and hight of the second
[in]Owidth of the second input matrix
[out]pDstCpoints to the output matrix
Returns
none
void plp_mat_mult_i8_parallel ( const int8_t *__restrict__  pSrcA,
const int8_t *__restrict__  pSrcB,
uint32_t  M,
uint32_t  N,
uint32_t  O,
uint32_t  nPE,
int32_t *__restrict__  pDstC 
)

Glue code for parallel matrix mutliplication of 8-bit integer matrices.

Glue code for parallel matrix matrix multiplication of a 8-bit integer matrices.

Parameters
[in]pSrcApoints to the first input matrix
[in]pSrcBpoints to the second input matrix
[in]Mheight of the first input matrix
[in]Nwidth of the first input matrix and hight of the second
[in]Owidth of the second input matrix
[in]nPENumber of cores to use
[out]pDstCpoints to the output matrix
Returns
none