Snektron/zig-spirv-test-executor
Zig SPIR-V testing utility
edde6cc92611ca526ce652d81b1688cb03c084bb.tar.gz
fdbe6d60d1a937ee64f4e37c2acd0c76a7588f24.tar.gz
v1.4.309.tar.gz
This is a program to run Zig tests for the SPIR-V target. This is currently mainly used for the compiler behavior tests, and only supports the OpenCL environment. A SPIR-V-capable OpenCL implementation is required, such as Rusticl, POCL, or Intels
In order to build the executor, we need a few system dependencies:
After obtaining these dependencies, simply run zig build
to build the project.
To actually run tests, use something like the following:
$ zig test src/test_kernel.zig \
--test-runner src/test_runner.zig \
-target spirv64-opencl-gnu \
-mcpu generic+Int64+Int16+Int8+Float64+Float16 \
-fno-llvm \
--test-cmd zig-out/bin/zig-spirv-test-executor \
--test-cmd --platform \
--test-cmd Intel \
--test-cmd-bin
The devshell in flake.nix
sets up an environment with a bunch of OpenCL capable drivers, such as a slim debug build of recent Mesa, Intel's CPU OpenCL runtime, and POCL 5.0.