Skip to content
Draft
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: 1 addition & 1 deletion src/libfasttransforms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ft_set_num_threads(n::Integer) = ccall((:ft_set_num_threads, libfasttransforms),
ft_fftw_plan_with_nthreads(n::Integer) = ccall((:ft_fftw_plan_with_nthreads, libfasttransforms), Cvoid, (Cint, ), n)

function __init__()
n = ceil(Int, Sys.CPU_THREADS/2)
n = Threads.nthreads()
ft_set_num_threads(n)
ccall((:ft_fftw_init_threads, libfasttransforms), Cint, ())
ft_fftw_plan_with_nthreads(n)
Expand Down
2 changes: 1 addition & 1 deletion test/libfasttransformstests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using FastTransforms, Test

FastTransforms.ft_set_num_threads(ceil(Int, Base.Sys.CPU_THREADS/2))
FastTransforms.ft_set_num_threads(Threads.nthreads())

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Shouldnt this be done in __init__ anyway?


@testset "libfasttransforms" begin
n = 64
Expand Down