find_if_not¶
Header: <Kokkos_StdAlgorithms.hpp>
Description¶
Returns an iterator to the first element in a range or a View for
which a custom predicate returns false.
Interface¶
Warning
This is currently inside the Kokkos::Experimental namespace.
Overload set accepting execution space¶
template <class ExecutionSpace, class InputIterator, class PredicateType>
InputIterator find_if_not(const ExecutionSpace& exespace, (1)
InputIterator first, InputIterator last,
PredicateType pred);
template <class ExecutionSpace, class InputIterator, class PredicateType>
InputIterator find_if_not(const std::string& label, const ExecutionSpace& exespace, (2)
InputIterator first, InputIterator last,
PredicateType pred);
template <class ExecutionSpace, class DataType, class... Properties, class PredicateType>
auto find_if_not(const ExecutionSpace& exespace, (3)
const Kokkos::View<DataType, Properties...>& view,
PredicateType pred);
template <class ExecutionSpace, class DataType, class... Properties, class PredicateType>
auto find_if_not(const std::string& label, const ExecutionSpace& exespace, (4)
const Kokkos::View<DataType, Properties...>& view,
PredicateType pred);
Overload set accepting a team handle¶
Added in version 4.2.
template <class TeamHandleType, class InputIterator, class PredicateType>
KOKKOS_FUNCTION
InputIterator find_if_not(const TeamHandleType& teamHandle, (5)
InputIterator first, InputIterator last,
PredicateType pred);
template <class TeamHandleType, class DataType, class... Properties, class PredicateType>
KOKKOS_FUNCTION
auto find_if_not(const TeamHandleType& teamHandle, (6)
const Kokkos::View<DataType, Properties...>& view,
PredicateType pred);
Parameters and Requirements¶
exespace: execution space instanceteamHandle: team handle instance given inside a parallel region when using a TeamPolicylabel: string forwarded to internal parallel kernels for debugging purposesfor 1, the default string is: “Kokkos::find_if_not_iterator_api_default”
for 3, the default string is: “Kokkos::find_if_not_view_api_default”
NOTE: overloads accepting a team handle do not use a label internally
first, last: range of elements to search inmust be random access iterators, e.g., returned from
Kokkos::Experimental::(c)begin/(c)endmust represent a valid range, i.e.,
last >= firstmust be accessible from
exespaceor from the execution space associated with the team handle
view: view to search inmust be rank-1, and have
LayoutLeft,LayoutRight, orLayoutStridemust be accessible from
exespaceor from the execution space associated with the team handle
pred: unary predicate which returnsfalsefor the required element;pred(a)must be valid to be called from the execution space passed, or the execution space associated with the team handle, and convertible to bool for every argumentaof type (possible const)value_type, wherevalue_typeis the value type ofInputIteratororview, and must not modifya.must conform to:
struct Predicate { KOKKOS_INLINE_FUNCTION bool operator()(const /*type needed */ & operand) const { return /* ... */; } // or, also valid KOKKOS_INLINE_FUNCTION bool operator()(/*type needed */ operand) const { return /* ... */; } };
Return Value¶
(1,2,5):
InputIteratorinstance pointing to the first element where the predicate evaluates tofalse, orlastif no such element is found(3,4,6): iterator to the first element where the predicate evaluates to
false, orKokkos::Experimental::end(view)if no such element is found