Skip to content

File kokkosffttranspositionflags.h

File List > code_source > templat > include > TempLat > fft > external > kokkosfft > kokkosffttranspositionflags.h

Go to the documentation of this file

#ifndef TEMPLAT_FFT_EXTERNAL_KOKKOSFFT_KOKKOSFFTTRANSPOSITIONFLAGS_H
#define TEMPLAT_FFT_EXTERNAL_KOKKOSFFT_KOKKOSFFTTRANSPOSITIONFLAGS_H

/* This file is part of TempLat, available at https://cosmolattice.github.io/templat .
   Copyright 2021-2026 The TempLat authors, see AUTHORS.md.
   Released under the MIT license, see LICENSE.md. */

// File info: Main contributor(s): Franz R. Sattler, Year: 2025

#ifndef NOFFT
#ifdef HAVE_KOKKOSFFT
#include <KokkosFFT.hpp>
#endif
#endif

#include "TempLat/fft/fftlibraryinterface.h"

namespace TempLat
{

  template <size_t NDim> class KokkosFFTTranspositionFlags
  {
  public:
    // Put public methods here. These should change very little over time.
    KokkosFFTTranspositionFlags(const FFTLayoutStruct<NDim> &layout)
    {
      // bool transposedC = layout.fourierSpace.isTransposed();
      // bool transposedR = layout.configurationSpace.isTransposed();

      // mFlagC2R = (transposedC ? KOKKOSFFT_TRANSPOSED_IN : 0) | (transposedR ? KOKKOSFFT_TRANSPOSED_OUT : 0);

      // mFlagR2C = (transposedC ? KOKKOSFFT_TRANSPOSED_OUT : 0) | (transposedR ? KOKKOSFFT_TRANSPOSED_IN : 0);
    }

    unsigned int c2r() { return mFlagC2R; }
    unsigned int r2c() { return mFlagR2C; }

    friend std::ostream &operator<<(std::ostream &ostream, const KokkosFFTTranspositionFlags &tr)
    {
      ostream << "C2R : "
              //       << ((tr.mFlagC2R & KOKKOSFFT_TRANSPOSED_IN)    ? " transposed in"
              //          : (tr.mFlagC2R & KOKKOSFFT_TRANSPOSED_OUT) ? "transposed out"
              //                                                 : "not transposed")
              << ".\n";
      ostream << "R2C : "
              //    << ((tr.mFlagR2C & KOKKOSFFT_TRANSPOSED_IN)    ? " transposed in"
              //       : (tr.mFlagR2C & KOKKOSFFT_TRANSPOSED_OUT) ? "transposed out"
              //                                              : "not transposed")
              << ".\n";
      return ostream;
    }

  private:
    /* Put all member variables and private methods here. These may change arbitrarily. */
    unsigned int mFlagC2R;
    unsigned int mFlagR2C;
  };

} // namespace TempLat

#endif