-
-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add FFT implementation #589
base: fda/MPI2
Are you sure you want to change the base?
Conversation
struct IRFFT! end | ||
struct IFFT! end | ||
|
||
export FFT, RFFT, IRFFT, IFFT, FFT!, RFFT!, IRFFT!, IFFT!, fft, ifft |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export FFT, RFFT, IRFFT, IFFT, FFT!, RFFT!, IRFFT!, IFFT!, fft, ifft |
We shouldn't need to export any of these. If users want to use Dagger's FFT, all they should need to do is using Dagger, AbstractFFTs
and then fft(A)
where A <: DArray
.
@@ -0,0 +1,576 @@ | |||
using AbstractFFTs | |||
using LinearAlgebra | |||
using Dagger: DArray, @spawn, InOut, In |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using Dagger: DArray, @spawn, InOut, In |
By being in Dagger, these are already available directly.
else | ||
throw(ArgumentError("Unknown transform type")) | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
struct FFT end | ||
struct RFFT end | ||
struct IRFFT end | ||
struct IFFT end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
struct FFT end | |
struct RFFT end | |
struct IRFFT end | |
struct IFFT end |
See below for explanation.
using AbstractFFTs | ||
using LinearAlgebra | ||
using Dagger: DArray, @spawn, InOut, In | ||
using MPI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using MPI |
We won't directly use MPI for the FFT implementation - Datadeps will handle this for us automatically, when necessary.
end | ||
end | ||
|
||
redistribute_x_to_y!(A, B) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redistribute_x_to_y!(A, B) | |
copyto!(A, B) |
Dagger.@spawn name="apply_fft!(dim 2)[$idx]" apply_fft!(InOut(B_parts[idx]), In(transforms[2]), In(dims[2])) | ||
end | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
end | ||
end | ||
|
||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
end | |
end | |
end | ||
end | ||
|
||
redistribute!(A, B) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redistribute!(A, B) | |
copyto!(A, B) | |
end | ||
end | ||
|
||
function ifft(A::DArray{T,2}, B::DArray{T,2}, transforms, dims) where T |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function ifft(A::DArray{T,2}, B::DArray{T,2}, transforms, dims) where T | |
function AbstractFFTs.ifft!(out::DMatrix{T}, A::DMatrix{T}; dims, decomp::Decomposition=Slab()) where T |
No description provided.