Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROCmDiscovery: Ensure all globals are defined #679

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/discovery/discovery.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ function get_device_libs(from_artifact::Bool; rocm_path::String)
end
end

macro _ensure_defined(var)
mod = @__MODULE__
esc(quote
if !isdefined($mod, $(QuoteNode(Symbol(var))))
global $(Symbol(var)) = ""
end
end)
end

export lld_artifact, lld_path, libhsaruntime, libdevice_libs, libhip
export librocblas, librocsparse, librocsolver, librocalution
export librocrand, librocfft, libMIOpen_path
Expand Down Expand Up @@ -115,6 +124,19 @@ function __init__()
Use `ROCM_PATH` env variable to specify ROCm directory.

""" exception=(err, catch_backtrace())

@_ensure_defined(libhsaruntime)
@_ensure_defined(lld_path)
@_ensure_defined(lld_artifact)
@_ensure_defined(libhip)
@_ensure_defined(libdevice_libs)
@_ensure_defined(librocblas)
@_ensure_defined(librocsparse)
@_ensure_defined(librocsolver)
@_ensure_defined(librocalution)
@_ensure_defined(librocrand)
@_ensure_defined(librocfft)
@_ensure_defined(libMIOpen_path)
end
end

Expand Down