Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ version = "0.2.2"

[deps]
BitTwiddlingConvenienceFunctions = "62783981-4cbd-42fc-bca8-16325de8dc4b"
CPUSummary = "2a0fbf3d-bb9c-48f3-b0a9-814d99fd7ab9"
Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3"
ThreadingUtilities = "8290d209-cae3-49c0-8002-c8c24d57dab5"

[compat]
Aqua = "0.8"
BitTwiddlingConvenienceFunctions = "0.1"
CPUSummary = "0.1.2, 0.2"
Static = "1"
Test = "<0.1, 1.10"
ThreadingUtilities = "0.5"
Expand Down
4 changes: 1 addition & 3 deletions src/request.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import CPUSummary

function worker_bits()
wts = nextpow2(CPUSummary.sys_threads()) # Typically sys_threads (i.e. Sys.CPU_THREADS) does not change between runs, thus it will precompile well.
wts = nextpow2(Threads.nthreads()) # Typically sys_threads (i.e. Sys.CPU_THREADS) does not change between runs, thus it will precompile well.
Copy link
Member

@ChrisRackauckas ChrisRackauckas Jul 30, 2025

Choose a reason for hiding this comment

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

Suggested change
wts = nextpow2(Threads.nthreads()) # Typically sys_threads (i.e. Sys.CPU_THREADS) does not change between runs, thus it will precompile well.
wts = nextpow2(StaticInt{Threads.nthreads()}()) # Typically sys_threads (i.e. Sys.CPU_THREADS) does not change between runs, thus it will precompile well.

ws = static(8sizeof(UInt)) # For testing purposes it can be overridden by JULIA_CPU_THREADS,
ifelse(Static.lt(wts, ws), ws, wts)
end
Expand Down
Loading