Source/Packages

Realization.Nvidia.SM86.StreamingAttentionSM86

packages/realizations/cooperative/nvidia-sm86/src/Realization/Nvidia/SM86/StreamingAttentionSM86.alpha

3,230 lines493 declarations193.3 KiBSHA-256 cc0366b3d857

def · lines 1290–1297

sqProductsFresh

Full file
P = 2^(t - L) and dS = P (dP - D), into S's registers (the products have finished: the first operation waits for them) sqProducts with the first slice reading RZ for its accumulator: a tile's products start from +0 without the accumulators being zeroed first
1290def sqProductsFresh = (lambda unrestricted accumulator : (pi unrestricted nt : Nat . Nat) . (lambda unrestricted a : Nat .
1291  (lambda unrestricted first : Nat . (lambda unrestricted tail : (family SM86Program) .
1292    (saFor 4 (lambda unrestricted k : Nat .
1293      (saFor 8 (lambda unrestricted nt : Nat .
1294        (saHmmaFrom (accumulator nt) (naturalAdd a (naturalMultiply k 4)) (saB k nt)
1295          (naturalSelect (naturalIsZero k) sm86RegisterZero (accumulator nt)) saSB2
1296          (naturalSelect (naturalIsZero nt) (naturalSelect (naturalIsZero k) first saWait2) saWaitNone)))))
1297      tail)))))

The compiler supplied declaration spans and resolved links from this source snapshot. This page does not assert that this file belongs to a checked closure.