def ddot

bendtorch-gpu@1.3.0.0 · main.bend:1080

import bendtorch-gpu@1.3.0.0/main.bend as BendtorchGpu
import Base
import bendtorch@1.3.0.0/main.bend as T

1080# acc + a's cells ia, ia + sa, .. times b's ib, ib + sb, .. (k of them): dot0's sum with the strides given, as tdot
1081def ddot(k: Nat, +ia: U32, +ib: U32, +sa: U32, +sb: U32, acc: F32, ra: Array<F32> & F32, rb: Array<F32> & F32) -> T.D2:
1082  match k ra rb:
1083    case 0n Tuple{a, x} Tuple{b, y}: T.D2{a, b, acc}
1084    case 1n+p Tuple{a, +x} Tuple{b, +y}: ddot(p, (ia + sa : U32), (ib + sb : U32), sa, sb, (acc + (x * y : F32) : F32), Array.get(F32, a, (ia + sa : U32)), Array.get(F32, b, (ib + sb : U32)))

Uses (11)

Used by (2)