def dot_eq

bendtorch-core@0.1.0.0 · src/tensor/contracts/matmul_parallel_proof.bend:568

import bendtorch-core@0.1.0.0/src/tensor/contracts/matmul_parallel_proof.bend as MatmulParallelProof
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/storage/LAWS.bend as StorageLaws
import bendtorch-core@0.1.0.0/src/tensor/matmul.bend as Matrix
import bendtorch-core@0.1.0.0/src/storage/api.bend as Api

568# Cell (row, column) of the build over the two copies folds the replayed
569# words in increasing k and hands both copies back.
570def dot_eq(+fuel: Nat, +span: Nat, +columns: Nat, +left: Shape.Shape, +left_fill: F32, +left_ops: List<&2, StorageLaws.Op>, +ha: List<&2, Api.Effect>, +dl: Nat, +fa: F32, +right: Shape.Shape, +right_fill: F32, +right_ops: List<&2, StorageLaws.Op>, +hb: List<&2, Api.Effect>, +dr: Nat, +fb: F32, +lsrc: Source<left, left_fill, left_ops, ha, dl, fa>, +rsrc: Source<right, right_fill, right_ops, hb, dr, fb>, +rows: Nat, +row: Nat, +column: Nat, +cursor: Nat, +accumulator: F32,
571  +row_below: {Nat.is_lt(row, rows) == True{} : Bool}, +left_extents: {Shape.extents(left) == [rows, span] : List<&2, Nat>},
572  +column_below: {Nat.is_lt(column, columns) == True{} : Bool}, +right_extents: {Shape.extents(right) == [span, columns] : List<&2, Nat>}, +steps: {Nat.add(cursor, fuel) == span : Nat}) ->
573  DotIs(fuel, span, columns, left, left_fill, left_ops, ha, dl, fa, right, right_fill, right_ops, hb, dr, fb, row, column, cursor, accumulator, Matrix.cell_dot(fuel, span, columns, row, column, cursor, accumulator, Api.arr(ha, dl, fa), Api.arr(hb, dr, fb))):
574  match fuel:
575    case 0n:
576      {==}
577    case 1n+rest:
578      run_eq(rest, span, columns, left, left_fill, left_ops, ha, dl, fa, right, right_fill, right_ops, hb, dr, fb, lsrc, rsrc, rows, row, column, cursor, accumulator, row_below, left_extents, column_below, right_extents, steps, Array.get(F32, Api.arr(ha, dl, fa), Matrix.left_index(span, row, cursor)), {==}, Array.get(F32, Api.arr(hb, dr, fb), Matrix.right_index(columns, column, cursor)), {==})

Uses (18)

Used by (1)