Source/Packages

Realization.Nvidia.SM86.AdamWHalfSM86

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

205 lines38 declarations10.6 KiBSHA-256 557f99a5eb69

def · lines 175–186

ahAssemble

Full file
`finish` is applied to the prologue and the body on their own (e.g. the stalls compacted and drained); the control keeps the largest stalls. looped 1: the loop with its back edge; looped 0: what the schedule checks read, the body twice and no branch (it covers both ways into the body, and every iteration leaves the same things in flight: the stores' reads under SB5, nothing else)
175def ahAssemble = (lambda unrestricted finish : (pi unrestricted piece : (family SM86Program) . (family SM86Program)) .
176  (lambda unrestricted looped : Nat .
177  (lambda unrestricted quads : Nat . (lambda unrestricted stride : Nat .
178    (let unrestricted body = (finish (ahBody quads)) in
179    (let unrestricted once = (sm86ProgramAppend body (ahControl stride sm86ProgramEmpty)) in
180    (sm86ProgramAppend (finish (ahPrologue (ahIterations quads stride) sm86ProgramEmpty))
181      (sm86ProgramAppend once
182        (nat-eliminate (lambda unrestricted n : Nat . (family SM86Program))
183          (sm86ProgramAppend once ahExit)
184          (lambda unrestricted predecessor : Nat . (lambda unrestricted induction : (family SM86Program) .
185            (sm86ProgramAppend (ahBranch (sm86ProgramCount body)) ahExit)))
186          looped)))))))))

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.