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/StdIsPartitioned.html below:

is_partitioned - Kokkos documentation

is_partitioned

Header: <Kokkos_StdAlgorithms.hpp>

Description

Returns true if all elements in a range or in a rank-1 View satisfying the predicate pred appear before all elements that don’t. If the range or the view is empty, returns true.

Interface

Warning

This is currently inside the Kokkos::Experimental namespace.

Overload set accepting execution space
template <class ExecutionSpace, class InputIterator, class PredicateType>
bool is_partitioned(const ExecutionSpace& exespace,                              (1)
                    InputIterator first, InputIterator last,
                    PredicateType pred);

template <class ExecutionSpace, class InputIterator, class PredicateType>
bool is_partitioned(const std::string& label, const ExecutionSpace& exespace,    (2)
                    InputIterator first, InputIterator last,
                    PredicateType pred);

template <class ExecutionSpace, class DataType, class... Properties, class PredicateType>
auto is_partitioned(const ExecutionSpace& exespace,
                    const ::Kokkos::View<DataType, Properties...>& view,         (3)
                    PredicateType pred);

template <class ExecutionSpace, class DataType, class... Properties, class PredicateType>
auto is_partitioned(const std::string& label, const ExecutionSpace& exespace,
                    const ::Kokkos::View<DataType, Properties...>& view,         (4)
                    PredicateType pred);
Overload set accepting a team handle

Added in version 4.2.

template <class TeamHandleType, class IteratorType, class PredicateType>
KOKKOS_FUNCTION
bool is_partitioned(const TeamHandleType& teamHandle, IteratorType first,        (5)
                    IteratorType last, PredicateType pred);

template <class TeamHandleType, class PredicateType, class DataType,
          class... Properties>
KOKKOS_FUNCTION
bool is_partitioned(const TeamHandleType& teamHandle,                            (6)
                    const ::Kokkos::View<DataType, Properties...>& view,
                    PredicateType pred);
Parameters and Requirements Return Value Example
namespace KE = Kokkos::Experimental;

template<class ValueType>
struct IsNegative
{
  KOKKOS_INLINE_FUNCTION
  bool operator()(const ValueType & operand) const {
    constexpr auto zero = static_cast<ValueType>(0);
    return (operand < zero);
  }
};

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

auto exespace  = Kokkos::DefaultExecutionSpace;
const auto res = KE::is_partitioned(exespace, KE::cbegin(a), KE::cend(a), IsNegative<int>());

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