Source/Packages

Realization.Nvidia.SM86.StallCompaction

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

329 lines36 declarations18.9 KiBSHA-256 97ebc43fe4f1

def · lines 294–321

sm86TensorProductFixedInstruction

Full file
294def sm86TensorProductFixedInstruction =
295  (lambda unrestricted freed : Nat . (lambda unrestricted instruction : (family SM86Instruction) .
296    (eliminate SM86Instruction
297      (lambda unrestricted current : (family SM86Instruction) . (family SM86Instruction)) instruction
298      (branch SM86InstructionValue guard body .
299        (constructor SM86Instruction SM86InstructionValue guard
300          (eliminate SM86Control
301            (lambda unrestricted current : (family SM86Control) . (family SM86InstructionBody))
302            (sm86BodyControlOf body)
303            (branch SM86ControlValue stall yield write read wait reuse .
304              (let unrestricted writeBit = (byte-to-nat (sm86ReadBarrierWait write)) in
305              (let unrestricted unbarriered =
306                    (sm86BodyWithControl body
307                      (constructor SM86Control SM86ControlValue stall yield
308                        (constructor SM86Barrier SM86BarrierNone) read wait reuse)) in
309              (let unrestricted fixed =
310                    (naturalAnd (naturalNonzero writeBit)
311                      (naturalAnd (sm86MaskBit freed (naturalSelect (naturalIsZero writeBit) 1 writeBit))
312                        (naturalEqual (sm86FixedLatency unbarriered) sm86TensorLatencyCycles))) in
313              (let unrestricted waitLeft = (nat-to-byte (sm86WaitWithout freed (byte-to-nat wait))) in
314                (sm86BodyWithControl body
315                  (constructor SM86Control SM86ControlValue stall yield
316                    (nat-eliminate (lambda unrestricted n : Nat . (family SM86Barrier))
317                      write
318                      (lambda unrestricted p : Nat . (lambda unrestricted ignored : (family SM86Barrier) .
319                        (constructor SM86Barrier SM86BarrierNone)))
320                      fixed)
321                    read waitLeft reuse)))))))))))))

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.