typecast_tile

template<uint32_t IN_DTYPE, uint32_t OUT_DTYPE>
void ckernel::typecast_tile_init()

Please refer to documentation for any_init.

template<uint32_t IN_DTYPE, uint32_t OUT_DTYPE, bool is_fp32_dest_acc_en = DST_ACCUM_MODE>
void ckernel::typecast_tile(uint32_t idst)

Performs an elementwise typecast operation on the input. Supports following typecasts: Float16_b <-> Float32 Float16_b <-> Int32 Float16_b <-> UInt16 Float16_b <-> UInt32 Float16_b <-> UInt8 Float16_b <-> Int8 Float32 <-> Int32 Float32 <-> UInt16 Float32 <-> UInt32 Float32 <-> UInt8 Float32 <-> Int8 Bfp8_b <-> Int32 Bfp8_b <-> UInt16 Bfp8_b <-> UInt32 Bfp8_b <-> UInt8 Bfp8_b <-> Int8 Bfp8_b <-> Float16_b Bfp8_b <-> Float32 Bfp4_b <-> Int32 Bfp4_b <-> UInt16 Bfp4_b <-> UInt32 Bfp4_b <-> UInt8 Bfp4_b <-> Int8 Bfp4_b <-> Bfp8_b Bfp4_b <-> Float16_b Bfp4_b <-> Float32 UInt16 <-> UInt32 UInt16 <-> Int32 UInt16 <-> UInt8 UInt16 <-> Int8 Int32 <-> Int8 UInt32 <-> Int8 UInt8 <-> Int8

For input/output to be UInt32, Int32, or Float32, Dest must be in 32 bit mode.

For input/output to be Int8, the caller must additionally declare the circular buffers as UInt8 instead of Int8, so the raw 2’s complement byte is zero-extended instead of being decoded as sign-magnitude, and must put Dest in 32 bit mode, which is enforced by a static_assert. The kernels below do the sign handling themselves on that raw byte. Int8 is not available on Quasar.

Return value: None

Argument Description

tile_index The index of the tile in DST register buffer to perform typecast operation

IN_DTYPE Input data format

OUT_DTYPE Desired output data format