Skip to content

Commit

Permalink
further comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuuichi Asahi committed Feb 16, 2024
1 parent ce13382 commit f1e27a2
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 18 deletions.
14 changes: 7 additions & 7 deletions docs/api_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
API Reference
=============

This section documents the public user interface of `KokkosFFT`.
APIs are defined in `KokkosFFT` namespace and implementation details are defined in `KokkosFFT::Impl` namespace.
Thus, it is highly discouraged for users to access functions in `KokkosFFT::Impl` namespace except for `Plan`.
This section documents the public user interface of ``KokkosFFT``.
APIs are defined in ``KokkosFFT`` namespace and implementation details are defined in ``KokkosFFT::Impl`` namespace.
Thus, it is highly discouraged for users to access functions in ``KokkosFFT::Impl`` namespace except for ``Plan``.

FFT Plan
--------
Expand Down Expand Up @@ -34,8 +34,8 @@ Real FFTs
.. toctree::
:maxdepth: 1

rfft (One dimensional FFT for real input) <api/real/rfft.rst>
irfft (Inverse of rfft) <api/real/irfft.rst>
api/real/rfft
api/real/irfft
rfft2 (Two dimensional FFT for real input) <api/real/rfft2.rst>
irfft2 (Inverse of rfft2) <api/real/irfft2.rst>
rfftn (N-dimensional FFT for real input) <api/real/rfftn.rst>
Expand All @@ -47,8 +47,8 @@ Hermitian FFTs
.. toctree::
:maxdepth: 1

hfft (One dimensional FFT of a signal that has Hermitian symmetry) <api/hermitian/hfft.rst>
ihfft (Inverse of hfft) <api/hermitian/ihfft.rst>
api/hermitian/hfft
api/hermitian/ihfft

Helper routines
---------------
Expand Down
4 changes: 2 additions & 2 deletions docs/finding_libraries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Some tips to find FFT libraries for each backend.
-----------------------------

If fftw is offered as a module, our cmake helper would likely find fftw.
Assuming fftw is installed in `<fftw_install_dir>`, it is expected that `<fftw_install_dir>` would be found under `LIBRARY_PATH`, `LD_LIBRARY_PATH`, and `PATH`.
Assuming fftw is installed in ``<fftw_install_dir>``, it is expected that ``<fftw_install_dir>`` would be found under ``LIBRARY_PATH``, ``LD_LIBRARY_PATH``, and ``PATH``.
It would look like

.. code-block:: bash
Expand All @@ -18,7 +18,7 @@ It would look like
LD_LIBRARY_PATH=...:<fftw_install_dir>/lib
PATH=...:<fftw_install_dir>/bin
If CMake fails to find `fftw`, please try to set `FFTWDIR` in the following way.
If CMake fails to find ``fftw``, please try to set ``FFTWDIR`` in the following way.

.. code-block:: bash
Expand Down
87 changes: 78 additions & 9 deletions fft/src/KokkosFFT_Transform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ namespace KokkosFFT {
/// \brief One dimensional FFT in forward direction
///
/// \param in [in] Kokkos execution space
/// \param in [in] Input data
/// \param out [out] Ouput data
/// \param in [in] Input data (complex)
/// \param out [out] Ouput data (complex)
/// \param norm [in] How the normalization is applied (optional)
/// \param axis [in] Axis over which FFT is performed (optional)
/// \param n [in] Length of the transformed axis of the output (optional)
Expand Down Expand Up @@ -210,8 +210,8 @@ void fft(const ExecutionSpace& exec_space, const InViewType& in,
/// \brief One dimensional FFT in forward direction with a given plan
///
/// \param in [in] Kokkos execution space
/// \param in [in] Input data
/// \param out [out] Ouput data
/// \param in [in] Input data (complex)
/// \param out [out] Ouput data (complex)
/// \param in [in] KokkosFFT Plan for forward fft
/// \param norm [in] How the normalization is applied (optional)
/// \param axis [in] Axis over which FFT is performed (optional)
Expand Down Expand Up @@ -283,8 +283,8 @@ void fft(const ExecutionSpace& exec_space, const InViewType& in,
/// \brief One dimensional FFT in backward direction
///
/// \param in [in] Kokkos execution space
/// \param in [in] Input data
/// \param out [out] Ouput data
/// \param in [in] Input data (complex)
/// \param out [out] Ouput data (complex)
/// \param norm [in] How the normalization is applied (optional)
/// \param axis [in] Axis over which FFT is performed (optional)
/// \param n [in] Length of the transformed axis of the output (optional)
Expand Down Expand Up @@ -355,9 +355,9 @@ void ifft(const ExecutionSpace& exec_space, const InViewType& in,
/// \brief One dimensional FFT in backward direction with a given plan
///
/// \param in [in] Kokkos execution space
/// \param in [in] Input data
/// \param out [out] Ouput data
/// \param in [in] KokkosFFT Plan for forward fft
/// \param in [in] Input data (complex)
/// \param out [out] Ouput data (complex)
/// \param in [in] KokkosFFT Plan for backward fft
/// \param norm [in] How the normalization is applied (optional)
/// \param axis [in] Axis over which FFT is performed (optional)
/// \param n [in] Length of the transformed axis of the output (optional)
Expand Down Expand Up @@ -427,6 +427,14 @@ void ifft(const ExecutionSpace& exec_space, const InViewType& in,
}
}

/// \brief One dimensional FFT for real input
///
/// \param in [in] Kokkos execution space
/// \param in [in] Input data (real)
/// \param out [out] Ouput data (complex)
/// \param norm [in] How the normalization is applied (optional)
/// \param axis [in] Axis over which FFT is performed (optional)
/// \param n [in] Length of the transformed axis of the output (optional)
template <typename ExecutionSpace, typename InViewType, typename OutViewType>
void rfft(const ExecutionSpace& exec_space, const InViewType& in,
OutViewType& out,
Expand Down Expand Up @@ -468,6 +476,15 @@ void rfft(const ExecutionSpace& exec_space, const InViewType& in,
fft(exec_space, in, out, norm, axis, n);
}

/// \brief One dimensional FFT for real input with a given plan
///
/// \param in [in] Kokkos execution space
/// \param in [in] Input data (real)
/// \param out [out] Ouput data (complex)
/// \param in [in] KokkosFFT Plan for forward fft
/// \param norm [in] How the normalization is applied (optional)
/// \param axis [in] Axis over which FFT is performed (optional)
/// \param n [in] Length of the transformed axis of the output (optional)
template <typename ExecutionSpace, typename InViewType, typename OutViewType,
typename PlanType>
void rfft(const ExecutionSpace& exec_space, const InViewType& in,
Expand Down Expand Up @@ -510,6 +527,14 @@ void rfft(const ExecutionSpace& exec_space, const InViewType& in,
fft(exec_space, in, out, plan, norm, axis, n);
}

/// \brief Inverse of rfft
///
/// \param in [in] Kokkos execution space
/// \param in [in] Input data (complex)
/// \param out [out] Ouput data (real)
/// \param norm [in] How the normalization is applied (optional)
/// \param axis [in] Axis over which FFT is performed (optional)
/// \param n [in] Length of the transformed axis of the output (optional)
template <typename ExecutionSpace, typename InViewType, typename OutViewType>
void irfft(const ExecutionSpace& exec_space, const InViewType& in,
OutViewType& out,
Expand Down Expand Up @@ -555,6 +580,15 @@ void irfft(const ExecutionSpace& exec_space, const InViewType& in,
}
}

/// \brief Inverse of rfft with a given
///
/// \param in [in] Kokkos execution space
/// \param in [in] Input data (complex)
/// \param out [out] Ouput data (real)
/// \param in [in] KokkosFFT Plan for irfft
/// \param norm [in] How the normalization is applied (optional)
/// \param axis [in] Axis over which FFT is performed (optional)
/// \param n [in] Length of the transformed axis of the output (optional)
template <typename ExecutionSpace, typename InViewType, typename OutViewType,
typename PlanType>
void irfft(const ExecutionSpace& exec_space, const InViewType& in,
Expand Down Expand Up @@ -597,6 +631,14 @@ void irfft(const ExecutionSpace& exec_space, const InViewType& in,
}
}

/// \brief One dimensional FFT of a signal that has Hermitian symmetry
///
/// \param in [in] Kokkos execution space
/// \param in [in] Input data (complex)
/// \param out [out] Ouput data (real)
/// \param norm [in] How the normalization is applied (optional)
/// \param axis [in] Axis over which FFT is performed (optional)
/// \param n [in] Length of the transformed axis of the output (optional)
template <typename ExecutionSpace, typename InViewType, typename OutViewType>
void hfft(const ExecutionSpace& exec_space, const InViewType& in,
OutViewType& out,
Expand Down Expand Up @@ -645,6 +687,16 @@ void hfft(const ExecutionSpace& exec_space, const InViewType& in,
irfft(exec_space, in_conj, out, new_norm, axis, n);
}

/// \brief One dimensional FFT of a signal that has Hermitian symmetry with a
/// given plan
///
/// \param in [in] Kokkos execution space
/// \param in [in] Input data (complex)
/// \param out [out] Ouput data (real)
/// \param in [in] KokkosFFT Plan for hfft
/// \param norm [in] How the normalization is applied (optional)
/// \param axis [in] Axis over which FFT is performed (optional)
/// \param n [in] Length of the transformed axis of the output (optional)
template <typename ExecutionSpace, typename InViewType, typename OutViewType,
typename PlanType>
void hfft(const ExecutionSpace& exec_space, const InViewType& in,
Expand Down Expand Up @@ -694,6 +746,14 @@ void hfft(const ExecutionSpace& exec_space, const InViewType& in,
irfft(exec_space, in_conj, out, plan, new_norm, axis, n);
}

/// \brief Inverse of hfft
///
/// \param in [in] Kokkos execution space
/// \param in [in] Input data (real)
/// \param out [out] Ouput data (complex)
/// \param norm [in] How the normalization is applied (optional)
/// \param axis [in] Axis over which FFT is performed (optional)
/// \param n [in] Length of the transformed axis of the output (optional)
template <typename ExecutionSpace, typename InViewType, typename OutViewType>
void ihfft(const ExecutionSpace& exec_space, const InViewType& in,
OutViewType& out,
Expand Down Expand Up @@ -738,6 +798,15 @@ void ihfft(const ExecutionSpace& exec_space, const InViewType& in,
out = out_conj;
}

/// \brief Inverse of hfft with a given plan
///
/// \param in [in] Kokkos execution space
/// \param in [in] Input data (real)
/// \param out [out] Ouput data (complex)
/// \param in [in] KokkosFFT Plan for ihfft
/// \param norm [in] How the normalization is applied (optional)
/// \param axis [in] Axis over which FFT is performed (optional)
/// \param n [in] Length of the transformed axis of the output (optional)
template <typename ExecutionSpace, typename InViewType, typename OutViewType,
typename PlanType>
void ihfft(const ExecutionSpace& exec_space, const InViewType& in,
Expand Down

0 comments on commit f1e27a2

Please sign in to comment.