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

replace - Kokkos documentation

Toggle table of contents sidebar

replace

Header File: Kokkos_StdAlgorithms.hpp

namespace Kokkos{
namespace Experimental{

template <class ExecutionSpace, class IteratorType, class T>
void replace(const ExecutionSpace& exespace,                                 (1)
             IteratorType first, IteratorType last,
             const T& old_value, const T& new_value);

template <class ExecutionSpace, class IteratorType, class T>
void replace(const std::string& label, const ExecutionSpace& exespace,       (2)
             IteratorType first, IteratorType last,
             const T& old_value, const T& new_value);

template <class ExecutionSpace, class DataType, class... Properties, class T>
void replace(const ExecutionSpace& exespace,                                 (3)
             const Kokkos::View<DataType, Properties...>& view,
             const T& old_value, const T& new_value);

template <class ExecutionSpace, class DataType, class... Properties, class T>
void replace(const std::string& label, const ExecutionSpace& exespace,       (4)
             const Kokkos::View<DataType, Properties...>& view,
             const T& old_value, const T& new_value);

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

Replaces with new_value all elements that are equal to old_value in the range [first, last) (overloads 1,2) or in view (overloads 3,4). Equality is checked using operator==.

Parameters and Requirements Return

None

Example
namespace KE = Kokkos::Experimental;
Kokkos::View<double*> a("a", 13);
// do something with a
// ...

const double oldValue{2};
const double newValue{34};
KE::replace(Kokkos::DefaultExecutionSpace(), KE::begin(a), KE::end(a), oldValue, newValue);

// explicitly set label and execution space (assuming active)
KE::replace("mylabel", Kokkos::OpenMP(), a, oldValue, newValue);

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