Skip to content

Commit a11030c

Browse files
committed
stop relying on LLD_jll
1 parent 51d9cde commit a11030c

4 files changed

Lines changed: 4 additions & 44 deletions

File tree

Project.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ GPUArrays = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7"
1919
GPUCompiler = "61eb1bfa-7361-4325-ad38-22787b887f55"
2020
GPUToolbox = "096a3bc2-3ced-46d0-87f4-dd12716f4bfc"
2121
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
22-
LLD_jll = "d55e3150-da41-5e91-b323-ecfd1eec6109"
2322
LLVM = "929cbde3-209d-540e-8aea-75f648917ca0"
2423
LLVM_jll = "86de99a1-58d6-5da7-8064-bd56ce2e322c"
2524
LazyArtifacts = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
@@ -63,7 +62,6 @@ GPUArrays = "11.3.1"
6362
GPUCompiler = "1"
6463
GPUToolbox = "0.1.0, 0.2, 0.3, 1"
6564
KernelAbstractions = "0.9.2"
66-
LLD_jll = "15, 16, 17, 18, 19, 20"
6765
LLVM = "9"
6866
LLVM_jll = "15, 16, 17, 18, 19, 20"
6967
LazyArtifacts = "1.10"

src/compiler/Compiler.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
module Compiler
22

33
import Core: LLVMPtr
4-
import LLD_jll
54

65
using ..GPUCompiler
76
using ..LLVM

src/compiler/codegen.jl

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,18 +222,13 @@ function hipfunction(f::F, tt::TT = Tuple{}; kwargs...) where {F <: Core.Functio
222222
end
223223

224224
function create_executable(obj)
225-
lld = if AMDGPU.lld_artifact
226-
`$(LLD_jll.lld()) -flavor gnu`
227-
else
228-
@assert !isempty(AMDGPU.lld_path) "ld.lld was not found; cannot link kernel"
229-
`$(AMDGPU.lld_path)`
230-
end
225+
@assert !isempty(AMDGPU.lld_path) "ld.lld was not found; cannot link kernel"
231226

232227
path_o = tempname(;cleanup=false) * ".obj"
233228
path_exe = tempname(;cleanup=false) * ".exe"
234229

235230
write(path_o, obj)
236-
run(`$lld -shared -o $path_exe $path_o`)
231+
run(`$(AMDGPU.lld_path) -shared -o $path_exe $path_o`)
237232
bin = read(path_exe)
238233

239234
rm(path_o)

src/discovery/discovery.jl

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ export lld_artifact, lld_path, clang_path, clang_artifact, libhsaruntime, libdev
44
export librocblas, librocsparse, librocsolver
55
export librocrand, librocfft, libMIOpen_path
66

7-
using LLD_jll
87
using LazyArtifacts
98
using Preferences
109
using Libdl
@@ -13,29 +12,6 @@ Base.include(@__MODULE__, joinpath(@__DIR__, "..", "..", ".pkg", "platform_augme
1312

1413
include("utils.jl")
1514

16-
function get_artifact_library(pkg::Symbol, libname::Symbol)::String
17-
succ, res = safe_exec("import $pkg; println($pkg.$libname)")
18-
(succ && ispath(res)) || return ""
19-
return res
20-
end
21-
22-
function get_ld_lld(rocm_path::String)::Tuple{String, Bool}
23-
lld_path = find_ld_lld(rocm_path)
24-
isempty(lld_path) || return (lld_path, false)
25-
LLD_jll.is_available() || return (lld_path, false)
26-
return (LLD_jll.lld_path, true)
27-
end
28-
29-
function get_clang(rocm_path::String)::Tuple{String, Bool}
30-
clang_path = find_clang(rocm_path)
31-
if isempty(clang_path)
32-
# Not found, could use LLD_jll or something if it had clang, but it doesn't.
33-
# So return empty
34-
return ("", false)
35-
end
36-
return (clang_path, true)
37-
end
38-
3915
function _hip_runtime_version()
4016
v_ref = Ref{Cint}()
4117
res = ccall((:hipRuntimeGetVersion, libhip), UInt32, (Ptr{Cint},), v_ref)
@@ -51,9 +27,7 @@ end
5127
global rel_libdir::String = Sys.islinux() ? "" : "bin"
5228
global libhsaruntime::String = ""
5329
global lld_path::String = ""
54-
global lld_artifact::Bool = false
5530
global clang_path::String = ""
56-
global clang_artifact::Bool = false
5731
global libhip::String = ""
5832
global libdevice_libs::String = ""
5933
global librocblas::String = ""
@@ -87,14 +61,8 @@ function __init__()
8761
""
8862

8963
# Linker.
90-
lld_path, lld_artifact = get_ld_lld(rocm_path)
91-
global lld_path = lld_path
92-
global lld_artifact = lld_artifact
93-
94-
# Clang
95-
clang_path, clang_artifact = get_clang(rocm_path)
96-
global clang_path = clang_path
97-
global clang_artifact = clang_artifact
64+
global lld_path = find_ld_lld(rocm_path)
65+
global clang_path = find_clang(rocm_path)
9866
global libhip = find_rocm_library(Sys.islinux() ? "libamdhip64" : "amdhip64"; rocm_path)
9967

10068
global libdevice_libs = find_device_libs(rocm_path)

0 commit comments

Comments
 (0)