Skip to main content

Module jit_matrix

Module jit_matrix 

Source
Expand description

Native JIT matrix with guaranteed C-compatible layout.

Mirrors Arc<MatrixData> for the JIT. Holds the Arc alive via a leaked raw pointer so the flat f64 data buffer remains valid for direct SIMD access from Cranelift-generated code.

Memory layout (#[repr(C)]):

  offset  0: data       — *const f64 (pointer into MatrixData.data, NOT owned)
  offset  8: rows       — u32
  offset 12: cols       — u32
  offset 16: total_len  — u64  (rows * cols, cached for bounds checks)
  offset 24: owner      — *const () (leaked Arc<MatrixData>, reconstituted on drop)

Structs§

JitMatrix
Native JIT matrix — a flat f64 buffer with row/col dimensions.

Constants§

MATRIX_COLS_OFFSET
MATRIX_DATA_OFFSET
MATRIX_OWNER_OFFSET
MATRIX_ROWS_OFFSET
MATRIX_TOTAL_LEN_OFFSET