FFTW.jl icon indicating copy to clipboard operation
FFTW.jl copied to clipboard

mul!(A,FFT_plan,B) modifies the input B

Open cyanescent opened this issue 2 months ago • 1 comments

using FFTW, LinearAlgebra

A = rand(Float32, 16, 16)
p = plan_rfft(data)
pinv = plan_irfft(p * A, size(data, 1))
B = p * A
B0 = copy(B)

# This should NOT modify B but does
mul!(similar(A), pinv, B)

# Check
println("Buffer modified: ", !(B ≈ B0))

I guess this occurs for performance reasons, but this unexpected corruption prevents from reusing B (without a new allocation).

cyanescent avatar Nov 06 '25 03:11 cyanescent

Related: #77, #158

devmotion avatar Nov 06 '25 06:11 devmotion