Test suite
GPUArrays provides an extensive test suite that covers all of the functionality that should be available after implementing the required interfaces. This test suite is part of this package, but for dependency reasons it is not available when importing the package. Instead, you should include the code from your runtests.jl as follows:
import GPUArraysgpuarrays = pathof(GPUArrays)gpuarrays_root = dirname(dirname(gpuarrays))include(joinpath(gpuarrays_root, "test", "testsuite.jl"))With this set-up, you can run the test suite like this:
TestSuite.test(MyGPUArrayType)If you don't want to run the whole suite, you can also run parts of it:
T = JLArrayGPUArrays.allowscalar(false) # fail tests when slow indexing path into Array type is used.TestSuite.test_gpuinterface(T) # interface functions like gpu_call, threadidx, etcTestSuite.test_base(T) # basic functionality like launching a kernel on the GPU and Base operationsTestSuite.test_blas(T) # tests the blas interfaceTestSuite.test_broadcasting(T) # tests the broadcasting implementationTestSuite.test_construction(T) # tests all kinds of different ways of constructing the arrayTestSuite.test_linalg(T) # linalg function testsTestSuite.test_mapreduce(T) # mapreduce sum, etcTestSuite.test_indexing(T) # indexing testsTestSuite.test_random(T) # randomly constructed arraysTestSuite.test_io(T)