Skip to main content

tensor_store

Function tensor_store 

Source
pub unsafe fn tensor_store(addr: usize, arows: u8, stride: u64)
Expand description

Initiate an asynchronous TensorStore from the FP register file to memory.

Stores arows + 1 rows of 64 bytes each (16 f32 per row, occupying two consecutive 256-bit FP registers) to memory. Row i is stored to address addr + i * stride, reading from FP registers f[2i] and f[2i+1]. The operation is asynchronous: call crate::fence after to guarantee visibility to other agents before the kernel returns.

§Parameters

  • addr: 64-byte aligned virtual address of the first C row in memory.
  • arows: number of C rows to store minus one (ROWS field, 0..=15).
  • stride: row stride of C in bytes (64-byte aligned); placed in x31.

§Safety

  • addr must be 64-byte aligned and point to (arows + 1) * stride bytes of writable device memory.
  • tensor_wait(TensorEvent::Fma) must have been called first.
  • Must be called from the primary hart of the Minion.