You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/abstract.md
+32-13Lines changed: 32 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,14 +13,27 @@ An overview about the current packages and their dependencies is shown in the fo
13
13
## Implementations
14
14
15
15
Currently, there are four implementations of the `AbstractNFFTs` interface:
16
-
1.**NFFT.jl**: This is the reference implementation running und the CPU.
17
-
2.**CuNFFT.jl**: An implementation running on graphics hardware of Nvidia exploiting CUDA.jl
18
-
3.**NFFT3.jl**: In the `Wrapper` directory of `NFFT.jl` there is a wrapper around the `NFFT3.jl` package following the `AbstractNFFTs` interface. `NFFT3.jl` is itself a wrapper around the high performance C library [NFFT3](http://www.nfft.org).
19
-
4.**FINUFFT.jl**: In the `Wrapper` directory of `NFFT.jl` there is a wrapper around the `FINUFFT.jl`package. `FINUFFT.jl` is itself a wrapper around the high performance C++ library [FINUFFT](https://finufft.readthedocs.io).
16
+
1.**NFFT.jl**: This is the reference implementation running on the CPU and with configurations on the GPU.
17
+
2.**NFFT3.jl**: In the `Wrapper` directory of `NFFT.jl` there is a wrapper around the `NFFT3.jl` package following the `AbstractNFFTs` interface. `NFFT3.jl` is itself a wrapper around the high performance C library [NFFT3](http://www.nfft.org).
18
+
3.**FINUFFT.jl**: In the `Wrapper` directory of `NFFT.jl` there is a wrapper around the `FINUFFT.jl` package. `FINUFFT.jl` is itself a wrapper around the high performance C++ library [FINUFFT](https://finufft.readthedocs.io).
19
+
4.**NonuniformFFTs.jl**: Pure Julia package written with generic and fast GPU kernels written with KernelAbstractions.jl.
20
20
21
21
!!! note
22
22
Right now one needs to install `NFFT.jl` and manually include the wrapper files. In the future we hope to integrate the wrappers in `NFFT3.jl` and `FINUFFT.jl` directly such that it is much more convenient to switch libraries.
23
23
24
+
It's possible to change between different implementation backends. Each backend has to implement a backend type, which by convention can be accessed via for example `NFFT.backend()`. There are several ways to activate a backend:
25
+
```julia
26
+
# Actively setting a backend:
27
+
AbstractNFFTs.set_active_backend!(NFFT.backend())
28
+
# Activating a backend:
29
+
NFFT.activate!()
30
+
# and creating a new dynamic scope which uses a different backend:
31
+
with(nfft_backend => NonuniformFFTs.backend()) do
32
+
# Uses NonuniformFFTs as implementation backend
33
+
end
34
+
# It's also possible to directly pass backends to functions:
35
+
nfft(NonuniformFFTs.backend(), ...)
36
+
```
24
37
25
38
## Interface
26
39
@@ -30,14 +43,24 @@ Here
30
43
*`D` is the size of the input vector
31
44
*`R` is the size of the output vector. Usually this will be `R=1` unless a directional NFFT is implemented.
32
45
33
-
For instance the `CuNFFTPlan` is defined like this
In addition to the plan and backend, the following functions need to be implemented:
41
64
```julia
42
65
size_out(p)
43
66
size_out(p)
@@ -99,20 +122,16 @@ All parameters are put into keyword arguments that have to match as well. We des
99
122
100
123
Additionally, to the type-specific constructor one can provide the factory
101
124
```
102
-
plan_nfft(Q::Type, k::Matrix{T}, N::NTuple{D,Int}; kargs...) where {D}
125
+
plan_nfft(b::MyBackend, Q::Type, k::Matrix{T}, N::NTuple{D,Int}; kargs...) where {D}
103
126
```
104
127
where `Q` is the Array type, e.g. `Array`. The reason to require the array type is, that this allows for GPU implementations, which would use for instance `CuArray` here.
105
128
106
129
The package `AbstractNFFTs` provides a convenient constructor
107
130
```
108
-
plan_nfft(k::Matrix{T}, N::NTuple{D,Int}; kargs...) where {D}
131
+
plan_nfft(b::MyBackend, k::Matrix{T}, N::NTuple{D,Int}; kargs...) where {D}
109
132
```
110
133
defaulting to the `Array` type.
111
134
112
-
!!! note
113
-
Different packages implementing `plan_nfft` will conflict if the same `Q` is implemented. In case of `NFFT.jl` and `CuNFFT.jl` there is no conflict since the array type is different.
114
-
115
-
116
135
## Derived Interface
117
136
118
137
Based on the core low-level interface that an `AbstractNFFTPlan` needs to provide, the package
Copy file name to clipboardExpand all lines: docs/src/index.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
## Introduction
6
6
7
7
This package provides a Julia implementation of the Non-equidistant Fast Fourier Transform (NFFT).
8
-
For a detailed introduction into the NFFT and its application please have a look at the [software paper](https://arxiv.org/pdf/2208.00049.pdf) on the `NFFT.jl`. Further resources are [nfft.org](http://www.nfft.org) and [finufft.readthedocs.io](https://finufft.readthedocs.io). You
8
+
For a detailed introduction into the NFFT and its application please have a look at the [software paper](https://arxiv.org/pdf/2208.00049.pdf) on the `NFFT.jl`. Further resources are [nfft.org](http://www.nfft.org) and [finufft.readthedocs.io](https://finufft.readthedocs.io).
9
9
10
10
The NFFT is a fast implementation of the Non-equidistant Discrete Fourier Transform (NDFT) that is
11
11
basically a Discrete Fourier Transform (DFT) with non-equidistant sampling nodes in either Fourier or time/space domain.
@@ -25,7 +25,7 @@ add NFFT
25
25
```
26
26
This will install the packages `NFFT.jl` and all its dependencies. Most importantly it installs the abstract interface package `AbstractNFFTs.jl`, which `NFFT.jl` implements.
27
27
28
-
Additional NFFT related tools can be obtained by adding the package `NFFTTools.jl`. If you need support for `CUDA` you also need to install the package `CuNFFT.jl`.
28
+
Additional NFFT related tools can be obtained by adding the package `NFFTTools.jl`. If you need support for `CUDA`or other GPU backends, you only need to install the respective GPU backend and a GPU compatible plan will be available via a package extension.
29
29
30
30
In case you want to use an alternative NFFT implementation such as [NFFT3.jl](https://github.com/NFFT/NFFT3.jl) or [FINUFFT.jl](https://github.com/ludvigak/FINUFFT.jl) we provide wrapper types allowing to use them as `AbstractNFFTs` implementations. They can be used like this:
This requires that you first `add` the package you want to use.
37
+
This requires that you first `add` the package you want to use.
38
+
39
+
A related package is [NonuniformFFTs.jl](https://github.com/jipolanco/NonuniformFFTs.jl) which provides a pure Julia implementation using KernelAbstractions.jl. It also features an implementation of the `AbstractNFFTs.jl` interface.
0 commit comments