Skip to content

Commit

Permalink
Bump Enzyme convention
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Nov 3, 2020
1 parent a80ee62 commit dde6408
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Enzyme"
uuid = "7da242da-08ed-463a-9acd-ee780be4f1d9"
authors = ["William Moses <wmoses@mit.edu>", "Valentin Churavy <vchuravy@mit.edu>"]
version = "0.2.0"
version = "0.2.1"

[deps]
Cassette = "7057c7e9-c182-5462-911a-8362d720325c"
Expand All @@ -12,7 +12,7 @@ Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"

[compat]
Cassette = "0.3"
Enzyme_jll = "0.0.1"
Enzyme_jll = "0.0.2"
GPUCompiler = "0.7"
LLVM = "3.2"
julia = "1.5"
14 changes: 6 additions & 8 deletions src/compiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ const jit = Ref{OrcJIT}()
const tm = Ref{TargetMachine}()

function __init__()
LLVM.clopts("-enzyme_preopt=0")

opt_level = Base.JLOptions().opt_level
if opt_level < 2
optlevel = LLVM.API.LLVMCodeGenLevelNone
Expand Down Expand Up @@ -69,7 +67,7 @@ GPUCompiler.can_throw(::CompilerJob{EnzymeTarget}) = true

# TODO: encode debug build or not in the compiler job
# https://github.com/JuliaGPU/CUDAnative.jl/issues/368
GPUCompiler.runtime_slug(job::CompilerJob{EnzymeTarget}) = "enzyme"
GPUCompiler.runtime_slug(job::CompilerJob{EnzymeTarget}) = "enzyme"

include("compiler/optimize.jl")
include("compiler/cassette.jl")
Expand Down Expand Up @@ -110,7 +108,7 @@ function wrapper!(mod, primalf, adjoint, rt, name = "enzyme_entry")
for (i, T) in enumerate(tt)
llvmT = llvmtype(params[i])
push!(adjoint_tt, llvmT)
if T <: Duplicated
if T <: Duplicated
push!(adjoint_tt, llvmT)
end
end
Expand All @@ -128,15 +126,15 @@ function wrapper!(mod, primalf, adjoint, rt, name = "enzyme_entry")
i = 1
for T in tt
if T <: Const
push!(params, MDString("diffe_const"))
push!(params, MDString("enzyme_const"))
elseif T <: Active
push!(params, MDString("diffe_out"))
push!(params, MDString("enzyme_out"))
elseif T <: Duplicated
push!(params, MDString("diffe_dup"))
push!(params, MDString("enzyme_dup"))
push!(params, llvm_params[i])
i += 1
elseif T <: DuplicatedNoNeed
push!(params, MDString("diffe_dupnoneed"))
push!(params, MDString("enzyme_dupnoneed"))
push!(params, llvm_params[i])
i += 1
else
Expand Down

0 comments on commit dde6408

Please sign in to comment.