Skip to content

Commit 72e0aee

Browse files
Add default value when getting ENV (#673)
1 parent 7bec32c commit 72e0aee

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/AMDGPU.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ function __init__()
205205
@warn """
206206
HSA runtime is unavailable, compilation and runtime functionality will be disabled.
207207
"""
208-
if parse(Bool, ENV["JULIA_AMDGPU_CORE_MUST_LOAD"])
208+
if parse(Bool, get(ENV, "JULIA_AMDGPU_CORE_MUST_LOAD", "0"))
209209
print_build_diagnostics()
210210
error("Failed to load HSA runtime, but HSA must load, bailing out")
211211
end
@@ -217,7 +217,7 @@ function __init__()
217217
@warn """
218218
LLD is unavailable, compilation functionality will be disabled.
219219
"""
220-
if parse(Bool, ENV["JULIA_AMDGPU_CORE_MUST_LOAD"])
220+
if parse(Bool, get(ENV, "JULIA_AMDGPU_CORE_MUST_LOAD", "0"))
221221
print_build_diagnostics()
222222
error("Failed to find ld.lld, but ld.lld must exist, bailing out")
223223
end
@@ -228,7 +228,7 @@ function __init__()
228228
@warn """
229229
Device libraries are unavailable, device intrinsics will be disabled.
230230
"""
231-
if parse(Bool, ENV["JULIA_AMDGPU_CORE_MUST_LOAD"])
231+
if parse(Bool, get(ENV, "JULIA_AMDGPU_CORE_MUST_LOAD", "0"))
232232
print_build_diagnostics()
233233
error("Failed to find Device Libs, but Device Libs must exist, bailing out")
234234
end
@@ -241,7 +241,7 @@ function __init__()
241241
@warn """
242242
HIP library is unavailable, HIP integration will be disabled.
243243
"""
244-
if parse(Bool, ENV["JULIA_AMDGPU_HIP_MUST_LOAD"])
244+
if parse(Bool, get(ENV, "JULIA_AMDGPU_HIP_MUST_LOAD", "0"))
245245
print_build_diagnostics()
246246
error("Failed to load HIP runtime, but HIP must load, bailing out")
247247
end

0 commit comments

Comments
 (0)