Test runner, CUDA executor, ptxas validation and GPU test kernels for the Zig PTX backend
  • Zig 97.7%
  • Shell 1.7%
  • Cuda 0.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-27 23:38:11 -07:00
.github/workflows ci: create release tags using the Forgejo API 2026-10-27 22:33:14 -07:00
device Add GPU tests and CUDA sample ports for the Zig PTX backend 2026-10-12 04:40:02 -07:00
examples gemm_bf16_sm80_cp_async: add a three-stage 128x256x32 kernel 2026-10-23 04:36:01 -07:00
scripts ci: include compiler revision in release names 2026-10-27 23:38:11 -07:00
src Add GPU tests and CUDA sample ports for the Zig PTX backend 2026-10-12 04:40:02 -07:00
suites regressions: keep small locals that a program indexes in registers 2026-10-23 04:36:01 -07:00
upstream_bugs/ptxas Add GPU tests and CUDA sample ports for the Zig PTX backend 2026-10-12 04:40:02 -07:00
.gitignore Add GPU tests and CUDA sample ports for the Zig PTX backend 2026-10-12 04:40:02 -07:00
build.zig Add GPU tests and CUDA sample ports for the Zig PTX backend 2026-10-12 04:40:02 -07:00
build.zig.zon Add GPU tests and CUDA sample ports for the Zig PTX backend 2026-10-12 04:40:02 -07:00
cuda.zig Add GPU tests and CUDA sample ports for the Zig PTX backend 2026-10-12 04:40:02 -07:00
cuda_test.zig Add GPU tests and CUDA sample ports for the Zig PTX backend 2026-10-12 04:40:02 -07:00
README.md Add GPU tests and CUDA sample ports for the Zig PTX backend 2026-10-12 04:40:02 -07:00

zig-nvptx-test

GPU tests and examples for Zig's self-hosted PTX backend (nvptx64-cuda).

Requires a Zig fork with the PTX backend, an NVIDIA GPU and driver, and ptxas in PATH. Without a GPU, the tests still compile and validate PTX; without ptxas, they skip PTX validation.

Usage

Run from the repository root with the fork's zig:

zig build                 # Install tools in zig-out/bin.
zig build test            # Compile, validate and run the GPU suites.
zig build behavior        # Run the Zig checkout's test/behavior on the GPU.

behavior writes zig-out/behavior.md and accepts file names after --. Use -Dzig-src=<checkout> if the build cannot find the matching Zig sources. See zig build --help for individual suites and options.

Examples

Run zig build from examples/cuda-samples/ or examples/ml/ etc. to build all examples; run the installed executables under zig-out/bin/ directly.