Skip to content

Strided Matrix Copy

Module: Strided Matrix operations

More...

Modules

Name
Strided Matrix Copy Kernels

Functions

Name
void plp_mat_copy_stride_f32(const float restrict pSrc, uint32_t M, uint32_t N, uint32_t strideSrc, uint32_t strideDst, float restrict pDst)
Glue code to copy an MxN strided 32-bit floats matrix.
void plp_mat_copy_stride_f32_parallel(const float restrict pSrc, uint32_t M, uint32_t N, uint32_t strideSrc, uint32_t strideDst, uint32_t nPE, float restrict pDst)
Glue code to copy an MxN strided 32-bit floats matrix in parallel.
void plp_mat_copy_stride_i16(const int16_t restrict pSrc, uint32_t M, uint32_t N, uint32_t strideSrc, uint32_t strideDst, int16_t restrict pDst)
Glue code to copy an MxN strided 16-bit integers matrix.
void plp_mat_copy_stride_i16_parallel(const int16_t restrict pSrc, uint32_t M, uint32_t N, uint32_t strideSrc, uint32_t strideDst, uint32_t nPE, int16_t restrict pDst)
Glue code to copy an MxN strided 16-bit integers matrix in parallel.
void plp_mat_copy_stride_i32(const int32_t restrict pSrc, uint32_t M, uint32_t N, uint32_t strideSrc, uint32_t strideDst, int32_t restrict pDst)
Glue code to copy an MxN strided 32-bit integers matrix.
void plp_mat_copy_stride_i32_parallel(const int32_t restrict pSrc, uint32_t M, uint32_t N, uint32_t strideSrc, uint32_t strideDst, uint32_t nPE, int32_t restrict pDst)
Glue code to copy an MxN strided 32-bit integers matrix in parallel.
void plp_mat_copy_stride_i8(const int8_t restrict pSrc, uint32_t M, uint32_t N, uint32_t strideSrc, uint32_t strideDst, int8_t restrict pDst)
Glue code to copy an MxN strided 8-bit integers matrix.
void plp_mat_copy_stride_i8_parallel(const int8_t restrict pSrc, uint32_t M, uint32_t N, uint32_t strideSrc, uint32_t strideDst, uint32_t nPE, int8_t restrict pDst)
Glue code to copy an MxN strided 8-bit integers matrix in parallel.

Detailed Description

This module contains the glue code for copying strided matrices. The kernel codes (kernels) are located in the module Strided Matrix Copy Kernels.

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

`plp_<function name>_<data type><precision>[_parallel]`
name description
function_name mat_copy_stride
data type {f, i, q} respectively for floats, integers, fixed points
precision {32, 16, 8} bits

The stride 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_f32

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

Glue code to copy an MxN strided 32-bit floats matrix.

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_f32_parallel

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

Glue code to copy an MxN strided 32-bit floats matrix in parallel.

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)
  • nPE Number of cores to use for processing
  • pDst Points to the output matrix of shape MxN

Return: none

function plp_mat_copy_stride_i16

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

Glue code to copy an MxN strided 16-bit integers matrix.

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_i16_parallel

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

Glue code to copy an MxN strided 16-bit integers matrix in parallel.

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)
  • nPE Number of cores to use for processing
  • pDst Points to the output matrix of shape MxN

Return: none

function plp_mat_copy_stride_i32

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

Glue code to copy an MxN strided 32-bit integers matrix.

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_i32_parallel

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

Glue code to copy an MxN strided 32-bit integers matrix in parallel.

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)
  • nPE Number of cores to use for processing
  • pDst Points to the output matrix of shape MxN

Return: none

function plp_mat_copy_stride_i8

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

Glue code to copy an MxN strided 8-bit integers matrix.

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_i8_parallel

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

Glue code to copy an MxN strided 8-bit integers matrix in parallel.

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)
  • nPE Number of cores to use for processing
  • pDst Points to the output matrix of shape MxN

Return: none


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