Skip to content

Commit

Permalink
Comment out CUDA tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GianlucaFuwa committed Aug 12, 2024
1 parent 83d6a53 commit c51695f
Showing 1 changed file with 39 additions and 40 deletions.
79 changes: 39 additions & 40 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using Aqua
using Random
using Test
using Polyester
using CUDA
# using CUDA

include("./test_io.jl")
include("./test_checkpoint.jl")
Expand All @@ -21,7 +21,7 @@ include("./test_clinalg.jl")
test_cdot()
test_ckron()
test_cmvmul()
# test_spin_color()
# test_spin_color() # FIXME: Fix these tests
test_cmatmul()
end

Expand Down Expand Up @@ -66,44 +66,43 @@ end
@test test_update(backend; update_method="hmc")
end

if CUDA.functional(true)
# if false
@testset "CUDA Tests" begin
CUDA.allowscalar(false)
backend = CUDABackend
plaq, poly, tc_plaq, tc_clover, tc_improved, wl_1x1 = test_measurements(backend)
@test isapprox(0.587818337847024, plaq)
@test isapprox(0.5255246068616176 - 0.15140850971249734im, poly)
@test isapprox(-0.2730960126400261, tc_plaq)
@test isapprox(-0.027164585971545994, tc_clover)
@test isapprox(-0.03210085960569041, tc_improved)
@test isapprox(0.587818337847024, wl_1x1)

relerrors = CUDA.@allowscalar(test_derivative(backend))
@test length(findall(x -> abs(x) > 1e-4, relerrors[:, 2])) == 0
relerrors = CUDA.@allowscalar(test_fderivative(
backend; dirac="staggered", mass=0.01, single_flavor=true
))
@test length(findall(x -> abs(x) > 1e-4, relerrors[:, 2])) == 0
# relerrors = CUDA.@allowscalar(test_fderivative(
# backend; dirac="staggered", mass=0.01, single_flavor=true, eoprec=true
# ))
# @test length(findall(x -> abs(x) > 1e-4, relerrors[:, 2])) == 0
relerrors = CUDA.@allowscalar(test_fderivative(
backend; dirac="wilson", mass=0.01, single_flavor=true
))
@test length(findall(x -> abs(x) > 1e-4, relerrors[:, 2])) == 0
# relerrors = CUDA.@allowscalar(test_fderivative(
# backend; dirac="wilson", mass=0.01, single_flavor=false, eoprec=true
# ))
# @test length(findall(x -> abs(x) > 1e-4, relerrors[:, 2])) == 0

@test test_gradflow(backend)
@test test_update(backend; update_method="heatbath")
@test test_update(backend; update_method="metropolis", gaction=IwasakiGaugeAction)
@test test_update(backend; update_method="hmc")
end
end
# if CUDA.functional(true)
# @testset "CUDA Tests" begin
# CUDA.allowscalar(false)
# backend = CUDABackend
# plaq, poly, tc_plaq, tc_clover, tc_improved, wl_1x1 = test_measurements(backend)
# @test isapprox(0.587818337847024, plaq)
# @test isapprox(0.5255246068616176 - 0.15140850971249734im, poly)
# @test isapprox(-0.2730960126400261, tc_plaq)
# @test isapprox(-0.027164585971545994, tc_clover)
# @test isapprox(-0.03210085960569041, tc_improved)
# @test isapprox(0.587818337847024, wl_1x1)
#
# relerrors = CUDA.@allowscalar(test_derivative(backend))
# @test length(findall(x -> abs(x) > 1e-4, relerrors[:, 2])) == 0
# relerrors = CUDA.@allowscalar(test_fderivative(
# backend; dirac="staggered", mass=0.01, single_flavor=true
# ))
# @test length(findall(x -> abs(x) > 1e-4, relerrors[:, 2])) == 0
# # relerrors = CUDA.@allowscalar(test_fderivative(
# # backend; dirac="staggered", mass=0.01, single_flavor=true, eoprec=true
# # ))
# # @test length(findall(x -> abs(x) > 1e-4, relerrors[:, 2])) == 0
# relerrors = CUDA.@allowscalar(test_fderivative(
# backend; dirac="wilson", mass=0.01, single_flavor=true
# ))
# @test length(findall(x -> abs(x) > 1e-4, relerrors[:, 2])) == 0
# # relerrors = CUDA.@allowscalar(test_fderivative(
# # backend; dirac="wilson", mass=0.01, single_flavor=false, eoprec=true
# # ))
# # @test length(findall(x -> abs(x) > 1e-4, relerrors[:, 2])) == 0
#
# @test test_gradflow(backend)
# @test test_update(backend; update_method="heatbath")
# @test test_update(backend; update_method="metropolis", gaction=IwasakiGaugeAction)
# @test test_update(backend; update_method="hmc")
# end
# end

if VERSION >= v"1.9"
Aqua.test_all(MetaQCD; stale_deps=false, ambiguities=false)
Expand Down

0 comments on commit c51695f

Please sign in to comment.