diff --git a/test/runtests.jl b/test/runtests.jl index 06b8a795..66d6a096 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -47,10 +47,9 @@ include("setup.jl") # make sure everything is precompiled # choose tests const tests = [] const test_runners = Dict() -## GPUArrays testsuite for AT in (JLArray, Array), name in keys(TestSuite.tests) - push!(tests, "$(AT)$(Base.Filesystem.path_separator)$name") - test_runners["$(AT)$(Base.Filesystem.path_separator)$name"] = ()->TestSuite.tests[name](AT) + push!(tests, "$(AT)/$name") + test_runners["$(AT)/$name"] = ()->TestSuite.tests[name](AT) end unique!(tests) diff --git a/test/testsuite.jl b/test/testsuite.jl index b939d2e9..179c824b 100644 --- a/test/testsuite.jl +++ b/test/testsuite.jl @@ -15,9 +15,6 @@ using Test using Adapt -struct ArrayAdaptor{AT} end -Adapt.adapt_storage(::ArrayAdaptor{AT}, xs::AbstractArray) where {AT} = AT(xs) - test_result(a::Number, b::Number; kwargs...) = ≈(a, b; kwargs...) test_result(a::Missing, b::Missing; kwargs...) = true test_result(a::Number, b::Missing; kwargs...) = false @@ -39,7 +36,7 @@ end function compare(f, AT::Type{<:AbstractGPUArray}, xs...; kwargs...) # copy on the CPU, adapt on the GPU, but keep Ref's cpu_in = map(x -> isa(x, Base.RefValue) ? x[] : deepcopy(x), xs) - gpu_in = map(x -> isa(x, Base.RefValue) ? x[] : adapt(ArrayAdaptor{AT}(), x), xs) + gpu_in = map(x -> isa(x, Base.RefValue) ? x[] : adapt(AT, x), xs) cpu_out = f(cpu_in...) gpu_out = f(gpu_in...)