Skip to content

Strided Matrix Transpose Matrix Multiplication Kernels

Module: Strided Matrix operations / Strided Matrix Transposed Matrix Multiplication

More...

Functions

Name
void plp_mat_mult_trans_stride_f32p_xpulpv2(void * args)
Parallel strided matrix multiplication of 32-bit floating-point matrices kernel for XPULPV2 extension.
void plp_mat_mult_trans_stride_f32s_xpulpv2(const float restrict pSrcA, const float restrict pSrcB, uint32_t M, uint32_t N, uint32_t O, uint32_t strideA, uint32_t strideB, uint32_t strideC, float *restrict pDstC)
Matrix multiplication of 32-bit floating-point matrices kernel for XPULPV2 extension.
void plp_mat_mult_trans_stride_i16p_xpulpv2(void * args)
Parallel strided matrix multiplication of 16-bit integer matrices kernel for XPULPV2 extension.
void plp_mat_mult_trans_stride_i16s_rv32im(const int16_t restrict pSrcA, const int16_t restrict pSrcB, uint32_t M, uint32_t N, uint32_t O, uint32_t strideA, uint32_t strideB, uint32_t strideC, int32_t *restrict pDstC)
Matrix multiplication of 16-bit integer matrices kernel for RV32IM extension.
void plp_mat_mult_trans_stride_i16s_xpulpv2(const int16_t restrict pSrcA, const int16_t restrict pSrcB, uint32_t M, uint32_t N, uint32_t O, uint32_t strideA, uint32_t strideB, uint32_t strideC, int32_t *restrict pDstC)
Matrix multiplication of 16-bit integer matrices kernel for XPULPV2 extension.
void plp_mat_mult_trans_stride_i32p_xpulpv2(void * args)
Parallel strided matrix multiplication of 32-bit integer matrices kernel for XPULPV2 extension.
void plp_mat_mult_trans_stride_i32s_rv32im(const int32_t restrict pSrcA, const int32_t restrict pSrcB, uint32_t M, uint32_t N, uint32_t O, uint32_t strideA, uint32_t strideB, uint32_t strideC, int32_t *restrict pDstC)
Matrix multiplication of 32-bit integer matrices kernel for RV32IM extension.
void plp_mat_mult_trans_stride_i32s_xpulpv2(const int32_t restrict pSrcA, const int32_t restrict pSrcB, uint32_t M, uint32_t N, uint32_t O, uint32_t strideA, uint32_t strideB, uint32_t strideC, int32_t *restrict pDstC)
Matrix multiplication of 32-bit integer matrices kernel for XPULPV2 extension.
void plp_mat_mult_trans_stride_i8p_xpulpv2(void * args)
Parallel strided matrix multiplication of 8-bit integer matrices kernel for XPULPV2 extension.
void plp_mat_mult_trans_stride_i8s_rv32im(const int8_t restrict pSrcA, const int8_t restrict pSrcB, uint32_t M, uint32_t N, uint32_t O, uint32_t strideA, uint32_t strideB, uint32_t strideC, int32_t *restrict pDstC)
Matrix multiplication of 8-bit integer matrices kernel for RV32IM extension.
void plp_mat_mult_trans_stride_i8s_xpulpv2(const int8_t restrict pSrcA, const int8_t restrict pSrcB, uint32_t M, uint32_t N, uint32_t O, uint32_t strideA, uint32_t strideB, uint32_t strideC, int32_t *restrict pDstC)
Matrix multiplication of 8-bit integer matrices kernel for XPULPV2 extension.
void plp_mat_mult_trans_stride_q16p_xpulpv2(void * args)
Parallel Matrix multiplication of 16-bit fix-point matrices kernel for XPULPV2 extension.
void plp_mat_mult_trans_stride_q16s_rv32im(const int16_t restrict pSrcA, const int16_t restrict pSrcB, uint32_t M, uint32_t N, uint32_t O, uint32_t strideA, uint32_t strideB, uint32_t strideC, uint32_t shift, int16_t *restrict pDstC)
Matrix multiplication of 16-bit integer matrices kernel for RV32IM extension.
void plp_mat_mult_trans_stride_q16s_xpulpv2(const int16_t restrict pSrcA, const int16_t restrict pSrcB, uint32_t M, uint32_t N, uint32_t O, uint32_t strideA, uint32_t strideB, uint32_t strideC, uint32_t shift, int16_t *restrict pDstC)
Matrix multiplication of 16-bit integer matrices kernel for XPULPV2 extension.
void plp_mat_mult_trans_stride_q32p_xpulpv2(void * args)
Parallel Matrix multiplication of 32-bit fix-point matrices kernel for XPULPV2 extension.
void plp_mat_mult_trans_stride_q32s_rv32im(const int32_t restrict pSrcA, const int32_t restrict pSrcB, uint32_t M, uint32_t N, uint32_t O, uint32_t strideA, uint32_t strideB, uint32_t strideC, uint32_t shift, int32_t *restrict pDstC)
Matrix multiplication of 32-bit integer matrices kernel for RV32IM extension.
void plp_mat_mult_trans_stride_q32s_xpulpv2(const int32_t restrict pSrcA, const int32_t restrict pSrcB, uint32_t M, uint32_t N, uint32_t O, uint32_t strideA, uint32_t strideB, uint32_t strideC, uint32_t shift, int32_t *restrict pDstC)
Matrix multiplication of 32-bit integer matrices kernel for XPULPV2 extension.
void plp_mat_mult_trans_stride_q8p_xpulpv2(void * args)
Parallel Matrix multiplication of 8-bit fix-point matrices kernel for XPULPV2 extension.
void plp_mat_mult_trans_stride_q8s_rv32im(const int8_t restrict pSrcA, const int8_t restrict pSrcB, uint32_t M, uint32_t N, uint32_t O, uint32_t strideA, uint32_t strideB, uint32_t strideC, uint32_t shift, int8_t *restrict pDstC)
Matrix multiplication of 8-bit integer matrices kernel for RV32IM extension.
void plp_mat_mult_trans_stride_q8s_xpulpv2(const int8_t restrict pSrcA, const int8_t restrict pSrcB, uint32_t M, uint32_t N, uint32_t O, uint32_t strideA, uint32_t strideB, uint32_t strideC, uint32_t shift, int8_t *restrict pDstC)
Matrix multiplication of 8-bit integer matrices kernel for XPULPV2 extension.

Detailed Description

This module contains the kernels for strided matrix transpose matrix multiplications.

The Matrix Transpose Matrix Multiplication computes the product of two matrices with dimensions MxN and OxN. Both matrices is accessed row 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. The resulting matrix has shape MxO.

'pDst[m,o] = pSrcA[m,0]*pSrcB[o,0] + pSrcA[m,1]*pSrcB[o,1] + ... + pSrcA[m,N-1]*pSrcB[o,N-1]`

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_stride_i32s_xpulpv2):

`plp_<function name>_<data type><precision><method>_<isa_extension>`
name description
function_name mat_mult
data type {f, i, q} respectively for floats, integers, fixed points
precision {32, 16, 8} bits
method {s, v, p} meaning scalar, vectorized (i.e. SIMD) and parallel, respectively
isa_extension {rv32im, xpulpv2} respectively for ibex and riscy

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_mult_trans_stride_f32p_xpulpv2

void plp_mat_mult_trans_stride_f32p_xpulpv2(
    void * args
)

Parallel strided matrix multiplication of 32-bit floating-point matrices kernel for XPULPV2 extension.

Parameters:

Return: none

Parallel strided matrix transposed matrix multiplication of 32-bit floating-point matrices kernel for XPULPV2 extension.

function plp_mat_mult_trans_stride_f32s_xpulpv2

void plp_mat_mult_trans_stride_f32s_xpulpv2(
    const float *__restrict__ pSrcA,
    const float *__restrict__ pSrcB,
    uint32_t M,
    uint32_t N,
    uint32_t O,
    uint32_t strideA,
    uint32_t strideB,
    uint32_t strideC,
    float *__restrict__ pDstC
)

Matrix multiplication of 32-bit floating-point matrices kernel for XPULPV2 extension.

Parameters:

  • pSrcA points to the first input matrix
  • pSrcB points to the second input matrix
  • M height of the first input matrix
  • N width of the first input matrix and hight of the second
  • O width of the second input matrix
  • strideA Stride of matrix A (elements between each row)
  • strideB Stride of matrix B (elements between each row)
  • strideC Stride of output matrix (elements between each row)
  • pDstC points to the output matrix

Return: none

strided matrix transposed matrix multiplication of a 32-bit floating-point matrices for XPULPV2 extension.

function plp_mat_mult_trans_stride_i16p_xpulpv2

void plp_mat_mult_trans_stride_i16p_xpulpv2(
    void * args
)

Parallel strided matrix multiplication of 16-bit integer matrices kernel for XPULPV2 extension.

Parameters:

Return: none

Par: Exploiting SIMD instructions

The 16 bit values are packed two each into 32 bit vectors and then the two dot products are performed on 32 bit vectors, with 32 bit accumulator.

Parallel strided matrix transposed matrix multiplication of a 16-bit integer matrices for XPULPV2 extension.

function plp_mat_mult_trans_stride_i16s_rv32im

void plp_mat_mult_trans_stride_i16s_rv32im(
    const int16_t *__restrict__ pSrcA,
    const int16_t *__restrict__ pSrcB,
    uint32_t M,
    uint32_t N,
    uint32_t O,
    uint32_t strideA,
    uint32_t strideB,
    uint32_t strideC,
    int32_t *__restrict__ pDstC
)

Matrix multiplication of 16-bit integer matrices kernel for RV32IM extension.

Parameters:

  • pSrcA points to the first input matrix
  • pSrcB points to the second input matrix
  • M height of the first input matrix
  • N width of the first input matrix and hight of the second
  • O width of the second input matrix
  • strideA Stride of matrix A (elements between each row)
  • strideB Stride of matrix B (elements between each row)
  • strideC Stride of output matrix (elements between each row)
  • pDstC points to the output matrix

Return: none

strided matrix transposed matrix multiplication of a 16-bit integer matrices for RV32IM extension.

function plp_mat_mult_trans_stride_i16s_xpulpv2

void plp_mat_mult_trans_stride_i16s_xpulpv2(
    const int16_t *__restrict__ pSrcA,
    const int16_t *__restrict__ pSrcB,
    uint32_t M,
    uint32_t N,
    uint32_t O,
    uint32_t strideA,
    uint32_t strideB,
    uint32_t strideC,
    int32_t *__restrict__ pDstC
)

Matrix multiplication of 16-bit integer matrices kernel for XPULPV2 extension.

Parameters:

  • pSrcA points to the first input matrix
  • pSrcB points to the second input matrix
  • M height of the first input matrix
  • N width of the first input matrix and hight of the second
  • O width of the second input matrix
  • strideA Stride of matrix A (elements between each row)
  • strideB Stride of matrix B (elements between each row)
  • strideC Stride of output matrix (elements between each row)
  • pDstC points to the output matrix

Return: none

strided matrix transposed matrix multiplication of a 16-bit integer matrices for XPULPV2 extension.

function plp_mat_mult_trans_stride_i32p_xpulpv2

void plp_mat_mult_trans_stride_i32p_xpulpv2(
    void * args
)

Parallel strided matrix multiplication of 32-bit integer matrices kernel for XPULPV2 extension.

Parameters:

Return: none

Parallel strided matrix transposed matrix multiplication of a 32-bit integer matrices for RV32IM extension.

function plp_mat_mult_trans_stride_i32s_rv32im

void plp_mat_mult_trans_stride_i32s_rv32im(
    const int32_t *__restrict__ pSrcA,
    const int32_t *__restrict__ pSrcB,
    uint32_t M,
    uint32_t N,
    uint32_t O,
    uint32_t strideA,
    uint32_t strideB,
    uint32_t strideC,
    int32_t *__restrict__ pDstC
)

Matrix multiplication of 32-bit integer matrices kernel for RV32IM extension.

Parameters:

  • pSrcA points to the first input matrix
  • pSrcB points to the second input matrix
  • M height of the first input matrix
  • N width of the first input matrix and hight of the second
  • O width of the second input matrix
  • strideA Stride of matrix A (elements between each row)
  • strideB Stride of matrix B (elements between each row)
  • strideC Stride of output matrix (elements between each row)
  • pDstC points to the output matrix

Return: none

strided matrix transposed matrix multiplication of a 32-bit integer matrices for RV32IM extension.

function plp_mat_mult_trans_stride_i32s_xpulpv2

void plp_mat_mult_trans_stride_i32s_xpulpv2(
    const int32_t *__restrict__ pSrcA,
    const int32_t *__restrict__ pSrcB,
    uint32_t M,
    uint32_t N,
    uint32_t O,
    uint32_t strideA,
    uint32_t strideB,
    uint32_t strideC,
    int32_t *__restrict__ pDstC
)

Matrix multiplication of 32-bit integer matrices kernel for XPULPV2 extension.

Parameters:

  • pSrcA points to the first input matrix
  • pSrcB points to the second input matrix
  • M height of the first input matrix
  • N width of the first input matrix and hight of the second
  • O width of the second input matrix
  • strideA Stride of matrix A (elements between each row)
  • strideB Stride of matrix B (elements between each row)
  • strideC Stride of output matrix (elements between each row)
  • pDstC points to the output matrix

Return: none

strided matrix transposed matrix multiplication of a 32-bit integer matrices for XPULPV2 extension.

function plp_mat_mult_trans_stride_i8p_xpulpv2

void plp_mat_mult_trans_stride_i8p_xpulpv2(
    void * args
)

Parallel strided matrix multiplication of 8-bit integer matrices kernel for XPULPV2 extension.

Parameters:

Return: none

Par: Exploiting SIMD instructions

The 8 bit values are packed four each into 32 bit vectors and then the four dot products are performed on 32 bit vectors, with 32 bit accumulator.

Parallel strided matrix transposed matrix multiplication of a 8-bit integer matrices for XPULPV2 extension.

function plp_mat_mult_trans_stride_i8s_rv32im

void plp_mat_mult_trans_stride_i8s_rv32im(
    const int8_t *__restrict__ pSrcA,
    const int8_t *__restrict__ pSrcB,
    uint32_t M,
    uint32_t N,
    uint32_t O,
    uint32_t strideA,
    uint32_t strideB,
    uint32_t strideC,
    int32_t *__restrict__ pDstC
)

Matrix multiplication of 8-bit integer matrices kernel for RV32IM extension.

Parameters:

  • pSrcA points to the first input matrix
  • pSrcB points to the second input matrix
  • M height of the first input matrix
  • N width of the first input matrix and hight of the second
  • O width of the second input matrix
  • strideA Stride of matrix A (elements between each row)
  • strideB Stride of matrix B (elements between each row)
  • strideC Stride of output matrix (elements between each row)
  • pDstC points to the output matrix

Return: none

strided matrix transposed matrix multiplication of a 8-bit integer matrices for RV32IM extension.

function plp_mat_mult_trans_stride_i8s_xpulpv2

void plp_mat_mult_trans_stride_i8s_xpulpv2(
    const int8_t *__restrict__ pSrcA,
    const int8_t *__restrict__ pSrcB,
    uint32_t M,
    uint32_t N,
    uint32_t O,
    uint32_t strideA,
    uint32_t strideB,
    uint32_t strideC,
    int32_t *__restrict__ pDstC
)

Matrix multiplication of 8-bit integer matrices kernel for XPULPV2 extension.

Parameters:

  • pSrcA points to the first input matrix
  • pSrcB points to the second input matrix
  • M height of the first input matrix
  • N width of the first input matrix and hight of the second
  • O width of the second input matrix
  • strideA Stride of matrix A (elements between each row)
  • strideB Stride of matrix B (elements between each row)
  • strideC Stride of output matrix (elements between each row)
  • pDstC points to the output matrix

Return: none

strided matrix transposed matrix multiplication of a 8-bit integer matrices for XPULPV2 extension.

function plp_mat_mult_trans_stride_q16p_xpulpv2

void plp_mat_mult_trans_stride_q16p_xpulpv2(
    void * args
)

Parallel Matrix multiplication of 16-bit fix-point matrices kernel for XPULPV2 extension.

Parameters:

Return: none

Par: Fix-Point and Shifting

The result will be shifted by the parameter shift to the right (multiplied by 2^-shift). Assume that matrix A is represented as pSrcA * 2^-x, and matrix B as pSrcB * 2^-y (in other words, A has it's x last digits after the binary point). Then, the output is represented as pDstC * 2^-(x + y - shift).

Parallel strided matrix transposed matrix multiplication of 16-bit fix-point matrices kernel for XPULPV2 extension.

The output of the strided matrix multiplication will also be stored as an 16-bit array. Set the shift parameter such that no overflow ocurrs.

function plp_mat_mult_trans_stride_q16s_rv32im

void plp_mat_mult_trans_stride_q16s_rv32im(
    const int16_t *__restrict__ pSrcA,
    const int16_t *__restrict__ pSrcB,
    uint32_t M,
    uint32_t N,
    uint32_t O,
    uint32_t strideA,
    uint32_t strideB,
    uint32_t strideC,
    uint32_t shift,
    int16_t *__restrict__ pDstC
)

Matrix multiplication of 16-bit integer matrices kernel for RV32IM extension.

Parameters:

  • pSrcA points to the first input matrix
  • pSrcB points to the second input matrix
  • M height of the first input matrix
  • N width of the first input matrix and hight of the second
  • O width of the second input matrix
  • strideA Stride of matrix A (elements between each row)
  • strideB Stride of matrix B (elements between each row)
  • strideC Stride of output matrix (elements between each row)
  • shift Amount to shift the result of each multiplication.
  • pDstC points to the output matrix

Return: none

Par: Fix-Point and Shifting

The result will be shifted by the parameter shift to the right (multiplied by 2^-shift). Assume that matrix A is represented as pSrcA * 2^-x, and matrix B as pSrcB * 2^-y (in other words, A has it's x last digits after the binary point). Then, the output is represented as pDstC * 2^-(x + y - shift).

strided matrix transposed matrix multiplication of a 16-bit fix-point matrices for RV32IM extension.

The output of the strided matrix multiplication will also be stored as an 16-bit array. Set the shift parameter such that no overflow ocurrs.

function plp_mat_mult_trans_stride_q16s_xpulpv2

void plp_mat_mult_trans_stride_q16s_xpulpv2(
    const int16_t *__restrict__ pSrcA,
    const int16_t *__restrict__ pSrcB,
    uint32_t M,
    uint32_t N,
    uint32_t O,
    uint32_t strideA,
    uint32_t strideB,
    uint32_t strideC,
    uint32_t shift,
    int16_t *__restrict__ pDstC
)

Matrix multiplication of 16-bit integer matrices kernel for XPULPV2 extension.

Parameters:

  • pSrcA points to the first input matrix
  • pSrcB points to the second input matrix
  • M height of the first input matrix
  • N width of the first input matrix and hight of the second
  • O width of the second input matrix
  • strideA Stride of matrix A (elements between each row)
  • strideB Stride of matrix B (elements between each row)
  • strideC Stride of output matrix (elements between each row)
  • shift Amount to shift the result of each multiplication.
  • pDstC points to the output matrix

Return: none

Par: Fix-Point and Shifting

The result will be shifted by the parameter shift to the right (multiplied by 2^-shift). Assume that matrix A is represented as pSrcA * 2^-x, and matrix B as pSrcB * 2^-y (in other words, A has it's x last digits after the binary point). Then, the output is represented as pDstC * 2^-(x + y - shift).

strided matrix transposed matrix multiplication of a 16-bit fix-point matrices for XPULPV2 extension.

The output of the strided matrix multiplication will also be stored as an 16-bit array. Set the shift parameter such that no overflow ocurrs.

function plp_mat_mult_trans_stride_q32p_xpulpv2

void plp_mat_mult_trans_stride_q32p_xpulpv2(
    void * args
)

Parallel Matrix multiplication of 32-bit fix-point matrices kernel for XPULPV2 extension.

Parameters:

Return: none

Par: Fix-Point and Shifting

The result will be shifted by the parameter shift to the right (multiplied by 2^-shift). Assume that matrix A is represented as pSrcA * 2^-x, and matrix B as pSrcB * 2^-y (in other words, A has it's x last digits after the binary point). Then, the output is represented as pDstC * 2^-(x + y - shift).

Parallel strided matrix transposed matrix multiplication of 32-bit fix-point matrices kernel for XPULPV2 extension.

function plp_mat_mult_trans_stride_q32s_rv32im

void plp_mat_mult_trans_stride_q32s_rv32im(
    const int32_t *__restrict__ pSrcA,
    const int32_t *__restrict__ pSrcB,
    uint32_t M,
    uint32_t N,
    uint32_t O,
    uint32_t strideA,
    uint32_t strideB,
    uint32_t strideC,
    uint32_t shift,
    int32_t *__restrict__ pDstC
)

Matrix multiplication of 32-bit integer matrices kernel for RV32IM extension.

Parameters:

  • pSrcA points to the first input matrix
  • pSrcB points to the second input matrix
  • M height of the first input matrix
  • N width of the first input matrix and hight of the second
  • O width of the second input matrix
  • strideA Stride of matrix A (elements between each row)
  • strideB Stride of matrix B (elements between each row)
  • strideC Stride of output matrix (elements between each row)
  • shift Amount to shift the result of each multiplication.
  • pDstC points to the output matrix

Return: none

Par: Fix-Point and Shifting

The result will be shifted by the parameter shift to the right (multiplied by 2^-shift). Assume that matrix A is represented as pSrcA * 2^-x, and matrix B as pSrcB * 2^-y (in other words, A has it's x last digits after the binary point). Then, the output is represented as pDstC * 2^-(x + y - shift).

strided matrix transposed matrix multiplication of a 32-bit fix-point matrices for RV32IM extension.

function plp_mat_mult_trans_stride_q32s_xpulpv2

void plp_mat_mult_trans_stride_q32s_xpulpv2(
    const int32_t *__restrict__ pSrcA,
    const int32_t *__restrict__ pSrcB,
    uint32_t M,
    uint32_t N,
    uint32_t O,
    uint32_t strideA,
    uint32_t strideB,
    uint32_t strideC,
    uint32_t shift,
    int32_t *__restrict__ pDstC
)

Matrix multiplication of 32-bit integer matrices kernel for XPULPV2 extension.

Parameters:

  • pSrcA points to the first input matrix
  • pSrcB points to the second input matrix
  • M height of the first input matrix
  • N width of the first input matrix and hight of the second
  • O width of the second input matrix
  • strideA Stride of matrix A (elements between each row)
  • strideB Stride of matrix B (elements between each row)
  • strideC Stride of output matrix (elements between each row)
  • shift Amount to shift the result of each multiplication.
  • pDstC points to the output matrix

Return: none

Par: Fix-Point and Shifting

The result will be shifted by the parameter shift to the right (multiplied by 2^-shift). Assume that matrix A is represented as pSrcA * 2^-x, and matrix B as pSrcB * 2^-y (in other words, A has it's x last digits after the binary point). Then, the output is represented as pDstC * 2^-(x + y - shift).

strided matrix transposed matrix multiplication of a 32-bit fix-point matrices for XPULPV2 extension.

function plp_mat_mult_trans_stride_q8p_xpulpv2

void plp_mat_mult_trans_stride_q8p_xpulpv2(
    void * args
)

Parallel Matrix multiplication of 8-bit fix-point matrices kernel for XPULPV2 extension.

Parameters:

Return: none

Par: Fix-Point and Shifting

The result will be shifted by the parameter shift to the right (multiplied by 2^-shift). Assume that matrix A is represented as pSrcA * 2^-x, and matrix B as pSrcB * 2^-y (in other words, A has it's x last digits after the binary point). Then, the output is represented as pDstC * 2^-(x + y - shift).

Parallel strided matrix transposed matrix multiplication of 8-bit fix-point matrices kernel for XPULPV2 extension.

The output of the strided matrix multiplication will also be stored as an 8-bit array. Set the shift parameter such that no overflow ocurrs.

function plp_mat_mult_trans_stride_q8s_rv32im

void plp_mat_mult_trans_stride_q8s_rv32im(
    const int8_t *__restrict__ pSrcA,
    const int8_t *__restrict__ pSrcB,
    uint32_t M,
    uint32_t N,
    uint32_t O,
    uint32_t strideA,
    uint32_t strideB,
    uint32_t strideC,
    uint32_t shift,
    int8_t *__restrict__ pDstC
)

Matrix multiplication of 8-bit integer matrices kernel for RV32IM extension.

Parameters:

  • pSrcA points to the first input matrix
  • pSrcB points to the second input matrix
  • M height of the first input matrix
  • N width of the first input matrix and hight of the second
  • O width of the second input matrix
  • strideA Stride of matrix A (elements between each row)
  • strideB Stride of matrix B (elements between each row)
  • strideC Stride of output matrix (elements between each row)
  • shift Amount to shift the result of each multiplication.
  • pDstC points to the output matrix

Return: none

Par: Fix-Point and Shifting

The result will be shifted by the parameter shift to the right (multiplied by 2^-shift). Assume that matrix A is represented as pSrcA * 2^-x, and matrix B as pSrcB * 2^-y (in other words, A has it's x last digits after the binary point). Then, the output is represented as pDstC * 2^-(x + y - shift).

strided matrix transposed matrix multiplication of a 8-bit fix-point matrices for RV32IM extension.

The output of the strided matrix multiplication will also be stored as an 8-bit array. Set the shift parameter such that no overflow ocurrs.

function plp_mat_mult_trans_stride_q8s_xpulpv2

void plp_mat_mult_trans_stride_q8s_xpulpv2(
    const int8_t *__restrict__ pSrcA,
    const int8_t *__restrict__ pSrcB,
    uint32_t M,
    uint32_t N,
    uint32_t O,
    uint32_t strideA,
    uint32_t strideB,
    uint32_t strideC,
    uint32_t shift,
    int8_t *__restrict__ pDstC
)

Matrix multiplication of 8-bit integer matrices kernel for XPULPV2 extension.

Parameters:

  • pSrcA points to the first input matrix
  • pSrcB points to the second input matrix
  • M height of the first input matrix
  • N width of the first input matrix and hight of the second
  • O width of the second input matrix
  • strideA Stride of matrix A (elements between each row)
  • strideB Stride of matrix B (elements between each row)
  • strideC Stride of output matrix (elements between each row)
  • shift Amount to shift the result of each multiplication.
  • pDstC points to the output matrix

Return: none

Par: Fix-Point and Shifting

The result will be shifted by the parameter shift to the right (multiplied by 2^-shift). Assume that matrix A is represented as pSrcA * 2^-x, and matrix B as pSrcB * 2^-y (in other words, A has it's x last digits after the binary point). Then, the output is represented as pDstC * 2^-(x + y - shift).

strided matrix transposed matrix multiplication of a 8-bit fix-point matrices for XPULPV2 extension.

The output of the strided matrix multiplication will also be stored as an 8-bit array. Set the shift parameter such that no overflow ocurrs.


Updated on 2023-03-01 at 16:16:32 +0000