Skip to content

Commit

Permalink
update autodiff_deferred! unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
omlins committed Oct 29, 2024
1 parent dc5b65f commit e6221c6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/ParallelKernel/test_parallel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Base.retry_load_extensions() # Potentially needed to load the extensions after t

macro compute(A) esc(:($(INDICES[1]) + ($(INDICES[2])-1)*size($A,1))) end
macro compute_with_aliases(A) esc(:(ix + (iz -1)*size($A,1))) end
import Enzyme

@static for package in TEST_PACKAGES eval(:(
@testset "$(basename(@__FILE__)) (package: $(nameof($package)))" begin
@testset "1. parallel macros" begin
Expand Down Expand Up @@ -113,8 +113,8 @@ import Enzyme
end
return
end
@parallel configcall=f!(A, B, a) AD.autodiff_deferred!(Enzyme.Reverse, Const(f!), Const, DuplicatedNoNeed(A, Ā), DuplicatedNoNeed(B, B̄), Const(a))
Enzyme.autodiff_deferred(Enzyme.Reverse, Const(g!),Const, DuplicatedNoNeed(A_ref, Ā_ref), DuplicatedNoNeed(B_ref, B̄_ref), Const(a))
@parallel configcall=f!(A, B, a) AD.autodiff_deferred!(Enzyme.Reverse, f!, Const, DuplicatedNoNeed(A, Ā), DuplicatedNoNeed(B, B̄), Const(a)) # NOTE: f! is automatically promoted to Const.
Enzyme.autodiff_deferred(Enzyme.Reverse, g!, Const, DuplicatedNoNeed(A_ref, Ā_ref), DuplicatedNoNeed(B_ref, B̄_ref), Const(a))
@test Array(Ā) Ā_ref
@test Array(B̄) B̄_ref
end
Expand Down

0 comments on commit e6221c6

Please sign in to comment.