Skip to content

Commit

Permalink
For getting debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses authored and giordano committed Mar 2, 2025
1 parent 0a3409a commit 05a3b8b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ocean-climate-simulation/ocean_climate_simulation_mlir.jl
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
ENV["run"] = false
ENV["use-reactant"] = true

Reactant.Compiler.DUMP_LLVMIR[] = true

include("data_free_ocean_climate_simulation.jl")

unopt = @code_hlo optimize=false raise=true run!(simulation)
unopt = @code_hlo optimize=false raise=false run!(simulation)

# Unoptimized HLO
open("unopt_ocean_climate_simulation.mlir", "w") do io
write(io, string(unopt))
end

# Optimized HLO
opt = @code_hlo optimize=:before_jit raise=true run!(simulation)
opt = @code_hlo optimize=:before_jit raise=false run!(simulation)

open("opt_ocean_climate_simulation.mlir", "w") do io
write(io, string(opt))
Expand Down

0 comments on commit 05a3b8b

Please sign in to comment.