Skip to content

Commit

Permalink
Merge pull request #8 from DJ4Earth/fix_Enzyme_slow_issue
Browse files Browse the repository at this point in the history
fix Enzyme too slow issue, add ad test back
  • Loading branch information
Cheng Gong authored Mar 13, 2024
2 parents 35e2d78 + f528e71 commit d9c630f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/core/control.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using Enzyme
using Optimization, OptimizationOptimJL

Enzyme.API.looseTypeAnalysis!(false)
Enzyme.API.strictAliasing!(false)
Enzyme.API.typeWarning!(false)
#Enzyme.API.looseTypeAnalysis!(false)
#Enzyme.API.strictAliasing!(false)
#Enzyme.API.typeWarning!(false)
Enzyme.Compiler.RunAttributor[] = false

function Control_Core(md::model, femmodel::FemModel) #{{{
# Compute gradient
Expand Down
4 changes: 2 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ end
end

# AD test
#@time include("testad.jl")
#@time include("testad2.jl")
@time include("testad.jl")
@time include("testad2.jl")

# GPU test
#@time include("testGPU.jl")
Expand Down
3 changes: 3 additions & 0 deletions test/testad.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ module enzymeDiff
using dJUICE
using MAT
using Test
using Enzyme

Enzyme.Compiler.RunAttributor[] = false

#Load model from MATLAB file
#file = matopen(joinpath(@__DIR__, "..", "data","temp12k.mat")) #BIG model
Expand Down
4 changes: 3 additions & 1 deletion test/testad2.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/Applications/Julia-1.8.app/Contents/Resources/julia/bin/julia --project
using dJUICE
using MAT
using Test
using Enzyme

Enzyme.Compiler.RunAttributor[] = false

#Load model from MATLAB file
#file = matopen(joinpath(@__DIR__, "..", "data","temp12k.mat")) #BIG model
Expand Down

0 comments on commit d9c630f

Please sign in to comment.