Skip to content

Commit

Permalink
fix nthreads on 1.9 (#496)
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth authored Jun 14, 2023
1 parent fbef0d9 commit e5cff84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/dim_helpers/ConvDims.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function im2col_dims(c::ConvDims)
# Size of single dotproduct within convolution
prod(kernel_size(c))*channels_in(c),
# One workspace per thread
Threads.nthreads(),
VERSION > v"1.9.0-0" ? Threads.maxthreadid() : Threads.nthreads(),
)
end

Expand Down
4 changes: 3 additions & 1 deletion src/gemm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ for (gemm, elt) in gemm_datatype_mappings
strB = size(B, 3) == 1 ? 0 : Base.stride(B, 3)
strC = Base.stride(C, 3)

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

Expand Down

2 comments on commit e5cff84

@CarloLucibello
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/85613

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.9.0 -m "<description of version>" e5cff84767a3d7fbe524e9bd7d7cded97f612372
git push origin v0.9.0

Please sign in to comment.