Skip to content

Commit

Permalink
Stringify preferences.
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
maleadt committed Apr 19, 2024
1 parent 9c9a05f commit e674004
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/cudadrv/version.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,18 @@ higher-up depot; to clear preferences nondestructively, use
"""
function set_runtime_version!(version::Union{Nothing,VersionNumber}=nothing;
local_toolkit::Union{Nothing,Bool}=nothing)
if version !== nothing
version = "$(version.major).$(version.minor)"
# store stringified properties
let version = isnothing(version) ? nothing : "$(version.major).$(version.minor)"
Preferences.set_preferences!(CUDA_Runtime_jll, "version" => version; force=true)
end
let local_toolkit = isnothing(local_toolkit) ? nothing : string(local_toolkit)
Preferences.set_preferences!(CUDA_Runtime_jll, "local" => local_toolkit; force=true)
end
Preferences.set_preferences!(CUDA_Runtime_jll, "version" => version; force=true)
Preferences.set_preferences!(CUDA_Runtime_jll, "local" => local_toolkit; force=true)

io = IOBuffer()
print(io, "Configure the active project to use ")
if version !== nothing
print(io, "CUDA $version")
print(io, "CUDA $(version.major).$(version.minor)")
else
print(io, "the default CUDA")
end
Expand Down

0 comments on commit e674004

Please sign in to comment.