Skip to content

Commit e5cff84

Browse files
fix nthreads on 1.9 (#496)
1 parent fbef0d9 commit e5cff84

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/dim_helpers/ConvDims.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function im2col_dims(c::ConvDims)
7373
# Size of single dotproduct within convolution
7474
prod(kernel_size(c))*channels_in(c),
7575
# One workspace per thread
76-
Threads.nthreads(),
76+
VERSION > v"1.9.0-0" ? Threads.maxthreadid() : Threads.nthreads(),
7777
)
7878
end
7979

src/gemm.jl

+3-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ for (gemm, elt) in gemm_datatype_mappings
8888
strB = size(B, 3) == 1 ? 0 : Base.stride(B, 3)
8989
strC = Base.stride(C, 3)
9090

91-
n_threads = min(Threads.nthreads(), 1 + max(length(A), length(B)) ÷ 8000)
91+
n_threads = min(
92+
VERSION > v"1.9.0-0" ? Threads.maxthreadid() : Threads.nthreads(),
93+
1 + max(length(A), length(B)) ÷ 8000)
9294
# In some tests, size (20,20,20) is worth splitting between two threads,
9395
# as is size (32,32,8).
9496

0 commit comments

Comments
 (0)