Skip to content

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

@cyanescent

Description

@cyanescent
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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions