Miscellaneous
On this Page
Miscellaneous¶
Read lfsr¶
Access to LFSR register which is used to generate random numbers. Once the register is read, it randomizes a new number.
Intrinsics Prototype and Arguments
char256 read_lfsr_b(int switches=0, char256 income={}, bool predicate=1, bool polarity=0) |
char256 read_lfsr_vb(int switches, char256 income, bool256 predicate, bool polarity=0) |
switches |
Switches of LFSR instructions. |
income |
This value is returned if the predicate is false. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Allowed switches are:
SW_READ_ONLY - Don’t reseed value.
A value of LFSR (VPU_LFSR).
Write lfsr¶
Write to LFSR register which is used to generate random numbers.
Intrinsics Prototype and Arguments
void write_lfsr_b(char256 src, bool predicate=1, bool polarity=0) |
void write_lfsr_vb(char256 src, bool256 predicate, bool polarity=0) |
src |
The argument (SRC1). |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Read lane id¶
Access to a LANE_ID_* register.
Intrinsics Prototype and Arguments
uint64 read_lane_id_4b_b(uint64 income={}, bool predicate=1, bool polarity=0) |
uint64 read_lane_id_4b_vb(uint64 income, bool64 predicate, bool polarity=0) |
ushort128 read_lane_id_2b_b(ushort128 income={}, bool predicate=1, bool polarity=0) |
ushort128 read_lane_id_2b_vb(ushort128 income, bool128 predicate, bool polarity=0) |
uchar256 read_lane_id_1b_b(uchar256 income={}, bool predicate=1, bool polarity=0) |
uchar256 read_lane_id_1b_vb(uchar256 income, bool256 predicate, bool polarity=0) |
income |
This value is returned if the predicate is false. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
A value of LANE_ID_*.
Get dim size¶
Return dimension size for the given tensor id.
Intrinsics Prototype and Arguments
uint32_t get_dim_size(int32_t a, uint32_t dim) |
a |
Tensor id. |
dim |
Dimension. |
Dimension size.
Set dim size¶
Set dimension size for the given tensor id.
Intrinsics Prototype and Arguments
void set_dim_size(int32_t a, uint32_t dim, uint32_t value) |
a |
Tensor id. |
dim |
Dimension. |
value |
The new value of size. |
Get dim stride¶
Return dimension stride for the given tensor id.
Intrinsics Prototype and Arguments
uint32_t get_dim_stride(int32_t a, uint32_t dim) |
a |
Tensor id. |
dim |
Dimension. |
Dimension stride.
Set dim size¶
Set dimension stride for the given tensor id.
Intrinsics Prototype and Arguments
void set_dim_stride(int32_t a, uint32_t dim, uint32_t value) |
a |
Tensor id. |
dim |
Dimension. |
value |
The new value of stride. |
Get pad value¶
Return padding value for the given tensor id.
Intrinsics Prototype and Arguments
uint32_t get_pad_value_uint(int32_t a) |
int32_t get_pad_value_int(int32_t a) |
float get_pad_value_float(int32_t a) |
uint16_t get_pad_value_ushort(int32_t a) |
int16_t get_pad_value_short(int32_t a) |
uint8_t get_pad_value_uchar(int32_t a) |
int8_t get_pad_value_char(int32_t a) |
bf16 get_pad_value_bf16(int32_t a) |
a |
Tensor id. |
Padding value.
Set pad value¶
Set padding value for the given tensor id.
Intrinsics Prototype and Arguments
void set_pad_value_uint(int32_t a, uint32_t value) |
void set_pad_value_int(int32_t a, int32_t value) |
void set_pad_value_float(int32_t a, float value) |
void set_pad_value_ushort(int32_t a, uint16_t value) |
void set_pad_value_short(int32_t a, int16_t value) |
void set_pad_value_uchar(int32_t a, uint8_t value) |
void set_pad_value_char(int32_t a, int8_t value) |
void set_pad_value_bf16(int32_t a, bf16 value) |
a |
Tensor id. |
value |
The new padding value. |