A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://kokkos.github.io/kokkos-core-wiki/API/algorithms/std-algorithms/all/StdEqual.html below:

equal - Kokkos documentation

equal

Header: <Kokkos_StdAlgorithms.hpp>

Description

Returns true if two ranges or two rank-1 View s are equal.

Interface

Warning

This is currently inside the Kokkos::Experimental namespace.

Overload set accepting execution space
template <class ExecutionSpace, class IteratorType1, class IteratorType2>
bool equal(const ExecutionSpace& exespace,                                        (1)
           IteratorType1 first1, IteratorType1 last1,
           IteratorType2 first2);

template <class ExecutionSpace, class IteratorType1, class IteratorType2>
bool equal(const std::string& label, const ExecutionSpace& exespace,              (2)
           IteratorType1 first1, IteratorType1 last1,
           IteratorType2 first2);

template <class ExecutionSpace, class IteratorType1, class IteratorType2,
          class BinaryPredicateType>
bool equal(const ExecutionSpace& exespace,                                        (3)
           IteratorType1 first1, IteratorType1 last1,
           IteratorType2 first2,
           BinaryPredicateType predicate);

template <class ExecutionSpace, class IteratorType1, class IteratorType2,
          class BinaryPredicateType>
bool equal(const std::string& label, const ExecutionSpace& exespace,              (4)
           IteratorType1 first1, IteratorType1 last1,
           IteratorType2 first2,
           BinaryPredicateType predicate);

template <class ExecutionSpace, class IteratorType1, class IteratorType2>
bool equal(const ExecutionSpace& exespace, IteratorType1 first1,                  (5)
           IteratorType1 last1, IteratorType2 first2,
           IteratorType2 last2);

template <class ExecutionSpace, class IteratorType1, class IteratorType2>
bool equal(const std::string& label, const ExecutionSpace& exespace,              (6)
           IteratorType1 first1, IteratorType1 last1,
           IteratorType2 first2, IteratorType2 last2);

template <class ExecutionSpace, class IteratorType1, class IteratorType2,
          class BinaryPredicateType>
bool equal(const ExecutionSpace& exespace,                                        (7)
           IteratorType1 first1, IteratorType1 last1,
           IteratorType2 first2, IteratorType2 last2,
           BinaryPredicateType predicate);

template <class ExecutionSpace, class IteratorType1, class IteratorType2,
          class BinaryPredicateType>
bool equal(const std::string& label, const ExecutionSpace& exespace,              (8)
           IteratorType1 first1, IteratorType1 last1,
           IteratorType2 first2, IteratorType2 last2,
           BinaryPredicateType predicate);

template <class ExecutionSpace, class DataType1, class... Properties1,
          class DataType2, class... Properties2>
bool equal(const ExecutionSpace& exespace,                                        (9)
           const Kokkos::View<DataType1, Properties1...>& view1,
           const Kokkos::View<DataType2, Properties2...>& view2);

template <class ExecutionSpace, class DataType1, class... Properties1,
          class DataType2, class... Properties2>
bool equal(const std::string& label, const ExecutionSpace& exespace,             (10)
           const Kokkos::View<DataType1, Properties1...>& view1,
           const Kokkos::View<DataType2, Properties2...>& view2);

template <class ExecutionSpace, class DataType1, class... Properties1,
          class DataType2, class... Properties2, class BinaryPredicate>
bool equal(const ExecutionSpace& exespace,                                       (11)
           const Kokkos::View<DataType1, Properties1...>& view1,
           const Kokkos::View<DataType2, Properties2...>& view2,
           BinaryPredicate pred);

template <class ExecutionSpace, class DataType1, class... Properties1,
          class DataType2, class... Properties2, class BinaryPredicate>
bool equal(const std::string& label, const ExecutionSpace& exespace,             (12)
           const Kokkos::View<DataType1, Properties1...>& view1,
           const Kokkos::View<DataType2, Properties2...>& view2,
           BinaryPredicate pred);
Overload set accepting a team handle

Added in version 4.2.

template <class TeamHandleType, class IteratorType1, class IteratorType2>
KOKKOS_FUNCTION
bool equal(const TeamHandleType& teamHandle,                                     (13)
           IteratorType1 first1, IteratorType1 last1,
           IteratorType2 first2);

template <class TeamHandleType, class IteratorType1, class IteratorType2,
          class BinaryPredicateType>
KOKKOS_FUNCTION
bool equal(const TeamHandleType& teamHandle,                                     (14)
           IteratorType1 first1, IteratorType1 last1,
           IteratorType2 first2,
           BinaryPredicateType predicate);

template <class TeamHandleType, class IteratorType1, class IteratorType2>
KOKKOS_FUNCTION
bool equal(const TeamHandleType& teamHandle,                                     (15)
           IteratorType1 first1, IteratorType1 last1,
           IteratorType2 first2, IteratorType2 last2);

template <class TeamHandleType, class IteratorType1, class IteratorType2,
          class BinaryPredicateType>
KOKKOS_FUNCTION
bool equal(const TeamHandleType& teamHandle,                                     (16)
           IteratorType1 first1, IteratorType1 last1,
           IteratorType2 first2, IteratorType2 last2,
           BinaryPredicateType predicate);

template <class TeamHandleType, class DataType1, class... Properties1,
          class DataType2, class... Properties2>
KOKKOS_FUNCTION
bool equal(const TeamHandleType& teamHandle,                                     (17)
           const Kokkos::View<DataType1, Properties1...>& view1,
           const Kokkos::View<DataType2, Properties2...>& view2);

template <class TeamHandleType, class DataType1, class... Properties1,
          class DataType2, class... Properties2, class BinaryPredicate>
KOKKOS_FUNCTION
bool equal(const TeamHandleType& teamHandle,                                     (18)
           const Kokkos::View<DataType1, Properties1...>& view1,
           const Kokkos::View<DataType2, Properties2...>& view2,
           BinaryPredicate pred);
Overload Set Detailed Description Parameters and Requirements Return Value

If the elements of the two ranges or Views are equal, returns true, otherwise false.

Corner cases when false is returned:

Example
namespace KE = Kokkos::Experimental;

template <class ValueType1, class ValueType2 = ValueType1>
struct IsEqualFunctor {
  KOKKOS_INLINE_FUNCTION
  bool operator()(const ValueType1& a, const ValueType2& b) const {
    return (a == b);
  }
};

auto exespace = Kokkos::DefaultExecutionSpace;
using view_type = Kokkos::View<exespace, int*>;
view_type a("a", 15);
view_type b("b", 15);
// fill a,b somehow

// create functor
IsEqualFunctor<int,int> p();

bool isEqual = KE::equal(exespace, KE::begin(a), KE::end(a),
                         KE::begin(b), KE::end(b) p);

// To run explicitly on the host (assuming a and b are accessible on Host)
bool isEqual = KE::equal(Kokkos::DefaultHostExecutionSpace(), KE::begin(a), KE::end(a),
                         KE::begin(b), KE::end(b), p);

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4