We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b0d76f commit 77729b4Copy full SHA for 77729b4
src/search.jl
@@ -22,7 +22,8 @@ function search(graph::G,
22
# lists of candidates, sorted by distance
23
candidates = [BinaryMaxHeap{Tuple{U, V, Bool}}() for _ in 1:length(queries)]
24
# a set of seen candidates per thread
25
- seen_sets = [BitVector(undef, length(data)) for _ in 1:Threads.maxthreadid()]
+ max_threads = @static VERSION >= v"1.9.0" ? Threads.maxthreadid() : Threads.nthreads()
26
+ seen_sets = [BitVector(undef, length(data)) for _ in 1:max_threads]
27
Threads.@threads :static for i in eachindex(queries) # :static needed to use threadid()
28
# zero out seen
29
seen = seen_sets[Threads.threadid()]
0 commit comments