Skip to content

Strided Matrix Copy Kernels

Module: Strided Matrix operations / Strided Matrix Copy

More...

Functions

Name
void plp_mat_copy_stride_f32p_xpulpv2(void * args)
Copy an MxN strided 32-bit floats matrix on XpulpV2 in parallel.
void plp_mat_copy_stride_f32s_xpulpv2(const float restrict pSrc, uint32_t M, uint32_t N, uint32_t strideSrc, uint32_t strideDst, float restrict pDst)
Copy an MxN strided 32-bit floats matrix on XpulpV2.
void plp_mat_copy_stride_i16p_xpulpv2(void * args)
Copy an MxN strided 16-bit integers matrix on XpulpV2 in parallel.
void plp_mat_copy_stride_i16s_rv32im(const int16_t restrict pSrc, uint32_t M, uint32_t N, uint32_t strideSrc, uint32_t strideDst, int16_t restrict pDst)
Copy an MxN strided 16-bit integers matrix on RV32IM.
void plp_mat_copy_stride_i16s_xpulpv2(const int16_t restrict pSrc, uint32_t M, uint32_t N, uint32_t strideSrc, uint32_t strideDst, int16_t restrict pDst)
Copy an MxN strided 16-bit integers matrix on XpulpV2.
void plp_mat_copy_stride_i32p_xpulpv2(void * args)
Copy an MxN strided 32-bit integers matrix on XpulpV2 in parallel.
void plp_mat_copy_stride_i32s_rv32im(const int32_t restrict pSrc, uint32_t M, uint32_t N, uint32_t strideSrc, uint32_t strideDst, int32_t restrict pDst)
Copy an MxN strided 32-bit integers matrix on RV32IM.
void plp_mat_copy_stride_i32s_xpulpv2(const int32_t restrict pSrc, uint32_t M, uint32_t N, uint32_t strideSrc, uint32_t strideDst, int32_t restrict pDst)
Copy an MxN strided 32-bit integers matrix on XpulpV2.
void plp_mat_copy_stride_i8p_xpulpv2(void * args)
Copy an MxN strided 8-bit integers matrix on XpulpV2 in parallel.
void plp_mat_copy_stride_i8s_rv32im(const int8_t restrict pSrc, uint32_t M, uint32_t N, uint32_t strideSrc, uint32_t strideDst, int8_t restrict pDst)
Copy an MxN strided 8-bit integers matrix on RV32IM.
void plp_mat_copy_stride_i8s_xpulpv2(const int8_t restrict pSrc, uint32_t M, uint32_t N, uint32_t strideSrc, uint32_t strideDst, int8_t restrict pDst)
Copy an MxN strided 8-bit integers matrix on XpulpV2.

Detailed Description

The source and destination matrix can have different strides.

There are functions for integer 32- 16- and 8-bit data types, as well as for floating-point. The naming scheme of the functions follows the following pattern (for example plp_mat_copy_stride_i32s_xpulpv2):

`plp_<function name>_<data type><precision><method>_<isa_extension>`
name description
function_name mat_copy_stride
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 strideSrc and strideDst 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_copy_stride_f32p_xpulpv2

void plp_mat_copy_stride_f32p_xpulpv2(
    void * args
)

Copy an MxN strided 32-bit floats matrix on XpulpV2 in parallel.

Parameters:

  • args pointer to plp_mat_mat_copy_stride_instance_f32 struct initialized by plp_mat_copy_stride_f32_parallel

Return: none

function plp_mat_copy_stride_f32s_xpulpv2

void plp_mat_copy_stride_f32s_xpulpv2(
    const float *__restrict__ pSrc,
    uint32_t M,
    uint32_t N,
    uint32_t strideSrc,
    uint32_t strideDst,
    float *__restrict__ pDst
)

Copy an MxN strided 32-bit floats matrix on XpulpV2.

Parameters:

  • pSrc Points to the input matrix of shape MxN
  • M Height of both matrices
  • N Width of both matrices
  • strideSrc Stride of the input matrix (elements between each row)
  • strideDst Stride of the output matrix (elements between each row)
  • pDst Points to the output matrix of shape MxN

Return: none

function plp_mat_copy_stride_i16p_xpulpv2

void plp_mat_copy_stride_i16p_xpulpv2(
    void * args
)

Copy an MxN strided 16-bit integers matrix on XpulpV2 in parallel.

Parameters:

  • args pointer to plp_mat_mat_copy_stride_instance_i16 struct initialized by plp_mat_copy_stride_i16_parallel

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.

function plp_mat_copy_stride_i16s_rv32im

void plp_mat_copy_stride_i16s_rv32im(
    const int16_t *__restrict__ pSrc,
    uint32_t M,
    uint32_t N,
    uint32_t strideSrc,
    uint32_t strideDst,
    int16_t *__restrict__ pDst
)

Copy an MxN strided 16-bit integers matrix on RV32IM.

Parameters:

  • pSrc Points to the input matrix of shape MxN
  • M Height of both matrices
  • N Width of both matrices
  • strideSrc Stride of the input matrix (elements between each row)
  • strideDst Stride of the output matrix (elements between each row)
  • pDst Points to the output matrix of shape MxN

Return: none

function plp_mat_copy_stride_i16s_xpulpv2

void plp_mat_copy_stride_i16s_xpulpv2(
    const int16_t *__restrict__ pSrc,
    uint32_t M,
    uint32_t N,
    uint32_t strideSrc,
    uint32_t strideDst,
    int16_t *__restrict__ pDst
)

Copy an MxN strided 16-bit integers matrix on XpulpV2.

Parameters:

  • pSrc Points to the input matrix of shape MxN
  • M Height of both matrices
  • N Width of both matrices
  • strideSrc Stride of the input matrix (elements between each row)
  • strideDst Stride of the output matrix (elements between each row)
  • pDst Points to the output matrix of shape MxN

Return: none

function plp_mat_copy_stride_i32p_xpulpv2

void plp_mat_copy_stride_i32p_xpulpv2(
    void * args
)

Copy an MxN strided 32-bit integers matrix on XpulpV2 in parallel.

Parameters:

  • args pointer to plp_mat_mat_copy_stride_instance_i32 struct initialized by plp_mat_copy_stride_i32_parallel

Return: none

function plp_mat_copy_stride_i32s_rv32im

void plp_mat_copy_stride_i32s_rv32im(
    const int32_t *__restrict__ pSrc,
    uint32_t M,
    uint32_t N,
    uint32_t strideSrc,
    uint32_t strideDst,
    int32_t *__restrict__ pDst
)

Copy an MxN strided 32-bit integers matrix on RV32IM.

Parameters:

  • pSrc Points to the input matrix of shape MxN
  • M Height of both matrices
  • N Width of both matrices
  • strideSrc Stride of the input matrix (elements between each row)
  • strideDst Stride of the output matrix (elements between each row)
  • pDst Points to the output matrix of shape MxN

Return: none

function plp_mat_copy_stride_i32s_xpulpv2

void plp_mat_copy_stride_i32s_xpulpv2(
    const int32_t *__restrict__ pSrc,
    uint32_t M,
    uint32_t N,
    uint32_t strideSrc,
    uint32_t strideDst,
    int32_t *__restrict__ pDst
)

Copy an MxN strided 32-bit integers matrix on XpulpV2.

Parameters:

  • pSrc Points to the input matrix of shape MxN
  • M Height of both matrices
  • N Width of both matrices
  • strideSrc Stride of the input matrix (elements between each row)
  • strideDst Stride of the output matrix (elements between each row)
  • pDst Points to the output matrix of shape MxN

Return: none

function plp_mat_copy_stride_i8p_xpulpv2

void plp_mat_copy_stride_i8p_xpulpv2(
    void * args
)

Copy an MxN strided 8-bit integers matrix on XpulpV2 in parallel.

Parameters:

  • args pointer to plp_mat_mat_copy_stride_instance_i8 struct initialized by plp_mat_copy_stride_i8_parallel

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.

function plp_mat_copy_stride_i8s_rv32im

void plp_mat_copy_stride_i8s_rv32im(
    const int8_t *__restrict__ pSrc,
    uint32_t M,
    uint32_t N,
    uint32_t strideSrc,
    uint32_t strideDst,
    int8_t *__restrict__ pDst
)

Copy an MxN strided 8-bit integers matrix on RV32IM.

Parameters:

  • pSrc Points to the input matrix of shape MxN
  • M Height of both matrices
  • N Width of both matrices
  • strideSrc Stride of the input matrix (elements between each row)
  • strideDst Stride of the output matrix (elements between each row)
  • pDst Points to the output matrix of shape MxN

Return: none

function plp_mat_copy_stride_i8s_xpulpv2

void plp_mat_copy_stride_i8s_xpulpv2(
    const int8_t *__restrict__ pSrc,
    uint32_t M,
    uint32_t N,
    uint32_t strideSrc,
    uint32_t strideDst,
    int8_t *__restrict__ pDst
)

Copy an MxN strided 8-bit integers matrix on XpulpV2.

Parameters:

  • pSrc Points to the input matrix of shape MxN
  • M Height of both matrices
  • N Width of both matrices
  • strideSrc Stride of the input matrix (elements between each row)
  • strideDst Stride of the output matrix (elements between each row)
  • pDst Points to the output matrix of shape MxN

Return: none


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