Skip to main content

gpu_matmul

Function gpu_matmul 

Source
pub fn gpu_matmul(
    a_data: Vec<f64>,
    a_rows: usize,
    a_cols: usize,
    b_data: Vec<f64>,
    b_cols: usize,
) -> PyResult<Vec<f64>>
Expand description

Multiply two row-major matrices: C = A (m×k) × B (k×n).

Returns the product as a flat Vec<f64> of length m * n in row-major order together with the output shape (m, n).

§Arguments

  • a_data – flat row-major elements of A, length must equal a_rows * a_cols
  • a_rows – number of rows in A (= m)
  • a_cols – number of columns in A (= k)
  • b_data – flat row-major elements of B, length must equal a_cols * b_cols
  • b_cols – number of columns in B (= n)

§Errors

Returns PyValueError when any length constraint is violated.