Skip to content

Commit

Permalink
Removed the test for non-type-template-parameters (NTTP) in source code.
Browse files Browse the repository at this point in the history
If the compiler does not support NTTP, an error is thrown now in `Macros,h`.
  • Loading branch information
Matthias Peschke committed Feb 3, 2024
1 parent f1ea42a commit 127b753
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions include/Xped/AD/ADTensor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ class Tensor<Scalar_, Rank, CoRank, Symmetry_, true, AllocationPolicy_>
return permute<shift, p...>(Bool<TRACK>{});
}

#if XPED_HAS_NTTP
template <auto a1,
auto a2,
std::size_t ResRank,
Expand Down Expand Up @@ -218,7 +217,6 @@ class Tensor<Scalar_, Rank, CoRank, Symmetry_, true, AllocationPolicy_>
other.template permute<shift2>(util::constFct::as_sequence<p2>(), Bool<TRACK>{}))
.template permute<shiftres>(util::constFct::as_sequence<pres>(), Bool<TRACK>{});
}
#endif

template <bool TRACK = true>
std::tuple<XTensor<TRACK, Scalar, Rank, 1, Symmetry, AllocationPolicy>,
Expand Down
2 changes: 0 additions & 2 deletions include/Xped/Core/Tensor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ class Tensor<Scalar_, Rank, CoRank, Symmetry_, false, AllocationPolicy_>
template <std::size_t... legs>
Tensor<Scalar, Rank, CoRank, Symmetry, false, AllocationPolicy> shiftQN(std::array<qType, sizeof...(legs)> charges) const;

#if XPED_HAS_NTTP
template <auto a1,
auto a2,
std::size_t ResRank,
Expand All @@ -346,7 +345,6 @@ class Tensor<Scalar_, Rank, CoRank, Symmetry_, false, AllocationPolicy_>
other.template permute<shift2>(util::constFct::as_sequence<p2>(), Bool<TRACK>{}))
.template permute<shiftres>(util::constFct::as_sequence<pres>(), Bool<TRACK>{});
}
#endif

std::tuple<Tensor<Scalar, Rank, 1, Symmetry, false, AllocationPolicy>,
Tensor<RealScalar, 1, 1, Symmetry, false, AllocationPolicy>,
Expand Down
2 changes: 0 additions & 2 deletions include/Xped/Util/Constfct.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ inline constexpr int posmod(int x)

inline constexpr int posmod(int x, int N) { return (x % N + N) % N; }

#if XPED_HAS_NTTP
template <auto a1, std::size_t rank1, auto a2, std::size_t rank2, std::size_t rankres>
consteval auto get_permutations()
{
Expand Down Expand Up @@ -121,6 +120,5 @@ auto as_sequence()
return as_sequence_impl<A>(Indices{});
}

#endif
} // namespace Xped::util::constFct
#endif
4 changes: 4 additions & 0 deletions include/Xped/Util/Macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ const std::string XPED_BLAS_STR = "None";
# endif
#endif

#ifndef XPED_HAS_NTTP
# error "Compiler has no non-type-template-parameter support"
#endif

#if __has_include("boost/functional/hash.hpp")
# define XPED_HAS_BOOST_HASH_COMBINE 1
#endif
Expand Down

0 comments on commit 127b753

Please sign in to comment.