Skip to content

Commit 656175d

Browse files
authored
Merge pull request #2314 from codetalker7/use-better-ordered-collection
Removing deprecated method call in `GPU_BACKEND_ORDER`.
2 parents 1348828 + 576dca9 commit 656175d

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/functor.jl

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -187,16 +187,9 @@ _isbitsarray(x) = false
187187
_isleaf(::AbstractRNG) = true
188188
_isleaf(x) = _isbitsarray(x) || Functors.isleaf(x)
189189

190-
const GPU_BACKEND_ORDER = sort(
191-
Dict(
192-
"CUDA" => 1,
193-
"AMD" => 2,
194-
"Metal" => 3,
195-
"CPU" => 4,
196-
),
197-
byvalue = true
198-
)
199-
const GPU_BACKENDS = tuple(collect(keys(GPU_BACKEND_ORDER))...)
190+
# the order below is important
191+
const GPU_BACKENDS = ["CUDA", "AMD", "Metal", "CPU"]
192+
const GPU_BACKEND_ORDER = Dict(collect(zip(GPU_BACKENDS, 1:length(GPU_BACKENDS))))
200193
const GPU_BACKEND = @load_preference("gpu_backend", "CUDA")
201194

202195
function gpu_backend!(backend::String)

0 commit comments

Comments
 (0)