Skip to content

Commit 0d86395

Browse files
committed
Adapt to changes in GPUCompiler v1.3
1 parent e64d9b0 commit 0d86395

File tree

3 files changed

+25
-8
lines changed

3 files changed

+25
-8
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Enzyme"
22
uuid = "7da242da-08ed-463a-9acd-ee780be4f1d9"
33
authors = ["William Moses <wmoses@mit.edu>", "Valentin Churavy <vchuravy@mit.edu>"]
4-
version = "0.13.34"
4+
version = "0.13.35"
55

66
[deps]
77
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
@@ -41,7 +41,7 @@ ChainRulesCore = "1"
4141
EnzymeCore = "0.8.8"
4242
Enzyme_jll = "0.0.173"
4343
GPUArraysCore = "0.1.6, 0.2"
44-
GPUCompiler = "0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 1"
44+
GPUCompiler = "1.3"
4545
LLVM = "6.1, 7, 8, 9"
4646
LogExpFunctions = "0.3"
4747
ObjectFile = "0.4"

src/compiler.jl

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,10 +379,10 @@ function nested_codegen!(
379379

380380
target = DefaultCompilerTarget()
381381
params = PrimalCompilerParams(mode)
382-
job = CompilerJob(funcspec, CompilerConfig(target, params; kernel = false), world)
382+
job = CompilerJob(funcspec, CompilerConfig(target, params; kernel = false, libraries=true, toplevel=true, optimize=false, cleanup=false, only_entry=false, validate=false), world)
383383

384384
GPUCompiler.prepare_job!(job)
385-
otherMod, meta = GPUCompiler.emit_llvm(job; libraries=true, toplevel=true, optimize=false, cleanup=false, only_entry=false, validate=false)
385+
otherMod, meta = GPUCompiler.emit_llvm(job)
386386

387387
prepare_llvm(otherMod, job, meta)
388388

@@ -3477,9 +3477,20 @@ function GPUCompiler.codegen(
34773477
if parent_job === nothing
34783478
primal_target = DefaultCompilerTarget()
34793479
primal_params = PrimalCompilerParams(mode)
3480+
config2 = CompilerConfig(
3481+
primal_target,
3482+
primal_params;
3483+
kernel = false,
3484+
libraries=true,
3485+
toplevel=toplevel,
3486+
optimize=false,
3487+
cleanup=false,
3488+
only_entry=false,
3489+
validate=false
3490+
)
34803491
primal_job = CompilerJob(
34813492
primal,
3482-
CompilerConfig(primal_target, primal_params; kernel = false),
3493+
config2,
34833494
job.world,
34843495
)
34853496
else
@@ -3490,12 +3501,18 @@ function GPUCompiler.codegen(
34903501
parent_job.config.entry_abi,
34913502
parent_job.config.name,
34923503
parent_job.config.always_inline,
3504+
libraries=true,
3505+
toplevel=toplevel,
3506+
optimize=false,
3507+
cleanup=false,
3508+
only_entry=false,
3509+
validate=false,
34933510
)
34943511
primal_job = CompilerJob(primal, config2, job.world) # TODO EnzymeInterp params, etc
34953512
end
34963513

34973514
GPUCompiler.prepare_job!(primal_job)
3498-
mod, meta = GPUCompiler.emit_llvm(primal_job; libraries=true, toplevel=toplevel, optimize=false, cleanup=false, only_entry=false, validate=false)
3515+
mod, meta = GPUCompiler.emit_llvm(primal_job)
34993516
edges = Any[]
35003517
mod_to_edges[mod] = edges
35013518

src/sugar.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ end
1919
target = Compiler.DefaultCompilerTarget()
2020
params = Compiler.PrimalCompilerParams(API.DEM_ForwardMode)
2121
mi = my_methodinstance(nothing, fn, Tuple{T, Int})
22-
job = GPUCompiler.CompilerJob(mi, GPUCompiler.CompilerConfig(target, params; kernel = false))
22+
job = GPUCompiler.CompilerJob(mi, GPUCompiler.CompilerConfig(target, params; kernel = false, libraries=true, toplevel=true, optimize=false, cleanup=false, only_entry=false, validate=false))
2323

2424
GPUCompiler.prepare_job!(job)
25-
mod, meta = GPUCompiler.emit_llvm(job; libraries=true, toplevel=true, optimize=false, cleanup=false, only_entry=false, validate=false)
25+
mod, meta = GPUCompiler.emit_llvm(job)
2626

2727
copysetfn = meta.entry
2828
blk = first(LLVM.blocks(copysetfn))

0 commit comments

Comments
 (0)