Test runner, CUDA executor, ptxas validation and GPU test kernels for the Zig PTX backend
- Zig 97.7%
- Shell 1.7%
- Cuda 0.6%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .github/workflows | ||
| device | ||
| examples | ||
| scripts | ||
| src | ||
| suites | ||
| upstream_bugs/ptxas | ||
| .gitignore | ||
| build.zig | ||
| build.zig.zon | ||
| cuda.zig | ||
| cuda_test.zig | ||
| README.md | ||
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.