Source/Packages

Realization.Nvidia.SM86.AdamWHalfSM86

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

428 lines73 declarations26.3 KiBSHA-256 9692515bc485

def · lines 340–353

ahAssembleBody

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) `prologue` iterations tail: ahPrologueWith scaled, or a side job's `body` the loop body (ahBody quads, or ahWideBody's), `stride` the quads the loop's T advances an iteration
340def ahAssembleBody = (lambda unrestricted prologue : (pi unrestricted iterations : Nat . (pi unrestricted tail : (family SM86Program) . (family SM86Program))) .
341  (lambda unrestricted program : (family SM86Program) .
342  (lambda unrestricted finish : (pi unrestricted piece : (family SM86Program) . (family SM86Program)) .
343  (lambda unrestricted looped : Nat .
344  (lambda unrestricted quads : Nat . (lambda unrestricted stride : Nat .
345    (let unrestricted body = (finish program) in
346    (let unrestricted once = (sm86ProgramAppend body (ahControl stride sm86ProgramEmpty)) in
347    (sm86ProgramAppend (finish (prologue (ahIterations quads stride) sm86ProgramEmpty))
348      (sm86ProgramAppend once
349        (nat-eliminate (lambda unrestricted n : Nat . (family SM86Program))
350          (sm86ProgramAppend once ahExit)
351          (lambda unrestricted predecessor : Nat . (lambda unrestricted induction : (family SM86Program) .
352            (sm86ProgramAppend (ahBranch (sm86ProgramCount body)) ahExit)))
353          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.