File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -297,7 +297,7 @@ function threadmap(f::Function, vw::AbstractVector...)
297
297
length (first (vw))== 0 && error (" can't map over empty vector, sorry" )
298
298
length (vw)== 2 && (isequal (length .(vw)... ) || error (" lengths must be equal" ))
299
299
out1 = f (first .(vw)... )
300
- if length (vw ) > 1
300
+ if length (first (vw) ) > 1
301
301
_threadmap (out1, f, vw... )
302
302
else
303
303
[out1]
321
321
ell = length (first (vw))
322
322
out = Vector {typeof(out1)} (undef, ell)
323
323
out[1 ] = out1
324
- Base. @sync for is in Iterators. partition (2 : ell, div (ell, Threads. nthreads ()))
324
+ Base. @sync for is in Iterators. partition (2 : ell, cld (ell- 1 , Threads. nthreads ()))
325
325
Threads. @spawn for i in is
326
326
@inbounds out[i] = f (getindex .(vw, i)... )
327
327
end
You can’t perform that action at this time.
0 commit comments