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 KokkosDescription¶
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).
exespace
, first
, view
, value
: same as in fill
label
:
used to name the implementation kernels for debugging purposes
for 1, the default string is: “Kokkos::fill_n_iterator_api_default”
for 3, the default string is: “Kokkos::fill_n_view_api_default”
n
:
number of elements to modify (must be non-negative)
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).
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