find_first_of#

Header File: Kokkos_StdAlgorithms.hpp

namespace Kokkos{
namespace Experimental{

template <class ExecutionSpace, class IteratorType1, class IteratorType2>
IteratorType1 find_first_of(const ExecutionSpace& exespace, IteratorType1 first,
                            IteratorType1 last, IteratorType2 s_first,               (1)
                            IteratorType2 s_last);

template <class ExecutionSpace, class IteratorType1, class IteratorType2>
IteratorType1 find_first_of(const std::string& label, const ExecutionSpace& exespace,
                            IteratorType1 first, IteratorType1 last,                 (2)
                            IteratorType2 s_first, IteratorType2 s_last);

template <class ExecutionSpace, class DataType1, class... Properties1,
          class DataType2, class... Properties2>
auto find_first_of(const ExecutionSpace& exespace,
                   const ::Kokkos::View<DataType1, Properties1...>& view,            (3)
                   const ::Kokkos::View<DataType2, Properties2...>& s_view);

template <class ExecutionSpace, class DataType1, class... Properties1,
          class DataType2, class... Properties2>
auto find_first_of(const std::string& label, const ExecutionSpace& exespace,
                   const ::Kokkos::View<DataType1, Properties1...>& view,            (4)
                   const ::Kokkos::View<DataType2, Properties2...>& s_view);

// overload set 2: binary predicate passed
template <class ExecutionSpace, class IteratorType1, class IteratorType2,
          class BinaryPredicateType>
IteratorType1 find_first_of(const ExecutionSpace& exespace, IteratorType1 first,
                            IteratorType1 last, IteratorType2 s_first,               (5)
                            IteratorType2 s_last,
                            const BinaryPredicateType& pred);

template <class ExecutionSpace, class IteratorType1, class IteratorType2,
          class BinaryPredicateType>
IteratorType1 find_first_of(const std::string& label, const ExecutionSpace& exespace,
                            IteratorType1 first, IteratorType1 last,                 (6)
                            IteratorType2 s_first, IteratorType2 s_last,
                            const BinaryPredicateType& pred);

template <class ExecutionSpace, class DataType1, class... Properties1,
          class DataType2, class... Properties2, class BinaryPredicateType>
auto find_first_of(const ExecutionSpace& exespace,
                   const ::Kokkos::View<DataType1, Properties1...>& view,            (7)
                   const ::Kokkos::View<DataType2, Properties2...>& s_view,
                   const BinaryPredicateType& pred);

template <class ExecutionSpace, class DataType1, class... Properties1,
          class DataType2, class... Properties2, class BinaryPredicateType>
auto find_first_of(const std::string& label, const ExecutionSpace& exespace,
                   const ::Kokkos::View<DataType1, Properties1...>& view,            (8)
                   const ::Kokkos::View<DataType2, Properties2...>& s_view,
                   const BinaryPredicateType& pred);

} //end namespace Experimental
} //end namespace Kokkos

Description#

  • 1,2,5,6: searches the range [first, last) for any of the elements in the range [s_first, s_last) comparing elements via operator == (1,2) or via pred (5,6)

  • 3,4,7,8: searches view for any of the elements in s_view comparing elements via operator == (3,4) or via pred (7,8)

Parameters and Requirements#

  • exespace, first, last, view and count similar to for_each_n.

  • label:

    • 1,5: The default string is “Kokkos::find_first_of_iterator_api_default”.

    • 3,7: The default string is “”Kokkos::find_first_of_view_api_default”.

  • pred - similar to equal