GPU Programming

The checked GPU artifact, verified GPU syntax, and attested backend status.

GPU Programming

Sounio now has two checked compiler profiles in this repo snapshot:

  • souc-linux-x86_64-jit: the default JIT-facing artifact
  • souc-linux-x86_64-gpu: the GPU-facing artifact

The GPU page should talk about the second one, not the first one.

Verified today

Use the checked GPU artifact directly:

export SOUC_GPU_BIN="$(pwd)/artifacts/omega/souc-bin/souc-linux-x86_64-gpu"
export SOUNIO_STDLIB_PATH="$(pwd)/stdlib"

"$SOUC_GPU_BIN" info
"$SOUC_GPU_BIN" check examples/gpu.sio
"$SOUC_GPU_BIN" check tests/run-pass/gpu_launch_surface.sio
"$SOUC_GPU_BIN" build examples/kernel_matmul.sio --backend gpu -o /tmp/kernel_matmul.ptx

What that proves today:

  • GPU codegen is enabled in the checked GPU artifact.
  • The public PTX-emission path is build --backend gpu.
  • kernel fn, with GPU, GPU.launch, and GPU.sync are accepted by the checked GPU profile.

Public surface versus source-tree surface

The checked public GPU artifact currently accepts:

  • kernel fn
  • with GPU
  • perform GPU.launch(...)
  • perform GPU.sync()
  • PTX emission through build --backend gpu

The checked public GPU artifact does not yet resolve the older gpu.* intrinsic namespace from historical sketches:

  • gpu.thread_id.*
  • gpu.block_id.*
  • gpu.block_dim.*
  • gpu.alloc<T>(...)

Those names still matter to the implementation story, but they are not yet the recommended public syntax.

Backend evidence

The strongest GPU evidence in the repo is under artifacts/omega/:

  • gpu_codegen_parity.v1.json
  • gpu_binary_attestation.v1.json
  • gpu_runtime_attest_gate.v1.json
  • gpu_public_contract.v1.json

Current attested compute lanes:

  • CUDA: cuda-sm80
  • ROCm: rocm-gfx942

Where the bigger GPU implementation lives

  • self-hosted/gpu/ contains PTX, SPIR-V, Metal, runtime, tensor, and tuning work.
  • docs/features/GPU_RUNTIME.md is the repo-native explanation of the current contract.
  • The self-hosted tree still contains an internal gpu-emit path, but the checked public CLI path is build --backend gpu.