Skip to content

Commit

Permalink
docs: Add default explanations for APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuuichi Asahi committed Oct 1, 2024
1 parent 25469cd commit 93d0b77
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 49 deletions.
8 changes: 4 additions & 4 deletions common/src/KokkosFFT_Helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ namespace KokkosFFT {
///
/// \param exec_space [in] Kokkos execution space
/// \param n [in] Window length
/// \param d [in] Sample spacing
/// \param d [in] Sample spacing (default, 1)
///
/// \return Sampling frequency
template <typename ExecutionSpace, typename RealType>
Expand Down Expand Up @@ -186,7 +186,7 @@ auto fftfreq(const ExecutionSpace&, const std::size_t n,
///
/// \param exec_space [in] Kokkos execution space
/// \param n [in] Window length
/// \param d [in] Sample spacing
/// \param d [in] Sample spacing (default, 1)
///
/// \return Sampling frequency starting from zero
template <typename ExecutionSpace, typename RealType>
Expand Down Expand Up @@ -215,7 +215,7 @@ auto rfftfreq(const ExecutionSpace&, const std::size_t n,
///
/// \param exec_space [in] Kokkos execution space
/// \param inout [in,out] Spectrum
/// \param axes [in] Axes over which to shift, optional
/// \param axes [in] Axes over which to shift (default, nullopt)
template <typename ExecutionSpace, typename ViewType>
void fftshift(const ExecutionSpace& exec_space, ViewType& inout,
std::optional<int> axes = std::nullopt) {
Expand Down Expand Up @@ -264,7 +264,7 @@ void fftshift(const ExecutionSpace& exec_space, ViewType& inout,
///
/// \param exec_space [in] Kokkos execution space
/// \param inout [in,out] Spectrum
/// \param axes [in] Axes over which to shift, optional
/// \param axes [in] Axes over which to shift (default, nullopt)
template <typename ExecutionSpace, typename ViewType>
void ifftshift(const ExecutionSpace& exec_space, ViewType& inout,
std::optional<int> axes = std::nullopt) {
Expand Down
7 changes: 4 additions & 3 deletions fft/src/KokkosFFT_Plans.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ class Plan {
/// \param out [in] Ouput data
/// \param direction [in] Direction of FFT (forward/backward)
/// \param axis [in] Axis over which FFT is performed
/// \param n [in] Length of the transformed axis of the output (optional)
/// \param n [in] Length of the transformed axis of the output (default,
/// nullopt)
//
explicit Plan(const ExecutionSpace& exec_space, InViewType& in,
OutViewType& out, KokkosFFT::Direction direction, int axis,
Expand Down Expand Up @@ -211,11 +212,11 @@ class Plan {
/// \param out [in] Ouput data
/// \param direction [in] Direction of FFT (forward/backward)
/// \param axes [in] Axes over which FFT is performed
/// \param s [in] Shape of the transformed axis of the output (optional)
/// \param s [in] Shape of the transformed axis of the output (default, {})
//
explicit Plan(const ExecutionSpace& exec_space, InViewType& in,
OutViewType& out, KokkosFFT::Direction direction,
axis_type<DIM> axes, shape_type<DIM> s = {0})
axis_type<DIM> axes, shape_type<DIM> s = {})
: m_exec_space(exec_space), m_axes(axes), m_direction(direction) {
static_assert(KokkosFFT::Impl::is_AllowedSpace_v<ExecutionSpace>,
"Plan::Plan: ExecutionSpace is not allowed ");
Expand Down
90 changes: 48 additions & 42 deletions fft/src/KokkosFFT_Transform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,10 @@ namespace KokkosFFT {
/// \param exec_space [in] Kokkos execution space
/// \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)
/// \param norm [in] How the normalization is applied (default, backward)
/// \param axis [in] Axis over which FFT is performed (default, -1)
/// \param n [in] Length of the transformed axis of the output (default,
/// nullopt)
template <typename ExecutionSpace, typename InViewType, typename OutViewType>
void fft(const ExecutionSpace& exec_space, const InViewType& in,
OutViewType& out,
Expand All @@ -152,9 +153,10 @@ void fft(const ExecutionSpace& exec_space, const InViewType& in,
/// \param exec_space [in] Kokkos execution space
/// \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)
/// \param norm [in] How the normalization is applied (default, backward)
/// \param axis [in] Axis over which FFT is performed (default, -1)
/// \param n [in] Length of the transformed axis of the output (default,
/// nullopt)
template <typename ExecutionSpace, typename InViewType, typename OutViewType>
void ifft(const ExecutionSpace& exec_space, const InViewType& in,
OutViewType& out,
Expand All @@ -181,9 +183,10 @@ void ifft(const ExecutionSpace& exec_space, const InViewType& in,
/// \param exec_space [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)
/// \param norm [in] How the normalization is applied (default, backward)
/// \param axis [in] Axis over which FFT is performed (default, -1)
/// \param n [in] Length of the transformed axis of the output (default,
/// nullopt)
template <typename ExecutionSpace, typename InViewType, typename OutViewType>
void rfft(const ExecutionSpace& exec_space, const InViewType& in,
OutViewType& out,
Expand Down Expand Up @@ -216,9 +219,10 @@ void rfft(const ExecutionSpace& exec_space, const InViewType& in,
/// \param exec_space [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)
/// \param norm [in] How the normalization is applied (default, backward)
/// \param axis [in] Axis over which FFT is performed (default, -1)
/// \param n [in] Length of the transformed axis of the output (default,
/// nullopt)
template <typename ExecutionSpace, typename InViewType, typename OutViewType>
void irfft(const ExecutionSpace& exec_space, const InViewType& in,
OutViewType& out,
Expand Down Expand Up @@ -252,9 +256,10 @@ void irfft(const ExecutionSpace& exec_space, const InViewType& in,
/// \param exec_space [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)
/// \param norm [in] How the normalization is applied (default, backward)
/// \param axis [in] Axis over which FFT is performed (default, -1)
/// \param n [in] Length of the transformed axis of the output (default,
/// nullopt)
template <typename ExecutionSpace, typename InViewType, typename OutViewType>
void hfft(const ExecutionSpace& exec_space, const InViewType& in,
OutViewType& out,
Expand Down Expand Up @@ -295,9 +300,10 @@ void hfft(const ExecutionSpace& exec_space, const InViewType& in,
/// \param exec_space [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)
/// \param norm [in] How the normalization is applied (default, backward)
/// \param axis [in] Axis over which FFT is performed (default, -1)
/// \param n [in] Length of the transformed axis of the output (default,
/// nullopt)
template <typename ExecutionSpace, typename InViewType, typename OutViewType>
void ihfft(const ExecutionSpace& exec_space, const InViewType& in,
OutViewType& out,
Expand Down Expand Up @@ -336,14 +342,14 @@ void ihfft(const ExecutionSpace& exec_space, const InViewType& in,
/// \param exec_space [in] Kokkos execution space
/// \param in [in] Input data (complex)
/// \param out [out] Ouput data (complex)
/// \param norm [in] How the normalization is applied (optional)
/// \param axes [in] Axes over which FFT is performed (optional)
/// \param s [in] Shape of the transformed axis of the output (optional)
/// \param norm [in] How the normalization is applied (default, backward)
/// \param axes [in] Axes over which FFT is performed (default, {-2, -1})
/// \param s [in] Shape of the transformed axis of the output (default, {})
template <typename ExecutionSpace, typename InViewType, typename OutViewType>
void fft2(const ExecutionSpace& exec_space, const InViewType& in,
OutViewType& out,
KokkosFFT::Normalization norm = KokkosFFT::Normalization::backward,
axis_type<2> axes = {-2, -1}, shape_type<2> s = {0}) {
axis_type<2> axes = {-2, -1}, shape_type<2> s = {}) {
static_assert(
KokkosFFT::Impl::are_operatable_views_v<ExecutionSpace, InViewType,
OutViewType>,
Expand All @@ -365,14 +371,14 @@ void fft2(const ExecutionSpace& exec_space, const InViewType& in,
/// \param exec_space [in] Kokkos execution space
/// \param in [in] Input data (complex)
/// \param out [out] Ouput data (complex)
/// \param norm [in] How the normalization is applied (optional)
/// \param axes [in] Axes over which FFT is performed (optional)
/// \param s [in] Shape of the transformed axis of the output (optional)
/// \param norm [in] How the normalization is applied (default, backward)
/// \param axes [in] Axes over which FFT is performed (default, {-2, -1})
/// \param s [in] Shape of the transformed axis of the output (default, {})
template <typename ExecutionSpace, typename InViewType, typename OutViewType>
void ifft2(const ExecutionSpace& exec_space, const InViewType& in,
OutViewType& out,
KokkosFFT::Normalization norm = KokkosFFT::Normalization::backward,
axis_type<2> axes = {-2, -1}, shape_type<2> s = {0}) {
axis_type<2> axes = {-2, -1}, shape_type<2> s = {}) {
static_assert(
KokkosFFT::Impl::are_operatable_views_v<ExecutionSpace, InViewType,
OutViewType>,
Expand All @@ -395,14 +401,14 @@ void ifft2(const ExecutionSpace& exec_space, const InViewType& in,
/// \param exec_space [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 axes [in] Axes over which FFT is performed (optional)
/// \param s [in] Shape of the transformed axis of the output (optional)
/// \param norm [in] How the normalization is applied (default, backward)
/// \param axes [in] Axes over which FFT is performed (default, {-2, -1})
/// \param s [in] Shape of the transformed axis of the output (default, {})
template <typename ExecutionSpace, typename InViewType, typename OutViewType>
void rfft2(const ExecutionSpace& exec_space, const InViewType& in,
OutViewType& out,
KokkosFFT::Normalization norm = KokkosFFT::Normalization::backward,
axis_type<2> axes = {-2, -1}, shape_type<2> s = {0}) {
axis_type<2> axes = {-2, -1}, shape_type<2> s = {}) {
static_assert(
KokkosFFT::Impl::are_operatable_views_v<ExecutionSpace, InViewType,
OutViewType>,
Expand Down Expand Up @@ -431,14 +437,14 @@ void rfft2(const ExecutionSpace& exec_space, const InViewType& in,
/// \param exec_space [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 axes [in] Axes over which FFT is performed (optional)
/// \param s [in] Shape of the transformed axis of the output (optional)
/// \param norm [in] How the normalization is applied (default, backward)
/// \param axes [in] Axes over which FFT is performed (default, {-2, -1})
/// \param s [in] Shape of the transformed axis of the output (default, {})
template <typename ExecutionSpace, typename InViewType, typename OutViewType>
void irfft2(const ExecutionSpace& exec_space, const InViewType& in,
OutViewType& out,
KokkosFFT::Normalization norm = KokkosFFT::Normalization::backward,
axis_type<2> axes = {-2, -1}, shape_type<2> s = {0}) {
axis_type<2> axes = {-2, -1}, shape_type<2> s = {}) {
static_assert(
KokkosFFT::Impl::are_operatable_views_v<ExecutionSpace, InViewType,
OutViewType>,
Expand Down Expand Up @@ -470,8 +476,8 @@ void irfft2(const ExecutionSpace& exec_space, const InViewType& in,
/// \param in [in] Input data (complex)
/// \param out [out] Ouput data (complex)
/// \param axes [in] Axes over which FFT is performed (default, all axes)
/// \param norm [in] How the normalization is applied (optional)
/// \param s [in] Shape of the transformed axis of the output (optional)
/// \param norm [in] How the normalization is applied (default, backward)
/// \param s [in] Shape of the transformed axis of the output (default, {})
#if defined(DOXY)
template <typename ExecutionSpace, typename InViewType, typename OutViewType,
std::size_t DIM>
Expand Down Expand Up @@ -510,8 +516,8 @@ void fftn(
/// \param in [in] Input data (complex)
/// \param out [out] Ouput data (complex)
/// \param axes [in] Axes over which FFT is performed (default, all axes)
/// \param norm [in] How the normalization is applied (optional)
/// \param s [in] Shape of the transformed axis of the output (optional)
/// \param norm [in] How the normalization is applied (default, backward)
/// \param s [in] Shape of the transformed axis of the output (default, {})
#if defined(DOXY)
template <typename ExecutionSpace, typename InViewType, typename OutViewType,
std::size_t DIM>
Expand Down Expand Up @@ -552,8 +558,8 @@ void ifftn(
/// \param in [in] Input data (real)
/// \param out [out] Ouput data (complex)
/// \param axes [in] Axes over which FFT is performed (default, all axes)
/// \param norm [in] How the normalization is applied (optional)
/// \param s [in] Shape of the transformed axis of the output (optional)
/// \param norm [in] How the normalization is applied (default, backward)
/// \param s [in] Shape of the transformed axis of the output (default, {})
#if defined(DOXY)
template <typename ExecutionSpace, typename InViewType, typename OutViewType,
std::size_t DIM>
Expand Down Expand Up @@ -600,8 +606,8 @@ void rfftn(
/// \param in [in] Input data (complex)
/// \param out [out] Ouput data (real)
/// \param axes [in] Axes over which FFT is performed (default, all axes)
/// \param norm [in] How the normalization is applied (optional)
/// \param s [in] Shape of the transformed axis of the output (optional)
/// \param norm [in] How the normalization is applied (default, backward)
/// \param s [in] Shape of the transformed axis of the output (default, {})
#if defined(DOXY)
template <typename ExecutionSpace, typename InViewType, typename OutViewType,
std::size_t DIM>
Expand Down

0 comments on commit 93d0b77

Please sign in to comment.