#!/bin/sh -e

# Check that OpenCL isn't totally broken (note that it isn't totally working either)
# Uses device 0 platform 0, i.e. to use a real GPU manually install its opencl-icd before running this
# Mark the test has flaky, the important part is the CPU computation.

# display the OpenCL platform info

clinfo

# display opencl devices seens via nabu.

for py in $(py3versions -r 2>/dev/null)
do cd "$AUTOPKGTEST_TMP"
   echo "Testing with $py:"
   $py -c "import sys; import nabu.opencl.utils; print(nabu.opencl.utils.get_opencl_devices('all')); sys.exit(0)" 2>&1
done

# run the nabu test suite

nabu-test -v
