Skip to content

Strided Identity Matrix Creation Kernels

Module: Strided Matrix operations / strided identity matrix creation

More...

Functions

Name
void plp_mat_fill_I_stride_f32p_xpulpv2(void * args)
Create a strided 32-bit floats identity matrix on XpulpV2 in parallel.
void plp_mat_fill_I_stride_f32s_xpulpv2(uint32_t N, uint32_t stride, float *restrict pDst)
Create a strided 32-bit floats identity matrix on XpulpV2.
void plp_mat_fill_I_stride_i16p_xpulpv2(void * args)
Create a strided 16-bit integers identity matrix on XpulpV2 in parallel.
void plp_mat_fill_I_stride_i16s_rv32im(uint32_t N, uint32_t stride, int16_t *restrict pDst)
Create a strided 16-bit integers identity matrix on XpulpV2.
void plp_mat_fill_I_stride_i16s_xpulpv2(uint32_t N, uint32_t stride, int16_t *restrict pDst)
Create a strided 16-bit integers identity matrix on XpulpV2.
void plp_mat_fill_I_stride_i32p_xpulpv2(void * args)
Create a strided 32-bit integers identity matrix on XpulpV2 in parallel.
void plp_mat_fill_I_stride_i32s_rv32im(uint32_t N, uint32_t stride, int32_t *restrict pDst)
Create a strided 32-bit integers identity matrix on XpulpV2.
void plp_mat_fill_I_stride_i32s_xpulpv2(uint32_t N, uint32_t stride, int32_t *restrict pDst)
Create a strided 32-bit integers identity matrix on XpulpV2.
void plp_mat_fill_I_stride_i8p_xpulpv2(void * args)
Create a strided 8-bit integers identity matrix on XpulpV2 in parallel.
void plp_mat_fill_I_stride_i8s_rv32im(uint32_t N, uint32_t stride, int8_t *restrict pDst)
Create a strided 8-bit integers identity matrix on XpulpV2.
void plp_mat_fill_I_stride_i8s_xpulpv2(uint32_t N, uint32_t stride, int8_t *restrict pDst)
Create a strided 8-bit integers identity matrix on XpulpV2.
void plp_mat_fill_I_stride_q16p_xpulpv2(void * args)
Create a strided 16-bit fix-point identity matrix on XpulpV2 in parallel.
void plp_mat_fill_I_stride_q16s_rv32im(uint32_t N, uint32_t stride, int32_t fracBits, int16_t *restrict pDst)
Create a strided 16-bit fix-point identity matrix on XpulpV2.
void plp_mat_fill_I_stride_q16s_xpulpv2(uint32_t N, uint32_t stride, int32_t fracBits, int16_t *restrict pDst)
Create a strided 16-bit fix-point identity matrix on XpulpV2.
void plp_mat_fill_I_stride_q32p_xpulpv2(void * args)
Create a strided 32-bit fix-point identity matrix on XpulpV2 in parallel.
void plp_mat_fill_I_stride_q32s_rv32im(uint32_t N, uint32_t stride, int32_t fracBits, int32_t *restrict pDst)
Create a strided 32-bit fix-point identity matrix on XpulpV2.
void plp_mat_fill_I_stride_q32s_xpulpv2(uint32_t N, uint32_t stride, int32_t fracBits, int32_t *restrict pDst)
Create a strided 32-bit fix-point identity matrix on XpulpV2.
void plp_mat_fill_I_stride_q8p_xpulpv2(void * args)
Create a strided 8-bit fix-point identity matrix on XpulpV2 in parallel.
void plp_mat_fill_I_stride_q8s_rv32im(uint32_t N, uint32_t stride, int32_t fracBits, int8_t *restrict pDst)
Create a strided 8-bit fix-point identity matrix on XpulpV2.
void plp_mat_fill_I_stride_q8s_xpulpv2(uint32_t N, uint32_t stride, int32_t fracBits, int8_t *restrict pDst)
Create a strided 8-bit fix-point identity matrix on XpulpV2.

Detailed Description

The identity matrix is a square matrix, with the value 1 on it's main diagonal, and all other values 0.

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

`plp_<function name>_<data type><precision><method>_<isa_extension>`
name description
function_name mat_fill_stride_I
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 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_fill_I_stride_f32p_xpulpv2

void plp_mat_fill_I_stride_f32p_xpulpv2(
    void * args
)

Create a strided 32-bit floats identity matrix on XpulpV2 in parallel.

Parameters:

  • args pointer to plp_mat_mat_fill_I_stride_instance_f32 struct initialized by plp_mat_fill_I_stride_f32_parallel

Return: none

function plp_mat_fill_I_stride_f32s_xpulpv2

void plp_mat_fill_I_stride_f32s_xpulpv2(
    uint32_t N,
    uint32_t stride,
    float *__restrict__ pDst
)

Create a strided 32-bit floats identity matrix on XpulpV2.

Parameters:

  • N Width and height of the matrix
  • stride Stride of the matrix (elements between each row)
  • pDst Points to the output matrix

Return: none

function plp_mat_fill_I_stride_i16p_xpulpv2

void plp_mat_fill_I_stride_i16p_xpulpv2(
    void * args
)

Create a strided 16-bit integers identity matrix on XpulpV2 in parallel.

Parameters:

  • args pointer to plp_mat_mat_fill_I_stride_instance_i16 struct initialized by plp_mat_fill_I_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_fill_I_stride_i16s_rv32im

void plp_mat_fill_I_stride_i16s_rv32im(
    uint32_t N,
    uint32_t stride,
    int16_t *__restrict__ pDst
)

Create a strided 16-bit integers identity matrix on XpulpV2.

Parameters:

  • N Width and height of the matrix
  • stride Stride of the matrix (elements between each row)
  • pDst Points to the output matrix

Return: none

Create a strided 16-bit integers identity matrix on RV32IM.

function plp_mat_fill_I_stride_i16s_xpulpv2

void plp_mat_fill_I_stride_i16s_xpulpv2(
    uint32_t N,
    uint32_t stride,
    int16_t *__restrict__ pDst
)

Create a strided 16-bit integers identity matrix on XpulpV2.

Parameters:

  • N Width and height of the matrix
  • stride Stride of the matrix (elements between each row)
  • pDst Points to the output matrix

Return: none

function plp_mat_fill_I_stride_i32p_xpulpv2

void plp_mat_fill_I_stride_i32p_xpulpv2(
    void * args
)

Create a strided 32-bit integers identity matrix on XpulpV2 in parallel.

Parameters:

  • args pointer to plp_mat_mat_fill_I_stride_instance_i32 struct initialized by plp_mat_fill_I_stride_i32_parallel

Return: none

function plp_mat_fill_I_stride_i32s_rv32im

void plp_mat_fill_I_stride_i32s_rv32im(
    uint32_t N,
    uint32_t stride,
    int32_t *__restrict__ pDst
)

Create a strided 32-bit integers identity matrix on XpulpV2.

Parameters:

  • N Width and height of the matrix
  • stride Stride of the matrix (elements between each row)
  • pDst Points to the output matrix

Return: none

Create a strided 32-bit integers identity matrix on RV32IM.

function plp_mat_fill_I_stride_i32s_xpulpv2

void plp_mat_fill_I_stride_i32s_xpulpv2(
    uint32_t N,
    uint32_t stride,
    int32_t *__restrict__ pDst
)

Create a strided 32-bit integers identity matrix on XpulpV2.

Parameters:

  • N Width and height of the matrix
  • stride Stride of the matrix (elements between each row)
  • pDst Points to the output matrix

Return: none

function plp_mat_fill_I_stride_i8p_xpulpv2

void plp_mat_fill_I_stride_i8p_xpulpv2(
    void * args
)

Create a strided 8-bit integers identity matrix on XpulpV2 in parallel.

Parameters:

  • args pointer to plp_mat_mat_fill_I_stride_instance_i8 struct initialized by plp_mat_fill_I_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_fill_I_stride_i8s_rv32im

void plp_mat_fill_I_stride_i8s_rv32im(
    uint32_t N,
    uint32_t stride,
    int8_t *__restrict__ pDst
)

Create a strided 8-bit integers identity matrix on XpulpV2.

Parameters:

  • N Width and height of the matrix
  • stride Stride of the matrix (elements between each row)
  • pDst Points to the output matrix

Return: none

Create a strided 8-bit integers identity matrix on RV32IM.

function plp_mat_fill_I_stride_i8s_xpulpv2

void plp_mat_fill_I_stride_i8s_xpulpv2(
    uint32_t N,
    uint32_t stride,
    int8_t *__restrict__ pDst
)

Create a strided 8-bit integers identity matrix on XpulpV2.

Parameters:

  • N Width and height of the matrix
  • stride Stride of the matrix (elements between each row)
  • pDst Points to the output matrix

Return: none

function plp_mat_fill_I_stride_q16p_xpulpv2

void plp_mat_fill_I_stride_q16p_xpulpv2(
    void * args
)

Create a strided 16-bit fix-point identity matrix on XpulpV2 in parallel.

Parameters:

  • args pointer to plp_mat_mat_fill_I_stride_instance_q16 struct initialized by plp_mat_fill_I_stride_q16_parallel

Return: none

Par:

  • Fix-Point

The diagonal elements will be filled with the value: 1 << fracBits. * 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_fill_I_stride_q16s_rv32im

void plp_mat_fill_I_stride_q16s_rv32im(
    uint32_t N,
    uint32_t stride,
    int32_t fracBits,
    int16_t *__restrict__ pDst
)

Create a strided 16-bit fix-point identity matrix on XpulpV2.

Parameters:

  • N Width and height of the matrix
  • stride Stride of the matrix (elements between each row)
  • fracBits Decimal point for the appropriate scale
  • pDst Points to the output matrix

Return: none

Par: Fix-Point

The diagonal elements will be filled with the value: 1 << fracBits.

Create a strided 16-bit fix-point identity matrix on RV32IM.

function plp_mat_fill_I_stride_q16s_xpulpv2

void plp_mat_fill_I_stride_q16s_xpulpv2(
    uint32_t N,
    uint32_t stride,
    int32_t fracBits,
    int16_t *__restrict__ pDst
)

Create a strided 16-bit fix-point identity matrix on XpulpV2.

Parameters:

  • N Width and height of the matrix
  • stride Stride of the matrix (elements between each row)
  • fracBits Decimal point for the appropriate scale
  • pDst Points to the output matrix

Return: none

Par: Fix-Point

The diagonal elements will be filled with the value: 1 << fracBits.

function plp_mat_fill_I_stride_q32p_xpulpv2

void plp_mat_fill_I_stride_q32p_xpulpv2(
    void * args
)

Create a strided 32-bit fix-point identity matrix on XpulpV2 in parallel.

Parameters:

  • args pointer to plp_mat_mat_fill_I_stride_instance_q32 struct initialized by plp_mat_fill_I_stride_q32_parallel

Return: none

Par: Fix-Point

The diagonal elements will be filled with the value: 1 << fracBits.

function plp_mat_fill_I_stride_q32s_rv32im

void plp_mat_fill_I_stride_q32s_rv32im(
    uint32_t N,
    uint32_t stride,
    int32_t fracBits,
    int32_t *__restrict__ pDst
)

Create a strided 32-bit fix-point identity matrix on XpulpV2.

Parameters:

  • N Width and height of the matrix
  • stride Stride of the matrix (elements between each row)
  • fracBits Decimal point for the appropriate scale
  • pDst Points to the output matrix

Return: none

Par: Fix-Point

The diagonal elements will be filled with the value: 1 << fracBits.

Create a strided 32-bit fix-point identity matrix on RV32IM.

function plp_mat_fill_I_stride_q32s_xpulpv2

void plp_mat_fill_I_stride_q32s_xpulpv2(
    uint32_t N,
    uint32_t stride,
    int32_t fracBits,
    int32_t *__restrict__ pDst
)

Create a strided 32-bit fix-point identity matrix on XpulpV2.

Parameters:

  • N Width and height of the matrix
  • stride Stride of the matrix (elements between each row)
  • fracBits Decimal point for the appropriate scale
  • pDst Points to the output matrix

Return: none

Par: Fix-Point

The diagonal elements will be filled with the value: 1 << fracBits.

function plp_mat_fill_I_stride_q8p_xpulpv2

void plp_mat_fill_I_stride_q8p_xpulpv2(
    void * args
)

Create a strided 8-bit fix-point identity matrix on XpulpV2 in parallel.

Parameters:

  • args pointer to plp_mat_mat_fill_I_stride_instance_q8 struct initialized by plp_mat_fill_I_stride_q8_parallel

Return: none

Par:

  • Fix-Point

The diagonal elements will be filled with the value: 1 << fracBits. * 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_fill_I_stride_q8s_rv32im

void plp_mat_fill_I_stride_q8s_rv32im(
    uint32_t N,
    uint32_t stride,
    int32_t fracBits,
    int8_t *__restrict__ pDst
)

Create a strided 8-bit fix-point identity matrix on XpulpV2.

Parameters:

  • N Width and height of the matrix
  • stride Stride of the matrix (elements between each row)
  • fracBits Decimal point for the appropriate scale
  • pDst Points to the output matrix

Return: none

Par: Fix-Point

The diagonal elements will be filled with the value: 1 << fracBits.

Create a strided 8-bit fix-point identity matrix on RV32IM.

function plp_mat_fill_I_stride_q8s_xpulpv2

void plp_mat_fill_I_stride_q8s_xpulpv2(
    uint32_t N,
    uint32_t stride,
    int32_t fracBits,
    int8_t *__restrict__ pDst
)

Create a strided 8-bit fix-point identity matrix on XpulpV2.

Parameters:

  • N Width and height of the matrix
  • stride Stride of the matrix (elements between each row)
  • fracBits Decimal point for the appropriate scale
  • pDst Points to the output matrix

Return: none

Par: Fix-Point

The diagonal elements will be filled with the value: 1 << fracBits.


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