Skip to content

Commit f898b65

Browse files
authored
Use Threads.nthreads() instead of Sys.CPU_THREADS/2 to set FFTW thread count
1 parent 9168ca6 commit f898b65

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/libfasttransforms.jl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ft_set_num_threads(n::Integer) = ccall((:ft_set_num_threads, libfasttransforms),
1313
ft_fftw_plan_with_nthreads(n::Integer) = ccall((:ft_fftw_plan_with_nthreads, libfasttransforms), Cvoid, (Cint, ), n)
1414

1515
function __init__()
16-
n = ceil(Int, Sys.CPU_THREADS/2)
16+
n = Threads.nthreads()
1717
ft_set_num_threads(n)
1818
ccall((:ft_fftw_init_threads, libfasttransforms), Cint, ())
1919
ft_fftw_plan_with_nthreads(n)

‎test/libfasttransformstests.jl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using FastTransforms, Test
22

3-
FastTransforms.ft_set_num_threads(ceil(Int, Base.Sys.CPU_THREADS/2))
3+
FastTransforms.ft_set_num_threads(Threads.nthreads())
44

55
@testset "libfasttransforms" begin
66
n = 64

0 commit comments

Comments
 (0)