Roadmap / LLVM IR constructs

Inline asm cp.async.cg.shared.global with 4 operands

Area
LLVM IR constructs
Kind
construct
Level
L0 (card written). Next: L1 needs a Lean model.
Evidence present above the level
None above the level.
Reference
PTX ISA 9.5 #data-movement-and-conversion-instructions-cp-async
Quote
Initiates an asynchronous copy operation from one state space to another.
Lean declarations
Not stated yet.
Corpus files

5 kernel files (.ll) in the corpus.

Tests
  • MojoProofTest.Asm
  • MojoProofTest.Corpus
Upstream issue
None filed.
Depends on
No other card.

Rule

The importer accepts a call call void asm sideeffect "cp.async.cg.shared.global [$0], [$1], $2, $3;", "r,l,n,r"(...) (AsmCall.cpAsyncCgSrc, recognized by AsmCall.ofText? and checked by AsmCall.checkCall in Module.check: the template and constraints exactly, sideeffect, a void result, no fast-math flags or argument attributes, and the operands of the form). It is parsed, not modelled: MojoProof.Sem.exec has no case for inline assembly and stops the thread with an unsupported fault, so no launch that reaches the call is Kernel.Sound. The declarations: MojoProof.LLVM.AsmCall, MojoProof.LLVM.AsmCall.ofText?, MojoProof.LLVM.AsmCall.checkCall, MojoProof.LLVM.Module.check, MojoProof.Sem.exec. The quote is the first sentence of PTX ISA's section on cp, the instruction the string holds.

Corpus

22 of the 116 corpus files use it (664 uses); corpus lists the first 5 in path order.

Out of scope

Everything the copy does: no Lean model of it exists, and the files that call it import but have no run without a fault.

Open

L1 needs a semantics of the copy (pending until its group's cp.async.wait.group) in place of the fault.