While this kernel is designed for single-precision floating-point processing, the function signature indicates that data type at the interface is int32
for both input and output.
void softmax_kernel::softmax(input_stream<int32>* in, output_stream<int32>* out)
Each of these int32
values represents the 32-bits of a single-precision floating-point value in IEEE 754 format. When used by the kernel, values are reinterpreted as floating-point for processing. The reason for this is that when performing AI Engine simulation, text files are used for input and output of data. Use of int32
preserves all bits of the floating-point number when read from or written to a text file and allows for test vector matching at the bit level.
Also of note is that streaming interfaces are used for input and output, which reduces latency and eliminates the need for ping pong buffers in data memory.