Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ docs/package-lock.json
docs/node_modules
Manifest*.toml
LocalPreferences.toml

test/gpuarrays_generated_tests.jl
89 changes: 0 additions & 89 deletions test/gpuarrays_tests.jl

This file was deleted.

29 changes: 29 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ using LinearAlgebra
using ReTestItems
using Test

import GPUArrays
include(joinpath(pkgdir(GPUArrays), "test", "testsuite.jl"))

macro grab_output(ex, io=stdout)
quote
mktemp() do fname, fout
Expand Down Expand Up @@ -113,6 +116,32 @@ PrettyTables.pretty_table(data; column_labels=["Workers", "Device", "Tests"],
fit_table_in_display_vertically=false,
fit_table_in_display_horizontally=false)

# Hack to define GPUArrays `@testitems` dynamically - by writing them to a file.
function write_gpuarrays_tests()
template = """
@testsetup module TSGPUArrays
export gpuarrays_test

import GPUArrays, AMDGPU
include(joinpath(pkgdir(GPUArrays), "test", "testsuite.jl"))

gpuarrays_test(test_name::String) = TestSuite.tests[test_name](AMDGPU.ROCArray)
end
"""
for test_name in keys(TestSuite.tests)
template = """
$template
@testitem "gpuarrays - $test_name" setup=[TSGPUArrays] begin gpuarrays_test("$test_name") end
"""
end

test_file = joinpath(dirname(@__FILE__), "gpuarrays_generated_tests.jl")
open(io -> write(io, template), test_file, "w")
@info "Writing GPUArrays test file: `$test_file`."
return
end
write_gpuarrays_tests()

runtests(AMDGPU; nworkers=np, nworker_threads=1, testitem_timeout=60 * 30) do ti
for tt in TARGET_TESTS
startswith(ti.name, tt) && return true
Expand Down