Snektron/zig-spirv-test-executor
Zig SPIR-V testing utility
86e1eb15c60b85c9d57bd71ff9fa62d4006a85e5.tar.gz
e492b17810d775986e2eefd751f5526d9c3b2618.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-none \
-mcpu generic+int64+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.