Skip to content

Commit 44043dd

Browse files
authored
Test-suite improvements. (#566)
1 parent d2ba271 commit 44043dd

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

test/runtests.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,9 @@ include("setup.jl") # make sure everything is precompiled
4747
# choose tests
4848
const tests = []
4949
const test_runners = Dict()
50-
## GPUArrays testsuite
5150
for AT in (JLArray, Array), name in keys(TestSuite.tests)
52-
push!(tests, "$(AT)$(Base.Filesystem.path_separator)$name")
53-
test_runners["$(AT)$(Base.Filesystem.path_separator)$name"] = ()->TestSuite.tests[name](AT)
51+
push!(tests, "$(AT)/$name")
52+
test_runners["$(AT)/$name"] = ()->TestSuite.tests[name](AT)
5453
end
5554
unique!(tests)
5655

test/testsuite.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ using Test
1515

1616
using Adapt
1717

18-
struct ArrayAdaptor{AT} end
19-
Adapt.adapt_storage(::ArrayAdaptor{AT}, xs::AbstractArray) where {AT} = AT(xs)
20-
2118
test_result(a::Number, b::Number; kwargs...) = (a, b; kwargs...)
2219
test_result(a::Missing, b::Missing; kwargs...) = true
2320
test_result(a::Number, b::Missing; kwargs...) = false
@@ -39,7 +36,7 @@ end
3936
function compare(f, AT::Type{<:AbstractGPUArray}, xs...; kwargs...)
4037
# copy on the CPU, adapt on the GPU, but keep Ref's
4138
cpu_in = map(x -> isa(x, Base.RefValue) ? x[] : deepcopy(x), xs)
42-
gpu_in = map(x -> isa(x, Base.RefValue) ? x[] : adapt(ArrayAdaptor{AT}(), x), xs)
39+
gpu_in = map(x -> isa(x, Base.RefValue) ? x[] : adapt(AT, x), xs)
4340

4441
cpu_out = f(cpu_in...)
4542
gpu_out = f(gpu_in...)

0 commit comments

Comments
 (0)