Skip to content

Commit

Permalink
Bump Enzyme convention (#22)
Browse files Browse the repository at this point in the history

Co-authored-by: Valentin Churavy <vchuravy@users.noreply.github.com>
  • Loading branch information
wsmoses and vchuravy committed Nov 4, 2020
1 parent a80ee62 commit e22a306
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 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.3"
GPUCompiler = "0.7"
LLVM = "3.2"
julia = "1.5"
15 changes: 6 additions & 9 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 @@ -55,7 +53,6 @@ module Runtime
report_exception_frame(idx, func, file, line) = return
end


struct EnzymeCompilerParams <: AbstractCompilerParams end

## job
Expand All @@ -69,7 +66,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 +107,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 +125,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

2 comments on commit e22a306

@vchuravy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/24154

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.1 -m "<description of version>" e22a3069650f8eaac3b6870a7ef9824cd72f0681
git push origin v0.2.1

Please sign in to comment.