1 #ifndef DASH__ALGORITHM__FILL_H__ 2 #define DASH__ALGORITHM__FILL_H__ 4 #include <dash/internal/Config.h> 6 #include <dash/iterator/GlobIter.h> 8 #include <dash/algorithm/LocalRange.h> 9 #include <dash/algorithm/Operation.h> 11 #include <dash/util/UnitLocality.h> 15 #ifdef DASH_ENABLE_OPENMP 34 template <
typename GlobIterType>
41 const typename GlobIterType::value_type & value)
43 typedef typename GlobIterType::index_type index_t;
44 typedef typename GlobIterType::value_type value_t;
48 value_t * lfirst = index_range.begin;
49 value_t * llast = index_range.end;
51 #ifdef DASH_ENABLE_OPENMP 54 auto nlocal = llast - lfirst;
55 DASH_LOG_DEBUG(
"dash::fill",
"thread capacity:", n_threads);
56 #pragma omp parallel for num_threads(n_threads) 57 for (index_t lt = 0; lt < nlocal; ++lt) {
68 #endif // DASH__ALGORITHM__FILL_H__ This class is a simple memory pool which holds allocates elements of size ValueType.
LocalRange< const typename GlobIterType::value_type > local_range(const GlobIterType &first, const GlobIterType &last)
Resolves the local address range between global iterators.
int num_domain_threads()
Number of threads currently available to the active unit.
void fill(GlobIterType first, GlobIterType last, const typename GlobIterType::value_type &value)
Assigns the given value to the elements in the range [first, last)
Wrapper of a single dart_unit_locality_t object.