def dsum_h

bendtorch-gpu@1.3.0.0 · main.bend:1086

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

1086# acc + the group's heads' sums, in head order (main.bend's pacc): a's column j from row 0 (rows t32 apart) · b's
1087# column (rows w apart), all tn rows; the dense form of tsum_h and tdot
1088def dsum_h(k: Nat, +ia: U32, +ib: U32, +tn: Nat, +t32: U32, +w: U32, +sa: U32, +sb: U32, acc: F32, r: T.D2) -> T.D2:
1089  match k r:
1090    case 0n T.D2{a, b, +s}: T.D2{a, b, (acc + s : F32)}
1091    case 1n+q T.D2{a, b, +s}: dsum_h(q, (ia + sa : U32), (ib + sb : U32), tn, t32, w, sa, sb, (acc + s : F32), ddot(tn, (ia + sa : U32), (ib + sb : U32), t32, w, 0.0, Array.get(F32, a, (ia + sa : U32)), Array.get(F32, b, (ib + sb : U32))))

Uses (8)

Used by (1)