Repository navigation
Description
What problem does this solve?
cuda-oxide supports several SM 80+ intrinsics on main (redux.sync, ldmatrix x2/x4, stmatrix, cp.async ca/cg 16, cvt.rn.f16x2.f32, fma.rn.bf16x2, mbarrier, elect.sync, lanemask registers), but the Ampere ISA has substantially more intrinsics important for inference and training workloads: tensor core MMA, packed arithmetic, integer dot products, and additional conversion/memory variants. This tracks filling those gaps.
Status update (July 2026)
Upstream PR #406 merged: All CUDA intrinsic APIs and lowering are now autogenerated from pinned LLVM 22 data. The generator admitted 781 intrinsic contracts with stable IDs. This supersedes all hand-written intrinsic PRs below — the unchecked items are now covered by the autogen system and no longer need individual PRs.
Superseded PRs: #332 (f16x2), #333 (prmt), #334 (mixed INT8 MMA), and fork PRs for dp2a.hi, cp.async pipeline, sparse MMA, stmatrix x1.
To add a missing intrinsic: append to intrinsics/overlay/*.toml + intrinsics/abi-v1.toml and regenerate. See #406 description for the full contributor workflow.
Scope
Each item follows the established 4-layer pattern (cuda-device > dialect-nvvm > mir-importer > mir-lower) plus lowering tests. Inline asm ops use the AsmKind enum (PR #195). Multi-variant families use parameterized dispatch helpers.
Phase 1: Self-contained extensions of existing features
- Integer dot products:
dp4a.{s32,u32},dp2a.{s32,u32}(sm_61+), feat: add integer dot product instructions (dp4a, dp2a) for sm_61+ #275 + e2e example feat: add dp4a/dp2a end-to-end GPU example (sm_61+) #282 - Packed conversions:
cvt.rz.f16x2.f32,cvt.rn.relu.{f16x2,bf16x2}.f32,cvt.rz.bf16x2.f32, feat: add packed cvt variants (rz, relu) for f16x2 and bf16x2 #276 + e2e example feat: add packed cvt variants end-to-end example (sm_80+) #281 - bf16x2 arithmetic:
add/sub/mul.rn.bf16x2,min/max.bf16x2,neg/abs.bf16x2,fma.rn.relu.bf16x2, feat: add bf16x2 packed arithmetic and ReLU-fused FMA (sm_80+) #279 (includes e2e example) - cp.async small sizes:
cp.async.ca4-byte and 8-byte, feat: add cp.async 4-byte and 8-byte copy intrinsics (sm_80+) #280 (includes e2e example) - cp.async zero-fill:
src_sizeparameter for partial copies, feat: add cp.async zero-fill variants (src_size parameter) #305 (includes e2e example, depends on feat: add cp.async 4-byte and 8-byte copy intrinsics (sm_80+) #280)
Phase 2: Matrix operations
-
ldmatrixx1 and x1_trans (extends existing x2/x4), feat: add ldmatrix warp-level shared memory matrix loads #311 -
movmatrix.sync.aligned.m8n8.trans.b16(in-register transpose), feat: add movmatrix in-register matrix transpose #310 -
stmatrixuser-facing device-layer stubs (x1, x1_trans — x2/x4 already in tcgen05)
Phase 3: mma.sync tensor core family
- f16
m16n8k16(f32 accumulator), Add mma.sync.aligned.m16n8k16 f16 tensor core intrinsic #327 - bf16
m16n8k16(f32 accumulator), Add mma.sync.aligned.m16n8k16 bf16 tensor core intrinsic #321 - tf32
m16n8k8(f32 accumulator), Add mma.sync.aligned.m16n8k8 tf32 tensor core intrinsic #328 - f64
m8n8k4, Add mma.sync.aligned.m8n8k4 f64 double-precision tensor core intrinsic #323 - INT8 s8
m16n8k32(s32 accumulator), Add mma.sync.aligned.m16n8k32 s8 tensor core intrinsic #329 -
INT8 u8— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406)m16n8k32(s32 accumulator) -
INT8 s8— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406)m16n8k16(s32 accumulator) -
INT8 u8— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406)m16n8k16(s32 accumulator) -
tf32— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406)m16n8k4(f32 accumulator) -
f16— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406)m16n8k16with f16 accumulator -
bf16— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406)m16n8k8(f32 accumulator) -
INT4— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406)m16n8k64(s32 accumulator, signed + unsigned) -
Binary— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406)m16n8k256(s32 accumulator, AND.POPC + XOR.POPC) -
f64— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406)m16n8k4(f64 accumulator) -
Mixed-signedness INT8 (— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406), previously Add mixed-signedness INT8 mma.sync variants (s8*u8, u8*s8) #334s8*u8,u8*s8)
Phase 4: Miscellaneous
- Packed atomics:
atom.add.noftz.{f16x2,bf16x2}, Add packed atomic add intrinsics (f16x2, bf16x2) #322 -
— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406), previously Add prmt.b32 byte permute intrinsic #333prmtbyte permute -
— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406)mbarrier.pending_count/mbarrier.arrive_drop - Special registers:
%warpid,%smid,%gridid,%dynamic_smem_size,%total_smem_size, feat: add missing special registers (warpid, smid, gridid, smem_size) #309
Phase 5: cp.async pipeline control
-
— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406)cp.async.commit_group -
— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406)cp.async.wait_group N -
— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406)cp.async.wait_all -
— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406)cp.async.ca16-byte (non-zfill) -
— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406)cp.async.cg16-byte (+ zfill variant)
Phase 6: Packed f16x2 arithmetic
-
— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406), previously Add packed f16x2 arithmetic intrinsics #332add.rn.f16x2(sm_53+) -
— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406), previously Add packed f16x2 arithmetic intrinsics #332sub.rn.f16x2(sm_53+) -
— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406), previously Add packed f16x2 arithmetic intrinsics #332mul.rn.f16x2(sm_53+) -
— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406), previously Add packed f16x2 arithmetic intrinsics #332fma.rn.f16x2(sm_53+) -
— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406), previously Add packed f16x2 arithmetic intrinsics #332neg.f16x2(sm_53+) -
— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406), previously Add packed f16x2 arithmetic intrinsics #332abs.f16x2(sm_53+) -
— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406), previously Add packed f16x2 arithmetic intrinsics #332min.f16x2(sm_80+) -
— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406), previously Add packed f16x2 arithmetic intrinsics #332max.f16x2(sm_80+) -
— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406), previously Add packed f16x2 arithmetic intrinsics #332fma.rn.relu.f16x2(sm_80+)
Phase 7: Additional conversions and integer variants
-
cvt.rn.bf16x2.f32— standalone inconvert.rs, Add cvt_f16x2_f32 intrinsic for f32-to-f16x2 packing #66 + feat: add packed cvt variants (rz, relu) for f16x2 and bf16x2 #276 -
— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406)dp2a.hi.{s32,u32}— high-byte dot product variants (sm_61+) -
Mixed-signedness— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406)dp4a—dp4a.{s32.u32,u32.s32}(sm_61+) -
Mixed-signedness— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406)dp2a.lo—dp2a.lo.{s32.u32,u32.s32}(sm_61+)
Phase 8: Sparse MMA (Ampere structured sparsity)
-
— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406)mma.sp.sync.aligned.m16n8k32.row.col.f32.f16.f16.f32(sm_80+) -
— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406)mma.sp.sync.aligned.m16n8k32.row.col.f32.bf16.bf16.f32(sm_80+) -
— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406)mma.sp.sync.aligned.m16n8k16.row.col.f32.tf32.tf32.f32(sm_80+) -
— covered by autogen (Generate CUDA intrinsic APIs and lowering from pinned LLVM 22 data #406)mma.sp.sync.aligned.m16n8k64.row.col.s32.s8.s8.s32(sm_80+)
Additional context
- PTX ISA: dp4a, dp2a
- PTX ISA: cvt (packed variants)
- PTX ISA: mma.sync
- PTX ISA: mma.sp.sync
- PTX ISA: bf16x2 arithmetic
- PTX ISA: cp.async
- PTX ISA: prmt
- SM89 (Ada Lovelace) intrinsics tracked in Tracking: SM89 (Ada Lovelace) device intrinsics — FP8 types, conversions, and MMA #337
- SM90/SM90a (Hopper) intrinsics tracked in Tracking: SM90/SM90a (Hopper) device intrinsics — FP8 WGMMA, DPX, setmaxnreg #338
- SM100+ (Blackwell) intrinsics tracked in Tracking: SM100+ (Blackwell) device intrinsics — tcgen05 FP8/FP6/FP4 variants #339
Activity
feat: add integer dot product instructions (dp4a, dp2a) for sm_61+
feat: add packed cvt variants (rz, relu) for f16x2 and bf16x2
feat: add integer dot product instructions (dp4a, dp2a) for sm_61+
feat: add packed cvt variants (rz, relu) for f16x2 and bf16x2
feat: add integer dot product instructions (dp4a, dp2a) for sm_61+ (#275
feat: add packed cvt variants (rz, relu) for f16x2 and bf16x2
feat: add packed cvt variants (rz, relu) for f16x2 and bf16x2 (#276)
feat: add bf16x2 packed arithmetic and ReLU-fused FMA (sm_80+)
feat: add cp.async 4-byte and 8-byte copy intrinsics (sm_80+)
feat: add dp4a/dp2a end-to-end example (sm_61+)
feat: add packed cvt variants end-to-end example (sm_80+)
17 remaining items
feat: add cp.async zero-fill variants (src_size parameter, sm_80+)
feat: add cp.async zero-fill variants (src_size parameter) (#305)
feat: add bf16x2 packed arithmetic and ReLU-fused FMA (sm_80+)
feat: add bf16x2 packed arithmetic and ReLU-fused FMA (sm_80+) (#279)
feat: add movmatrix in-register matrix transpose
feat: add movmatrix in-register matrix transpose
feat: add missing special registers (warpid, smid, gridid, smem_size)
feat: add ldmatrix warp-level shared memory matrix loads
feat: add movmatrix in-register matrix transpose
feat: add missing special registers (warpid, smid, gridid, smem_size)
feat: add ldmatrix warp-level shared memory matrix loads