rand_tile

void ckernel::rand_tile_init(uint32_t seed = 0, uint32_t stream_id = 0)

Initializes the random generator with seed + stream_id * 0x9E3779B9 modulo 2^32. Distinct stream IDs domain-separate related deterministic work ranges; stream_id=0 leaves the seed unchanged.

void ckernel::rand_tile(uint32_t idst, uint32_t from, uint32_t scale)

Performs element-wise rand on each element of a of a tile in DST register at index tile_index. That is each element is overwritten with a randomly generated float. The DST register buffer must be in acquired state via acquire_dst call. This call is blocking and is only available on the compute engine. This operation records replay slots 0-15 when scale is finite and at least 2^-95, and slots 0-16 otherwise. Callers sharing the replay buffer with other SFPU operations must reinitialize it as needed. On Wormhole, this operation also programs LREG12 and LREG13. Callers must restore those programmable constants before another SFPU operation relies on them.

Return value: None

Argument Description

tile_index The index of the tile in the DST register buffer

from FP32 bit pattern for the inclusive lower bound

scale FP32 bit pattern producing [from, from + scale], inclusively