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

fill_n - Kokkos documentation

Toggle table of contents sidebar

fill_n

Header File: Kokkos_StdAlgorithms.hpp

namespace Kokkos{
namespace Experimental{

template <class ExecutionSpace, class IteratorType, class SizeType, class T>
IteratorType fill_n(const ExecutionSpace& exespace,                             (1)
                    IteratorType first,
                    SizeType n, const T& value);

template <class ExecutionSpace, class IteratorType, class SizeType, class T>
IteratorType fill_n(const std::string& label, const ExecutionSpace& exespace,   (2)
                    IteratorType first,
                    SizeType n, const T& value);

template <class ExecutionSpace, class DataType, class... Properties, class SizeType, class T>
auto fill_n(const ExecutionSpace& exespace,                                     (3)
            const Kokkos::View<DataType, Properties...>& view,
            SizeType n, const T& value);

template <class ExecutionSpace, class DataType, class... Properties, class SizeType, class T>
auto fill_n(const std::string& label, const ExecutionSpace& exespace,           (4)
            const Kokkos::View<DataType, Properties...>& view,
            SizeType n, const T& value);

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

Copy-assigns value to the first n elements in the range starting at first (overloads 1,2) or the first n elements in view (overloads 3,4).

Parameters and Requirements Return

If n > 0, returns an iterator to the element after the last element assigned.

Otherwise, it returns first (for 1,2) or Kokkos::begin(view) (for 3,4).

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

const double newValue{4};
KE::fill_n(Kokkos::DefaultExecutionSpace(), KE::begin(a), 10, newValue);

// passing the view directly
KE::fill_n(Kokkos::DefaultExecutionSpace(), a, 10, newValue);

// explicitly set execution space (assuming active)
KE::fill_n(Kokkos::OpenMP(), KE::begin(a), 10, 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