Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@antoine-levitt
Created December 29, 2019 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antoine-levitt/3495f47c99676f26824df1fbe9462040 to your computer and use it in GitHub Desktop.
Save antoine-levitt/3495f47c99676f26824df1fbe9462040 to your computer and use it in GitHub Desktop.
using FFTW
n = 128
m = 5
X = randn(ComplexF64, n, n, n, m)
p = plan_fft!(X, (1, 2, 3))
Y = copy(X)
GC.gc()
GC.enable(false)
@time mul!(X, p, X)
@time mul!(X, p, X)
@time mul!(X, p, X)
println()
@time copy(X)
@time copy(X)
@time copy(X)
println()
@time zero(X)
@time zero(X)
@time zero(X)
println()
@time (Y = similar(X); fill!(Y, 0))
@time (Y = similar(X); fill!(Y, 0))
@time (Y = similar(X); fill!(Y, 0))
println()
@time copy!(Y, X)
@time copy!(Y, X)
@time copy!(Y, X)
println()
@time fill!(Y, 0)
@time fill!(Y, 0)
@time fill!(Y, 0)
GC.enable(true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment