Skip to content

Commit

Permalink
test: add UpwindTest
Browse files Browse the repository at this point in the history
  • Loading branch information
junyixu committed Aug 25, 2024
1 parent 849927d commit edcf42b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/UpwindTest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ using TrixiEnzyme
using TrixiEnzyme: upwind!
using ForwardDiff

x = -1:0.005:1
batch_size = 2
x = -1:0.01:1
batch_size = 11
jacobian_enzyme_forward(TrixiEnzyme.upwind!, x, N=batch_size)

Δt₁ = @elapsed J1 = jacobian_enzyme_forward(TrixiEnzyme.upwind!, x)
Expand All @@ -24,7 +24,7 @@ end;

end; # 0.326764 seconds (1.09 M allocations: 75.013 MiB, 7.28% gc time, 99.87% compilation time)

@test J1 = J2
@test J1 == J2

@info "Compare the time consumed by Enzyme.jl Δt and ForwardDiff.jl..."
@info "Enzyme: $Δt₁ seconds | ForwardDiff: $Δt₂ seconds."
Expand Down
5 changes: 5 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ using Test, TrixiEnzyme
t = @elapsed include("CommonTest.jl")
println("##### done (took $t seconds).")
end
@testset "Upwind" begin
println("##### Testing Upwind...")
t = @elapsed include("UpwindTest.jl")
println("##### done (took $t seconds).")
end
@testset "Semi" begin
println("##### Testing semi...")
t = @elapsed include("SemiTest.jl")
Expand Down

0 comments on commit edcf42b

Please sign in to comment.