Skip to content

Commit

Permalink
Replaced is_equal in TestArray, as operator== provides the same
Browse files Browse the repository at this point in the history
functionality.
  • Loading branch information
nliber committed Jul 22, 2024
1 parent c0f388b commit c0f6297
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions core/unit_test/TestArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,14 @@ KOKKOS_FUNCTION constexpr bool test_array_structured_binding_support() {

static_assert(test_array_structured_binding_support());

template <typename L, typename R>
KOKKOS_FUNCTION constexpr bool is_equal(L const& l, R const& r) {
if (l.size() != r.size()) return false;

for (size_t i = 0; i != l.size(); ++i) {
if (l[i] != r[i]) return false;
}

return true;
}

// Disable ctad test for intel versions < 2021, see issue #6702
#if !defined(KOKKOS_COMPILER_INTEL) || KOKKOS_COMPILER_INTEL >= 2021
KOKKOS_FUNCTION constexpr bool test_array_ctad() {
constexpr int x = 10;
constexpr Kokkos::Array a{1, 2, 3, 5, x};
constexpr Kokkos::Array<int, 5> b{1, 2, 3, 5, x};

return std::is_same_v<decltype(a), decltype(b)> && is_equal(a, b);
return std::is_same_v<decltype(a), decltype(b)> && a == b;
}

static_assert(test_array_ctad());
Expand Down

0 comments on commit c0f6297

Please sign in to comment.