Skip to content
Open
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
5 changes: 5 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ jobs:
if: (matrix.os == 'macOS-15-intel') && (matrix.provider == 'mkl')
- name: Set Preferences
run: julia --project .github/set_ci_preferences.jl "${{ matrix.provider }}"
# MKL 2023 on macOS 15 may select unsupported CPU instruction paths (SIGILL).
# Constrain to AVX2 to avoid illegal-instruction crashes.
- name: Constrain MKL instruction set on macOS
if: contains(matrix.os, 'macOS') && matrix.provider == 'mkl'
run: echo "MKL_ENABLE_INSTRUCTIONS=AVX2" >> $GITHUB_ENV
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v5
Expand Down
3 changes: 3 additions & 0 deletions src/FFTW.jl
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ macro exclusive(ex)
end

include("fft.jl")
@static if fftw_provider == "mkl"
include("mkl_dfti.jl")
end
include("dct.jl")

include("precompile.jl")
Expand Down
15 changes: 15 additions & 0 deletions src/fft.jl
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ alignment_of(A::FakeArray) = Int32(0)
# around FFTW's internal file i/o buffering [see the BUFSZ constant in
# FFTW's api/import-wisdom-from-file.c file].

@static if fftw_provider == "fftw"

@exclusive function export_wisdom(fname::AbstractString)
f = ccall(:fopen, Ptr{Cvoid}, (Cstring,Cstring), fname, :w)
systemerror("could not open wisdom file $fname for writing", f == C_NULL)
Expand Down Expand Up @@ -171,6 +173,15 @@ end
ccall((:fftwf_forget_wisdom,libfftw3f), Cvoid, ())
end

else # mkl provider - wisdom is a no-op

export_wisdom(fname::AbstractString) = nothing
import_wisdom(fname::AbstractString) = nothing
import_system_wisdom() = nothing
forget_wisdom() = nothing

end # @static if fftw_provider

# Threads

# Must only be called after acquiring fftwlock
Expand Down Expand Up @@ -766,6 +777,7 @@ fftwfloat(X::StridedArray{<:fftwReal}) = X
fftwfloat(X::AbstractArray{<:Real}) = copyto!(Array{Float64}(undef, size(X)), X)
fftwfloat(X::AbstractArray{<:Complex}) = fftwcomplex(X)

@static if fftw_provider == "fftw"
for (f,direction) in ((:fft,FORWARD), (:bfft,BACKWARD))
plan_f = Symbol("plan_",f)
plan_f! = Symbol("plan_",f,"!")
Expand Down Expand Up @@ -818,6 +830,7 @@ for (f,direction) in ((:fft,FORWARD), (:bfft,BACKWARD))
end
end
end
end # @static if fftw_provider == "fftw" (plan_fft/plan_bfft)

function mul!(y::StridedArray{T}, p::cFFTWPlan{T}, x::StridedArray{T}) where T
assert_applicable(p, x, y)
Expand All @@ -840,6 +853,7 @@ end

# rfft/brfft and planned variants. No in-place version for now.

@static if fftw_provider == "fftw"
for (Tr,Tc) in ((:Float32,:(Complex{Float32})),(:Float64,:(Complex{Float64})))
# Note: use $FORWARD and $BACKWARD below because of issue #9775
@eval begin
Expand Down Expand Up @@ -952,6 +966,7 @@ for (Tr,Tc) in ((:Float32,:(Complex{Float32})),(:Float64,:(Complex{Float64})))
end
end
end
end # @static if fftw_provider == "fftw" (plan_rfft/plan_brfft)

# FFTW r2r transforms (low-level interface)

Expand Down
Loading
Loading