Testing

If it ain't tested, it's broken. The test/runtests.jl suite does randomised correctness testing on all algorithms in the library. GPU backends are only weak dependencies of the test suite (so that their requirements cannot conflict), and whichever backend is present in the test environment gets tested. To test one locally, first add it to the test environment:

$> cd path/to/AcceleratedKernels.jl
$> julia test/promote.jl oneapi
$> julia -e 'import Pkg; Pkg.develop(path="."); Pkg.test("AcceleratedKernels")'

Replace oneapi with cuda, amdgpu, metal or opencl to test different backends, as available on your machine. Note that test/promote.jl rewrites test/Project.toml; restore it with git checkout test/Project.toml afterwards.

With no backend in the test environment, the CPU backend is tested, which needs no extra packages:

$> julia -e 'import Pkg; Pkg.test("AcceleratedKernels")'

Start Julia with multiple threads to run the tests on a multithreaded CPU backend:

$> julia --threads=4 -e 'import Pkg; Pkg.test("AcceleratedKernels.jl")'