Skip to content

Commit fb0233c

Browse files
authored
Adapt to GPUCompiler.jl, and other small updates. (#250)
1 parent 41b9b5a commit fb0233c

File tree

5 files changed

+15
-29
lines changed

5 files changed

+15
-29
lines changed

Manifest.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
julia_version = "1.8.5"
44
manifest_format = "2.0"
5-
project_hash = "9206e977fd7a0d0123a23a6a0d71272cf3d18214"
5+
project_hash = "2b849e584a3386ec6e79f84d9924e491f668436f"
66

77
[[deps.Adapt]]
88
deps = ["LinearAlgebra", "Requires"]
@@ -79,9 +79,9 @@ version = "0.1.5"
7979

8080
[[deps.GPUCompiler]]
8181
deps = ["ExprTools", "InteractiveUtils", "LLVM", "Libdl", "Logging", "Scratch", "TimerOutputs", "UUIDs"]
82-
git-tree-sha1 = "8de395b1243771bbb79ac832ec96c7def7a4586f"
82+
git-tree-sha1 = "8573c39f9c4e99720ab5ea44104efb3ed07a58b0"
8383
uuid = "61eb1bfa-7361-4325-ad38-22787b887f55"
84-
version = "0.22.0"
84+
version = "0.23.0"
8585

8686
[[deps.InteractiveUtils]]
8787
deps = ["Markdown"]

Project.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Adapt = "3"
2828
CEnum = "0.4"
2929
ExprTools = "0.1"
3030
GPUArrays = "8.4"
31-
GPUCompiler = "0.20, 0.21, 0.22"
31+
GPUCompiler = "0.23"
3232
KernelAbstractions = "0.9.1"
3333
LLVM = "6"
3434
Metal_LLVM_Tools_jll = "~0.5"
@@ -44,3 +44,6 @@ SpecialFunctionsExt = "SpecialFunctions"
4444

4545
[weakdeps]
4646
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
47+
48+
[extras]
49+
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"

src/compiler/reflection.jl

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,7 @@ end
153153

154154
function disassemble(io::IO, path)
155155
disassembler = joinpath(only(readdir(artifact"applegpu"; join=true)), "disassemble.py")
156-
python() do python_path
157-
run(pipeline(`$python_path $disassembler $path`, stdout=io))
158-
end
156+
run(pipeline(`$(python()) $disassembler $path`, stdout=io))
159157
return
160158
end
161159

@@ -230,10 +228,6 @@ function return_type(@nospecialize(func), @nospecialize(tt))
230228
config = compiler_config(current_device())
231229
job = CompilerJob(source, config)
232230
interp = GPUCompiler.get_interpreter(job)
233-
if VERSION >= v"1.8-"
234-
sig = Base.signature_type(func, tt)
235-
Core.Compiler.return_type(interp, sig)
236-
else
237-
Core.Compiler.return_type(interp, func, tt)
238-
end
231+
sig = Base.signature_type(func, tt)
232+
Core.Compiler.return_type(interp, sig)
239233
end

src/device/utils.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@ Base.Experimental.@MethodTable(method_table)
33

44
macro device_override(ex)
55
ex = macroexpand(__module__, ex)
6-
if Meta.isexpr(ex, :call)
7-
ex = eval(ex)
8-
error()
9-
end
106
esc(quote
11-
$GPUCompiler.@override($method_table, $ex)
7+
Base.Experimental.@overlay($method_table, $ex)
128
end)
139
end
1410

test/runtests.jl

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ do_quickfail, _ = extract_flag!(ARGS, "--quickfail")
4242

4343
include("setup.jl") # make sure everything is precompiled
4444
@info "System information:\n" * sprint(io->Metal.versioninfo(io))
45-
metallib_as_version = Metal.Metal_LLVM_Tools_jll.Metal_LLVM_Tools_jll.metallib_as() do metallib_as
45+
metallib_as_version = let
46+
metallib_as = Metal.Metal_LLVM_Tools_jll.Metal_LLVM_Tools_jll.metallib_as()
4647
read(`$metallib_as --version`, String)
4748
end
4849
@info "Using Metal LLVM back-end from $(dirname(Metal.Metal_LLVM_Tools_jll.Metal_LLVM_Tools_jll.metallib_as_path)):\n" * metallib_as_version
@@ -354,11 +355,7 @@ for (testname, (resp,)) in results
354355
elseif isa(resp, Tuple{Int,Int})
355356
fake = Test.DefaultTestSet(testname)
356357
for i in 1:resp[1]
357-
if VERSION >= v"1.7-"
358-
Test.record(fake, Test.Pass(:test, nothing, nothing, nothing, nothing))
359-
else
360-
Test.record(fake, Test.Pass(:test, nothing, nothing, nothing))
361-
end
358+
Test.record(fake, Test.Pass(:test, nothing, nothing, nothing, nothing))
362359
end
363360
for i in 1:resp[2]
364361
Test.record(fake, Test.Broken(:test, nothing))
@@ -372,11 +369,7 @@ for (testname, (resp,)) in results
372369
println()
373370
fake = Test.DefaultTestSet(testname)
374371
for i in 1:resp.captured.ex.pass
375-
if VERSION >= v"1.7-"
376-
Test.record(fake, Test.Pass(:test, nothing, nothing, nothing, nothing))
377-
else
378-
Test.record(fake, Test.Pass(:test, nothing, nothing, nothing))
379-
end
372+
Test.record(fake, Test.Pass(:test, nothing, nothing, nothing, nothing))
380373
end
381374
for i in 1:resp.captured.ex.broken
382375
Test.record(fake, Test.Broken(:test, nothing))

0 commit comments

Comments
 (0)