Skip to content

Commit

Permalink
fix: typo
Browse files Browse the repository at this point in the history
  • Loading branch information
junyixu committed Sep 5, 2024
1 parent 2cd3d36 commit 9de5d8c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/jacobian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function jacobian_enzyme_forward_closure(semi)
source_terms = source_terms
solver = solver
cache = cache
my_rhs!(du, u, 0.0, mesh, equations, initial_condition, boundary_conditions, source_terms, solver, cache)
enzyme_rhs!(du, u, 0.0, mesh, equations, initial_condition, boundary_conditions, source_terms, solver, cache)
end

for i in 1:length(du_ode)
Expand Down Expand Up @@ -70,7 +70,7 @@ function jacobian_enzyme_reverse_closure(semi)
source_terms = source_terms
solver = solver
cache = cache
my_rhs!(du, u, 0.0, mesh, equations, initial_condition, boundary_conditions, source_terms, solver, cache)
enzyme_rhs!(du, u, 0.0, mesh, equations, initial_condition, boundary_conditions, source_terms, solver, cache)
end

for i in 1:length(du_ode)
Expand Down Expand Up @@ -273,7 +273,7 @@ function batch_mode_jacobian_enzyme_forward(semi;
dinterfaces_u = ntuple(_->similar(interfaces.u), N)
dys = zeros(length(du_ode), length(du_ode))

Enzyme.autodiff(Forward, my_rhs!, BatchDuplicated(du_ode, dy), BatchDuplicated(u_ode, dx), Const(mesh), Const(equations), Const(initial_condition), Const(boundary_conditions), Const(source_terms), Const(solver), Const(boundaries),
Enzyme.autodiff(Forward, enzyme_rhs!, BatchDuplicated(du_ode, dy), BatchDuplicated(u_ode, dx), Const(mesh), Const(equations), Const(initial_condition), Const(boundary_conditions), Const(source_terms), Const(solver), Const(boundaries),
Const(elements._node_coordinates),
Const(elements.cell_ids),
Const(elements.node_coordinates),
Expand All @@ -295,7 +295,7 @@ function batch_mode_jacobian_enzyme_forward(semi;
dx[j][j+i-1] = 1.0
end
#copyto!(dys, CartesianIndices((1:size(dys, 1), i:i+N-1)), dy, CartesianIndices(dy))
Enzyme.autodiff(Forward, my_rhs!, BatchDuplicated(du_ode, dy), BatchDuplicated(u_ode, dx), Const(mesh), Const(equations), Const(initial_condition), Const(boundary_conditions), Const(source_terms), Const(solver), Const(boundaries),
Enzyme.autodiff(Forward, enzyme_rhs!, BatchDuplicated(du_ode, dy), BatchDuplicated(u_ode, dx), Const(mesh), Const(equations), Const(initial_condition), Const(boundary_conditions), Const(source_terms), Const(solver), Const(boundaries),
Const(elements._node_coordinates),
Const(elements.cell_ids),
Const(elements.node_coordinates),
Expand All @@ -319,7 +319,7 @@ function batch_mode_jacobian_enzyme_forward(semi;
for j = 1:lastchunksize
dx[j][j+lastchunkindex-1] = 1.0
end
Enzyme.autodiff(Forward, my_rhs!, BatchDuplicated(du_ode, dy), BatchDuplicated(u_ode, dx), Const(mesh), Const(equations), Const(initial_condition), Const(boundary_conditions), Const(source_terms), Const(solver), Const(boundaries),
Enzyme.autodiff(Forward, enzyme_rhs!, BatchDuplicated(du_ode, dy), BatchDuplicated(u_ode, dx), Const(mesh), Const(equations), Const(initial_condition), Const(boundary_conditions), Const(source_terms), Const(solver), Const(boundaries),
Const(elements._node_coordinates),
Const(elements.cell_ids),
Const(elements.node_coordinates),
Expand Down Expand Up @@ -362,7 +362,7 @@ function jacobian_enzyme_reverse(semi::SemidiscretizationHyperbolic)

for i in 1:length(du_ode)
dy[i] = 1.0
Enzyme.autodiff(Reverse, my_rhs!, Duplicated(du_ode, dy), Duplicated(u_ode, dx), Const(mesh), Const(equations), Const(initial_condition), Const(boundary_conditions), Const(source_terms), Const(solver), Const(boundaries),
Enzyme.autodiff(Reverse, enzyme_rhs!, Duplicated(du_ode, dy), Duplicated(u_ode, dx), Const(mesh), Const(equations), Const(initial_condition), Const(boundary_conditions), Const(source_terms), Const(solver), Const(boundaries),
Const(elements._node_coordinates),
Const(elements.cell_ids),
Const(elements.node_coordinates),
Expand Down

0 comments on commit 9de5d8c

Please sign in to comment.