Skip to main content

tensor_load_l2

Function tensor_load_l2 

Source
pub unsafe fn tensor_load_l2(
    addr: usize,
    start: u8,
    rows: u8,
    id: bool,
    stride: u64,
)
Expand description

Initiate an asynchronous TensorLoadL2Scp from memory into the shire L2 cache.

Identical to tensor_load in xs encoding and x31 convention, but targets CSR 0x85F (TensorLoadL2Scp) rather than 0x83F. The rows are loaded into the shire L2 without consuming any L1 scratchpad lines. Use this to prefetch A strips while the current k-loop FMA executes; the subsequent tensor_load for the same address will then complete from L2 rather than DRAM, removing A-DMA latency from the FMA critical path.

§Parameters

Same as tensor_load: addr (64-byte aligned), start (L2 target line index), rows (rows to load minus one, 0..=15), id (load event selector), stride (row stride in bytes, 64-byte aligned).

§Safety

Same constraints as tensor_load: addr must be aligned and within device memory; must be called from the primary hart.