From 2475c8953d20a074dfcb93ab4ea3a06e455528b7 Mon Sep 17 00:00:00 2001 From: nHackel Date: Thu, 6 Jun 2024 15:46:44 +0200 Subject: [PATCH] Test setup for CUDA --- test/gpu/cuda.jl | 5 +++++ test/runtests.jl | 3 ++- test/testOperators.jl | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 test/gpu/cuda.jl diff --git a/test/gpu/cuda.jl b/test/gpu/cuda.jl new file mode 100644 index 0000000..5f6349c --- /dev/null +++ b/test/gpu/cuda.jl @@ -0,0 +1,5 @@ +using CUDA, CuNFFT + +arrayTypes = [CuArray] + +include(joinpath(@__DIR__(), "..", "runtests.jl")) \ No newline at end of file diff --git a/test/runtests.jl b/test/runtests.jl index 362e471..c5a8e88 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -8,7 +8,8 @@ using NFFT using RadonKA using JLArrays -arrayTypes = [Array, JLArray] +areTypesDefined = @isdefined arrayTypes +arrayTypes = areTypesDefined ? arrayTypes : [Array, JLArray] @testset "LinearOperatorCollection" begin include("testNormalOp.jl") diff --git a/test/testOperators.jl b/test/testOperators.jl index fb25c12..b7195b1 100644 --- a/test/testOperators.jl +++ b/test/testOperators.jl @@ -234,7 +234,7 @@ function testNFFT2d(N=16;arrayType = Array) F_nfft.toeplitz = false AHA = normalOperator(F_nfft) y_AHA_nfft = Array(AHA * xop) - y_AHA = F' * F * xop + y_AHA = F' * F * vec(x) @test y_AHA ≈ y_AHA_nfft rtol = 1e-2 # test AHA with Toeplitz