Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/CUDApp/blob/main/backend/amd/kfd/ring.om # CUDApp CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `CUDApp / backend / amd / kfd / ring.om` 111 lines · 2792 bytes Raw Blame History 1 note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 note A sequential, single-producer/single-consumer model, not an MMIO implementation or memory-model 3 note proof. Each command is one externally visible publication step. No AMD hardware is accessed. 4 note HSA hsa.h rocm-6.2.0: packet type INVALID=1, KERNEL_DISPATCH=2; doorbell carries ready packet ID. 5 note Host policy checked here: body bytes 4..63 -> header+setup (one 32-bit word) -> write index 6 note -> doorbell packet ID (new write index minus one). Consumer observes after each step; once 7 note the type is valid it must see every body byte. Completion consumes the published packet and 8 note invalidates its header before the producer reuses the slot. KFD 1.14 minimum ring 1024 bytes; 9 note 16 64-byte slots. The gate runs 40 launches, crossing the ring boundary twice. 10 note A real implementation needs release publication/acquire observation and device-coherent memory, 11 note as well as architecture-specific fences. This model does NOT establish those properties. 12 note usage: ring STEP... (1=body 2=header 3=write-index 4=doorbell 5=consume). 13 note Exit 0 complete sequences; 64 fewer than five steps; 3 bad order/data/index or incomplete sequence 14 note after the minimum argument check; 2 numeric input. 15 om2 16 global ringbuf uchar 1024 17 global rs ulong 4 18 text raccept "RING ACCEPT body