Skip to content

Commit e674004

Browse files
committed
Stringify preferences.
[ci skip]
1 parent 9c9a05f commit e674004

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/cudadrv/version.jl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,18 @@ higher-up depot; to clear preferences nondestructively, use
6060
"""
6161
function set_runtime_version!(version::Union{Nothing,VersionNumber}=nothing;
6262
local_toolkit::Union{Nothing,Bool}=nothing)
63-
if version !== nothing
64-
version = "$(version.major).$(version.minor)"
63+
# store stringified properties
64+
let version = isnothing(version) ? nothing : "$(version.major).$(version.minor)"
65+
Preferences.set_preferences!(CUDA_Runtime_jll, "version" => version; force=true)
66+
end
67+
let local_toolkit = isnothing(local_toolkit) ? nothing : string(local_toolkit)
68+
Preferences.set_preferences!(CUDA_Runtime_jll, "local" => local_toolkit; force=true)
6569
end
66-
Preferences.set_preferences!(CUDA_Runtime_jll, "version" => version; force=true)
67-
Preferences.set_preferences!(CUDA_Runtime_jll, "local" => local_toolkit; force=true)
70+
6871
io = IOBuffer()
6972
print(io, "Configure the active project to use ")
7073
if version !== nothing
71-
print(io, "CUDA $version")
74+
print(io, "CUDA $(version.major).$(version.minor)")
7275
else
7376
print(io, "the default CUDA")
7477
end

0 commit comments

Comments
 (0)