Skip to content

Commit dbcb5d2

Browse files
Replace __init__ with OncePerProcess on supported Julia versions (#316)
* Replace `__init__` with `OncePerProcess` on supported Julia versions * Bump version number --------- Co-authored-by: Mosè Giordano <[email protected]>
1 parent cefd827 commit dbcb5d2

File tree

5 files changed

+81
-56
lines changed

5 files changed

+81
-56
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "FFTW"
22
uuid = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
3-
version = "1.8.1"
3+
version = "1.9.0"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"

src/FFTW.jl

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export dct, idct, dct!, idct!, plan_dct, plan_idct, plan_dct!, plan_idct!
1616

1717
include("providers.jl")
1818

19-
function __init__()
19+
function initialize_library_paths()
2020
# If someone is trying to set the provider via the old environment variable, warn them that they
2121
# should instead use `set_provider!()` instead.
2222
if haskey(ENV, "JULIA_FFTW_PROVIDER")
@@ -27,14 +27,36 @@ function __init__()
2727
# libfftw3{,f} refs at runtime, since we may have relocated and
2828
# changed the path to the library since the last time we precompiled.
2929
@static if fftw_provider == "fftw"
30-
libfftw3[] = FFTW_jll.libfftw3_path
31-
libfftw3f[] = FFTW_jll.libfftw3f_path
30+
libfftw3_path[] = FFTW_jll.libfftw3_path
31+
libfftw3f_path[] = FFTW_jll.libfftw3f_path
3232
fftw_init_threads()
3333
end
3434
@static if fftw_provider == "mkl"
35-
libfftw3[] = MKL_jll.libmkl_rt_path
36-
libfftw3f[] = MKL_jll.libmkl_rt_path
35+
libfftw3_path[] = MKL_jll.libmkl_rt_path
36+
libfftw3f_path[] = MKL_jll.libmkl_rt_path
3737
end
38+
return nothing
39+
end
40+
41+
if VERSION >= v"1.12.0-beta1.29"
42+
const initialize_library_paths_once = OncePerProcess{Nothing}() do
43+
initialize_library_paths()
44+
return
45+
end
46+
function libfftw3()
47+
initialize_library_paths_once()
48+
return libfftw3_path[]
49+
end
50+
function libfftw3f()
51+
initialize_library_paths_once()
52+
return libfftw3f_path[]
53+
end
54+
else
55+
function __init__()
56+
initialize_library_paths()
57+
end
58+
libfftw3() = libfftw3_path[]
59+
libfftw3f() = libfftw3f_path[]
3860
end
3961

4062
# most FFTW calls other than fftw_execute should be protected by a lock to be thread-safe

src/fft.jl

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function plan_r2r end
5656
## FFT: Implement fft by calling fftw.
5757

5858
const version = VersionNumber(split(unsafe_string(cglobal(
59-
(:fftw_version,libfftw3[]), UInt8)), ['-', ' '])[2])
59+
(:fftw_version,libfftw3()), UInt8)), ['-', ' '])[2])
6060

6161
## Direction of FFT
6262

@@ -141,32 +141,32 @@ alignment_of(A::FakeArray) = Int32(0)
141141
@exclusive function export_wisdom(fname::AbstractString)
142142
f = ccall(:fopen, Ptr{Cvoid}, (Cstring,Cstring), fname, :w)
143143
systemerror("could not open wisdom file $fname for writing", f == C_NULL)
144-
ccall((:fftw_export_wisdom_to_file,libfftw3[]), Cvoid, (Ptr{Cvoid},), f)
144+
ccall((:fftw_export_wisdom_to_file,libfftw3()), Cvoid, (Ptr{Cvoid},), f)
145145
ccall(:fputs, Int32, (Ptr{UInt8},Ptr{Cvoid}), " "^256, f) # no NUL, hence no Cstring
146-
ccall((:fftwf_export_wisdom_to_file,libfftw3f[]), Cvoid, (Ptr{Cvoid},), f)
146+
ccall((:fftwf_export_wisdom_to_file,libfftw3f()), Cvoid, (Ptr{Cvoid},), f)
147147
ccall(:fclose, Cvoid, (Ptr{Cvoid},), f)
148148
end
149149

150150
@exclusive function import_wisdom(fname::AbstractString)
151151
f = ccall(:fopen, Ptr{Cvoid}, (Cstring,Cstring), fname, :r)
152152
systemerror("could not open wisdom file $fname for reading", f == C_NULL)
153-
if ccall((:fftw_import_wisdom_from_file,libfftw3[]),Int32,(Ptr{Cvoid},),f)==0||
154-
ccall((:fftwf_import_wisdom_from_file,libfftw3f[]),Int32,(Ptr{Cvoid},),f)==0
153+
if ccall((:fftw_import_wisdom_from_file,libfftw3()),Int32,(Ptr{Cvoid},),f)==0||
154+
ccall((:fftwf_import_wisdom_from_file,libfftw3f()),Int32,(Ptr{Cvoid},),f)==0
155155
error("failed to import wisdom from $fname")
156156
end
157157
ccall(:fclose, Cvoid, (Ptr{Cvoid},), f)
158158
end
159159

160160
@exclusive function import_system_wisdom()
161-
if ccall((:fftw_import_system_wisdom,libfftw3[]), Int32, ()) == 0 ||
162-
ccall((:fftwf_import_system_wisdom,libfftw3f[]), Int32, ()) == 0
161+
if ccall((:fftw_import_system_wisdom,libfftw3()), Int32, ()) == 0 ||
162+
ccall((:fftwf_import_system_wisdom,libfftw3f()), Int32, ()) == 0
163163
error("failed to import system wisdom")
164164
end
165165
end
166166

167167
@exclusive function forget_wisdom()
168-
ccall((:fftw_forget_wisdom,libfftw3[]), Cvoid, ())
169-
ccall((:fftwf_forget_wisdom,libfftw3f[]), Cvoid, ())
168+
ccall((:fftw_forget_wisdom,libfftw3()), Cvoid, ())
169+
ccall((:fftwf_forget_wisdom,libfftw3f()), Cvoid, ())
170170
end
171171

172172
# Threads
@@ -176,15 +176,15 @@ function _set_num_threads(num_threads::Integer)
176176
@static if fftw_provider == "mkl"
177177
_last_num_threads[] = num_threads
178178
end
179-
ccall((:fftw_plan_with_nthreads,libfftw3[]), Cvoid, (Int32,), num_threads)
180-
ccall((:fftwf_plan_with_nthreads,libfftw3f[]), Cvoid, (Int32,), num_threads)
179+
ccall((:fftw_plan_with_nthreads,libfftw3()), Cvoid, (Int32,), num_threads)
180+
ccall((:fftwf_plan_with_nthreads,libfftw3f()), Cvoid, (Int32,), num_threads)
181181
end
182182

183183
@exclusive set_num_threads(num_threads::Integer) = _set_num_threads(num_threads)
184184

185185
function get_num_threads()
186186
@static if fftw_provider == "fftw"
187-
ccall((:fftw_planner_nthreads,libfftw3[]), Cint, ())
187+
ccall((:fftw_planner_nthreads,libfftw3()), Cint, ())
188188
else
189189
_last_num_threads[]
190190
end
@@ -211,9 +211,9 @@ const NO_TIMELIMIT = -1.0 # from fftw3.h
211211

212212
# only call these when fftwlock is held:
213213
unsafe_set_timelimit(precision::fftwTypeDouble,seconds) =
214-
ccall((:fftw_set_timelimit,libfftw3[]), Cvoid, (Float64,), seconds)
214+
ccall((:fftw_set_timelimit,libfftw3()), Cvoid, (Float64,), seconds)
215215
unsafe_set_timelimit(precision::fftwTypeSingle,seconds) =
216-
ccall((:fftwf_set_timelimit,libfftw3f[]), Cvoid, (Float64,), seconds)
216+
ccall((:fftwf_set_timelimit,libfftw3f()), Cvoid, (Float64,), seconds)
217217
@exclusive set_timelimit(precision, seconds) = unsafe_set_timelimit(precision, seconds)
218218

219219
# Array alignment mod 16:
@@ -234,9 +234,9 @@ unsafe_set_timelimit(precision::fftwTypeSingle,seconds) =
234234
convert(Int32, convert(Int64, pointer(A)) % 16)
235235
else
236236
alignment_of(A::StridedArray{T}) where {T<:fftwDouble} =
237-
ccall((:fftw_alignment_of, libfftw3[]), Int32, (Ptr{T},), A)
237+
ccall((:fftw_alignment_of, libfftw3()), Int32, (Ptr{T},), A)
238238
alignment_of(A::StridedArray{T}) where {T<:fftwSingle} =
239-
ccall((:fftwf_alignment_of, libfftw3f[]), Int32, (Ptr{T},), A)
239+
ccall((:fftwf_alignment_of, libfftw3f()), Int32, (Ptr{T},), A)
240240
end
241241

242242
# FFTWPlan (low-level)
@@ -320,9 +320,9 @@ unsafe_convert(::Type{PlanPtr}, p::FFTWPlan) = p.plan
320320

321321
# these functions should only be called while the fftwlock is held
322322
unsafe_destroy_plan(@nospecialize(plan::FFTWPlan{<:fftwDouble})) =
323-
ccall((:fftw_destroy_plan,libfftw3[]), Cvoid, (PlanPtr,), plan)
323+
ccall((:fftw_destroy_plan,libfftw3()), Cvoid, (PlanPtr,), plan)
324324
unsafe_destroy_plan(@nospecialize(plan::FFTWPlan{<:fftwSingle})) =
325-
ccall((:fftwf_destroy_plan,libfftw3f[]), Cvoid, (PlanPtr,), plan)
325+
ccall((:fftwf_destroy_plan,libfftw3f()), Cvoid, (PlanPtr,), plan)
326326

327327
const deferred_destroy_lock = ReentrantLock() # lock protecting the deferred_destroy_plans list
328328
const deferred_destroy_plans = FFTWPlan[]
@@ -388,19 +388,19 @@ end
388388
#################################################################################################
389389

390390
cost(plan::FFTWPlan{<:fftwDouble}) =
391-
ccall((:fftw_cost,libfftw3[]), Float64, (PlanPtr,), plan)
391+
ccall((:fftw_cost,libfftw3()), Float64, (PlanPtr,), plan)
392392
cost(plan::FFTWPlan{<:fftwSingle}) =
393-
ccall((:fftwf_cost,libfftw3f[]), Float64, (PlanPtr,), plan)
393+
ccall((:fftwf_cost,libfftw3f()), Float64, (PlanPtr,), plan)
394394

395395
@exclusive function arithmetic_ops(plan::FFTWPlan{<:fftwDouble})
396396
add, mul, fma = Ref(0.0), Ref(0.0), Ref(0.0)
397-
ccall((:fftw_flops,libfftw3[]), Cvoid,
397+
ccall((:fftw_flops,libfftw3()), Cvoid,
398398
(PlanPtr,Ref{Float64},Ref{Float64},Ref{Float64}), plan, add, mul, fma)
399399
return (round(Int64, add[]), round(Int64, mul[]), round(Int64, fma[]))
400400
end
401401
@exclusive function arithmetic_ops(plan::FFTWPlan{<:fftwSingle})
402402
add, mul, fma = Ref(0.0), Ref(0.0), Ref(0.0)
403-
ccall((:fftwf_flops,libfftw3f[]), Cvoid,
403+
ccall((:fftwf_flops,libfftw3f()), Cvoid,
404404
(PlanPtr,Ref{Float64},Ref{Float64},Ref{Float64}), plan, add, mul, fma)
405405
return (round(Int64, add[]), round(Int64, mul[]), round(Int64, fma[]))
406406
end
@@ -431,9 +431,9 @@ const has_sprint_plan = version >= v"3.3.4" && fftw_provider == "fftw"
431431

432432
@static if has_sprint_plan
433433
sprint_plan_(plan::FFTWPlan{<:fftwDouble}) =
434-
ccall((:fftw_sprint_plan,libfftw3[]), Ptr{UInt8}, (PlanPtr,), plan)
434+
ccall((:fftw_sprint_plan,libfftw3()), Ptr{UInt8}, (PlanPtr,), plan)
435435
sprint_plan_(plan::FFTWPlan{<:fftwSingle}) =
436-
ccall((:fftwf_sprint_plan,libfftw3f[]), Ptr{UInt8}, (PlanPtr,), plan)
436+
ccall((:fftwf_sprint_plan,libfftw3f()), Ptr{UInt8}, (PlanPtr,), plan)
437437
function sprint_plan(plan::FFTWPlan)
438438
p = sprint_plan_(plan)
439439
str = unsafe_string(p)
@@ -515,49 +515,49 @@ _colmajorstrides(p) = ()
515515
# Execute
516516

517517
unsafe_execute!(plan::FFTWPlan{<:fftwDouble}) =
518-
ccall((:fftw_execute,libfftw3[]), Cvoid, (PlanPtr,), plan)
518+
ccall((:fftw_execute,libfftw3()), Cvoid, (PlanPtr,), plan)
519519

520520
unsafe_execute!(plan::FFTWPlan{<:fftwSingle}) =
521-
ccall((:fftwf_execute,libfftw3f[]), Cvoid, (PlanPtr,), plan)
521+
ccall((:fftwf_execute,libfftw3f()), Cvoid, (PlanPtr,), plan)
522522

523523
unsafe_execute!(plan::cFFTWPlan{T},
524524
X::StridedArray{T}, Y::StridedArray{T}) where {T<:fftwDouble} =
525-
ccall((:fftw_execute_dft,libfftw3[]), Cvoid,
525+
ccall((:fftw_execute_dft,libfftw3()), Cvoid,
526526
(PlanPtr,Ptr{T},Ptr{T}), plan, X, Y)
527527

528528
unsafe_execute!(plan::cFFTWPlan{T},
529529
X::StridedArray{T}, Y::StridedArray{T}) where {T<:fftwSingle} =
530-
ccall((:fftwf_execute_dft,libfftw3f[]), Cvoid,
530+
ccall((:fftwf_execute_dft,libfftw3f()), Cvoid,
531531
(PlanPtr,Ptr{T},Ptr{T}), plan, X, Y)
532532

533533
unsafe_execute!(plan::rFFTWPlan{Float64,FORWARD},
534534
X::StridedArray{Float64}, Y::StridedArray{Complex{Float64}}) =
535-
ccall((:fftw_execute_dft_r2c,libfftw3[]), Cvoid,
535+
ccall((:fftw_execute_dft_r2c,libfftw3()), Cvoid,
536536
(PlanPtr,Ptr{Float64},Ptr{Complex{Float64}}), plan, X, Y)
537537

538538
unsafe_execute!(plan::rFFTWPlan{Float32,FORWARD},
539539
X::StridedArray{Float32}, Y::StridedArray{Complex{Float32}}) =
540-
ccall((:fftwf_execute_dft_r2c,libfftw3f[]), Cvoid,
540+
ccall((:fftwf_execute_dft_r2c,libfftw3f()), Cvoid,
541541
(PlanPtr,Ptr{Float32},Ptr{Complex{Float32}}), plan, X, Y)
542542

543543
unsafe_execute!(plan::rFFTWPlan{Complex{Float64},BACKWARD},
544544
X::StridedArray{Complex{Float64}}, Y::StridedArray{Float64}) =
545-
ccall((:fftw_execute_dft_c2r,libfftw3[]), Cvoid,
545+
ccall((:fftw_execute_dft_c2r,libfftw3()), Cvoid,
546546
(PlanPtr,Ptr{Complex{Float64}},Ptr{Float64}), plan, X, Y)
547547

548548
unsafe_execute!(plan::rFFTWPlan{Complex{Float32},BACKWARD},
549549
X::StridedArray{Complex{Float32}}, Y::StridedArray{Float32}) =
550-
ccall((:fftwf_execute_dft_c2r,libfftw3f[]), Cvoid,
550+
ccall((:fftwf_execute_dft_c2r,libfftw3f()), Cvoid,
551551
(PlanPtr,Ptr{Complex{Float32}},Ptr{Float32}), plan, X, Y)
552552

553553
unsafe_execute!(plan::r2rFFTWPlan{T},
554554
X::StridedArray{T}, Y::StridedArray{T}) where {T<:fftwDouble} =
555-
ccall((:fftw_execute_r2r,libfftw3[]), Cvoid,
555+
ccall((:fftw_execute_r2r,libfftw3()), Cvoid,
556556
(PlanPtr,Ptr{T},Ptr{T}), plan, X, Y)
557557

558558
unsafe_execute!(plan::r2rFFTWPlan{T},
559559
X::StridedArray{T}, Y::StridedArray{T}) where {T<:fftwSingle} =
560-
ccall((:fftwf_execute_r2r,libfftw3f[]), Cvoid,
560+
ccall((:fftwf_execute_r2r,libfftw3f()), Cvoid,
561561
(PlanPtr,Ptr{T},Ptr{T}), plan, X, Y)
562562

563563
# NOTE ON GC (garbage collection):
@@ -654,7 +654,7 @@ for (Tr,Tc,fftw,lib) in ((:Float64,:(Complex{Float64}),"fftw",:libfftw3),
654654
unsafe_set_timelimit($Tr, timelimit)
655655
R = isa(region, Tuple) ? region : copy(region)
656656
dims, howmany = dims_howmany(X, Y, size(X), R)
657-
plan = ccall(($(string(fftw,"_plan_guru64_dft")),$lib[]),
657+
plan = ccall(($(string(fftw,"_plan_guru64_dft")),$lib()),
658658
PlanPtr,
659659
(Int32, Ptr{Int}, Int32, Ptr{Int},
660660
Ptr{$Tc}, Ptr{$Tc}, Int32, UInt32),
@@ -674,7 +674,7 @@ for (Tr,Tc,fftw,lib) in ((:Float64,:(Complex{Float64}),"fftw",:libfftw3),
674674
regionshft = _circshiftmin1(region) # FFTW halves last dim
675675
unsafe_set_timelimit($Tr, timelimit)
676676
dims, howmany = dims_howmany(X, Y, size(X), regionshft)
677-
plan = ccall(($(string(fftw,"_plan_guru64_dft_r2c")),$lib[]),
677+
plan = ccall(($(string(fftw,"_plan_guru64_dft_r2c")),$lib()),
678678
PlanPtr,
679679
(Int32, Ptr{Int}, Int32, Ptr{Int},
680680
Ptr{$Tr}, Ptr{$Tc}, UInt32),
@@ -694,7 +694,7 @@ for (Tr,Tc,fftw,lib) in ((:Float64,:(Complex{Float64}),"fftw",:libfftw3),
694694
regionshft = _circshiftmin1(region) # FFTW halves last dim
695695
unsafe_set_timelimit($Tr, timelimit)
696696
dims, howmany = dims_howmany(X, Y, size(Y), regionshft)
697-
plan = ccall(($(string(fftw,"_plan_guru64_dft_c2r")),$lib[]),
697+
plan = ccall(($(string(fftw,"_plan_guru64_dft_c2r")),$lib()),
698698
PlanPtr,
699699
(Int32, Ptr{Int}, Int32, Ptr{Int},
700700
Ptr{$Tc}, Ptr{$Tr}, UInt32),
@@ -716,7 +716,7 @@ for (Tr,Tc,fftw,lib) in ((:Float64,:(Complex{Float64}),"fftw",:libfftw3),
716716
knd = fix_kinds(region, kinds)
717717
unsafe_set_timelimit($Tr, timelimit)
718718
dims, howmany = dims_howmany(X, Y, size(X), region)
719-
plan = ccall(($(string(fftw,"_plan_guru64_r2r")),$lib[]),
719+
plan = ccall(($(string(fftw,"_plan_guru64_r2r")),$lib()),
720720
PlanPtr,
721721
(Int32, Ptr{Int}, Int32, Ptr{Int},
722722
Ptr{$Tr}, Ptr{$Tr}, Ptr{Int32}, UInt32),
@@ -744,7 +744,7 @@ for (Tr,Tc,fftw,lib) in ((:Float64,:(Complex{Float64}),"fftw",:libfftw3),
744744
howmany[2:3, :] .*= 2
745745
end
746746
howmany = [howmany [2,1,1]] # append loop over real/imag parts
747-
plan = ccall(($(string(fftw,"_plan_guru64_r2r")),$lib[]),
747+
plan = ccall(($(string(fftw,"_plan_guru64_r2r")),$lib()),
748748
PlanPtr,
749749
(Int32, Ptr{Int}, Int32, Ptr{Int},
750750
Ptr{$Tc}, Ptr{$Tc}, Ptr{Int32}, UInt32),

src/providers.jl

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ const fftw_provider = get_provider()
2323
# We'll initialize `libfftw3` here (in the conditionals below), and
2424
# it will get overwritten again in `__init__()`. This allows us to
2525
# `ccall` at build time, and also be relocatable for PackageCompiler.
26-
const libfftw3 = Ref{String}()
27-
const libfftw3f = Ref{String}()
26+
const libfftw3_path = Ref{String}()
27+
const libfftw3f_path = Ref{String}()
2828

2929
"""
3030
set_provider!(provider; export_prefs::Bool = false)
@@ -48,8 +48,8 @@ end
4848
# If we're using fftw_jll, load it in
4949
@static if fftw_provider == "fftw"
5050
import FFTW_jll
51-
libfftw3[] = FFTW_jll.libfftw3_path
52-
libfftw3f[] = FFTW_jll.libfftw3f_path
51+
libfftw3_path[] = FFTW_jll.libfftw3_path
52+
libfftw3f_path[] = FFTW_jll.libfftw3f_path
5353

5454
# callback function that FFTW uses to launch `num` parallel
5555
# tasks (FFTW/fftw3#175):
@@ -66,24 +66,27 @@ end
6666
# (Previously, we called fftw_cleanup, but this invalidated existing
6767
# plans, causing Base Julia issue #19892.)
6868
function fftw_init_threads()
69-
stat = ccall((:fftw_init_threads, libfftw3[]), Int32, ())
70-
statf = ccall((:fftwf_init_threads, libfftw3f[]), Int32, ())
69+
# We de-reference libfftw3(f)_path directly in this function instead of using
70+
# `libfftw3(f)()` to avoid the circular dependency and thus a stack overflow. This
71+
# function is only called after the path references are initialized.
72+
stat = ccall((:fftw_init_threads, libfftw3_path[]), Int32, ())
73+
statf = ccall((:fftwf_init_threads, libfftw3f_path[]), Int32, ())
7174
if stat == 0 || statf == 0
7275
error("could not initialize FFTW threads")
7376
end
7477

7578
if nthreads() > 1
7679
cspawnloop = @cfunction(spawnloop, Cvoid, (Ptr{Cvoid}, Ptr{Cvoid}, Csize_t, Cint, Ptr{Cvoid}))
77-
ccall((:fftw_threads_set_callback, libfftw3[]), Cvoid, (Ptr{Cvoid}, Ptr{Cvoid}), cspawnloop, C_NULL)
78-
ccall((:fftwf_threads_set_callback, libfftw3f[]), Cvoid, (Ptr{Cvoid}, Ptr{Cvoid}), cspawnloop, C_NULL)
80+
ccall((:fftw_threads_set_callback, libfftw3_path[]), Cvoid, (Ptr{Cvoid}, Ptr{Cvoid}), cspawnloop, C_NULL)
81+
ccall((:fftwf_threads_set_callback, libfftw3f_path[]), Cvoid, (Ptr{Cvoid}, Ptr{Cvoid}), cspawnloop, C_NULL)
7982
end
8083
end
8184
end
8285

8386
# If we're using MKL, load it in and set library paths appropriately.
8487
@static if fftw_provider == "mkl"
8588
import MKL_jll
86-
libfftw3[] = MKL_jll.libmkl_rt_path
87-
libfftw3f[] = MKL_jll.libmkl_rt_path
89+
libfftw3_path[] = MKL_jll.libmkl_rt_path
90+
libfftw3f_path[] = MKL_jll.libmkl_rt_path
8891
const _last_num_threads = Ref(Cint(1))
8992
end

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ end # fftw_provider == "fftw"
528528
end
529529

530530
# check whether FFTW on this architecture has nontrivial alignment requirements
531-
nontrivial_alignment = FFTW.fftw_provider == "fftw" && ccall((:fftwf_alignment_of, FFTW.libfftw3f[]), Int32, (Int,), 8) != 0
531+
nontrivial_alignment = FFTW.fftw_provider == "fftw" && ccall((:fftwf_alignment_of, FFTW.libfftw3f()), Int32, (Int,), 8) != 0
532532
if nontrivial_alignment
533533
@test_throws ArgumentError plan_rfft(Array{Float32}(undef, 32)) * view(A, 2:33)
534534
@test_throws ArgumentError plan_fft(Array{Complex{Float32}}(undef, 32)) * view(Ac, 2:33)

0 commit comments

Comments
 (0)