Skip to content

File getfloattype.h

File List > algebra > helpers > getfloattype.h

Go to the documentation of this file

#ifndef TEMPLAT_LATTICE_ALGEBRA_HELPERS_GETFLOATTYPE_H
#define TEMPLAT_LATTICE_ALGEBRA_HELPERS_GETFLOATTYPE_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): Wessel Valkenburg, Year: 2019

#include "TempLat/parallel/device.h"

namespace TempLat
{
  template <typename T> struct GetFloatType {
  };

  template <typename F>
    requires std::is_arithmetic_v<F>
  struct GetFloatType<F> {
    using type = F;
  };
  template <typename F> struct GetFloatType<complex<F>> {
    using type = F;
  };

  template <typename T, size_t N> struct GetFloatType<device::array<T, N>> {
    using type = typename GetFloatType<T>::type;
  };
} // namespace TempLat

#endif