Skip to content

Commit e63e887

Browse files
committed
fixup! activate test_allocations for GPU tests
1 parent e9e318f commit e63e887

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

test/test_cuda_2d.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ isdir(outdir) && rm(outdir, recursive = true)
2121
linf=6.627000273229378e-5)
2222
# Ensure that we do not have excessive memory allocations
2323
# (e.g., from type instabilities)
24+
semi = ode.p # `semidiscretize` adapts the semi, so we need to obtain it from the ODE problem.
2425
@test_allocations(Trixi.rhs!, semi, sol, 1000)
2526
@test real(ode.p.solver) == Float64
2627
@test real(ode.p.solver.basis) == Float64
@@ -49,6 +50,7 @@ end
4950
storage_type=CuArray)
5051
# Ensure that we do not have excessive memory allocations
5152
# (e.g., from type instabilities)
53+
semi = ode.p # `semidiscretize` adapts the semi, so we need to obtain it from the ODE problem.
5254
@test_allocations(Trixi.rhs!, semi, sol, 1000)
5355
@test real(ode.p.solver) == Float32
5456
@test real(ode.p.solver.basis) == Float32

test/test_cuda_3d.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ isdir(outdir) && rm(outdir, recursive = true)
2121
linf=[0.0014537194925779984])
2222
# Ensure that we do not have excessive memory allocations
2323
# (e.g., from type instabilities)
24+
semi = ode.p # `semidiscretize` adapts the semi, so we need to obtain it from the ODE problem.
2425
@test_allocations(Trixi.rhs!, semi, sol, 1000)
2526
@test real(ode.p.solver) == Float64
2627
@test real(ode.p.solver.basis) == Float64
@@ -49,6 +50,7 @@ end
4950
storage_type=CuArray)
5051
# Ensure that we do not have excessive memory allocations
5152
# (e.g., from type instabilities)
53+
semi = ode.p # `semidiscretize` adapts the semi, so we need to obtain it from the ODE problem.
5254
@test_allocations(Trixi.rhs!, semi, sol, 1000)
5355
@test real(ode.p.solver) == Float32
5456
@test real(ode.p.solver.basis) == Float32

test/test_kernelabstractions.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ end
2727
linf=6.627000273229378e-5)
2828
# Ensure that we do not have excessive memory allocations
2929
# (e.g., from type instabilities)
30-
@test_allocations(Trixi.rhs!, semi, sol, 75_000)
30+
semi = ode.p # `semidiscretize` adapts the semi, so we need to obtain it from the ODE problem.
31+
@test_allocations(Trixi.rhs!, ode.p, sol, 1000)
3132
end
3233

3334
@trixi_testset "elixir_advection_basic_gpu.jl Float32" begin
@@ -40,7 +41,8 @@ end
4041
real_type=Float32)
4142
# Ensure that we do not have excessive memory allocations
4243
# (e.g., from type instabilities)
43-
@test_allocations(Trixi.rhs!, semi, sol, 70_000_000)
44+
semi = ode.p # `semidiscretize` adapts the semi, so we need to obtain it from the ODE problem.
45+
@test_allocations(Trixi.rhs!, ode.p, sol, 1000)
4446
end
4547
end
4648

@@ -55,6 +57,7 @@ end
5557
linf=[0.0014537194925779984])
5658
# Ensure that we do not have excessive memory allocations
5759
# (e.g., from type instabilities)
60+
semi = ode.p # `semidiscretize` adapts the semi, so we need to obtain it from the ODE problem.
5861
@test_allocations(Trixi.rhs!, semi, sol, 1000)
5962
end
6063

@@ -68,6 +71,7 @@ end
6871
real_type=Float32)
6972
# Ensure that we do not have excessive memory allocations
7073
# (e.g., from type instabilities)
74+
semi = ode.p # `semidiscretize` adapts the semi, so we need to obtain it from the ODE problem.
7175
@test_allocations(Trixi.rhs!, semi, sol, 1000)
7276
end
7377
end

0 commit comments

Comments
 (0)