prepare_input_view

Function prepare_input_view 

Source
pub fn prepare_input_view<T: ScalarBase + 'static>(
    view: &StridedView<'_, T>,
    n_group1: usize,
    n_group2: usize,
    conj: bool,
    requires_unit_stride: bool,
    use_pool: bool,
    materialize_conj_fn: Option<fn(T) -> T>,
) -> Result<ContiguousOperand<T>>
Expand description

Prepare a borrowed input view for GEMM.

Expects batch-last canonical order: [group1..., group2..., batch...]. Checks if the two inner dimension groups are fusable. If not, copies to a contiguous col-major buffer.

  • requires_unit_stride: backend needs at least one unit stride (e.g. CBLAS).
  • use_pool: reuse thread-local buffers to avoid repeated allocation.
  • materialize_conj_fn: when Some(f) and conj == true, applies f to each element during copy (for backends that cannot pass conj flags to GEMM).