Permalink
Browse files

Use `unwrap` and `unwrapping` in the core library

  • Loading branch information...
Naios committed Jul 5, 2017
1 parent 1ba82ee commit b6545ba263d3eace3c8eb051141400de7942a1bf
Showing with 62 additions and 62 deletions.
  1. +1 −1 hpx/compute/host/block_executor.hpp
  2. +1 −1 hpx/include/util.hpp
  3. +1 −1 hpx/parallel/algorithms/copy.hpp
  4. +3 −3 hpx/parallel/algorithms/count.hpp
  5. +2 −2 hpx/parallel/algorithms/exclusive_scan.hpp
  6. +2 −2 hpx/parallel/algorithms/inclusive_scan.hpp
  7. +3 −3 hpx/parallel/algorithms/minmax.hpp
  8. +1 −1 hpx/parallel/algorithms/partition.hpp
  9. +2 −2 hpx/parallel/algorithms/reduce.hpp
  10. +1 −1 hpx/parallel/algorithms/rotate.hpp
  11. +1 −1 hpx/parallel/algorithms/transform_exclusive_scan.hpp
  12. +1 −1 hpx/parallel/algorithms/transform_inclusive_scan.hpp
  13. +2 −2 hpx/parallel/algorithms/transform_reduce.hpp
  14. +1 −1 hpx/parallel/algorithms/unique.hpp
  15. +2 −2 hpx/parallel/executors/execution.hpp
  16. +1 −1 hpx/parallel/executors/executor_information_traits.hpp
  17. +3 −3 hpx/parallel/executors/executor_traits.hpp
  18. +2 −2 hpx/parallel/executors/sequenced_executor.hpp
  19. +2 −2 hpx/parallel/executors/thread_execution.hpp
  20. +2 −2 hpx/parallel/executors/thread_executor_traits.hpp
  21. +1 −1 hpx/parallel/segmented_algorithms/count.hpp
  22. +2 −2 hpx/parallel/segmented_algorithms/detail/reduce.hpp
  23. +7 −7 hpx/parallel/segmented_algorithms/detail/scan.hpp
  24. +2 −2 hpx/parallel/segmented_algorithms/minmax.hpp
  25. +1 −1 hpx/performance_counters/performance_counter_set.hpp
  26. +2 −2 hpx/runtime/components/binpacking_distribution_policy.hpp
  27. +1 −1 hpx/runtime/components/client_base.hpp
  28. +2 −2 hpx/runtime/components/memory_block.hpp
  29. +2 −2 src/lcos/detail/barrier_node.cpp
  30. +6 −6 src/performance_counters/performance_counter_set.cpp
  31. +2 −2 src/util/activate_counters.cpp
@@ -18,7 +18,7 @@
#include <hpx/util/deferred_call.hpp>
#include <hpx/util/iterator_range.hpp>
#include <hpx/util/range.hpp>
#include <hpx/util/unwrapped.hpp>
#include <hpx/util/unwrap.hpp>
#include <boost/atomic.hpp>
View
@@ -28,7 +28,7 @@
#include <hpx/util/parse_command_line.hpp>
#include <hpx/util/safe_lexical_cast.hpp>
#include <hpx/util/thread_aware_timer.hpp>
#include <hpx/util/unwrapped.hpp>
#include <hpx/util/unwrap.hpp>
#include <hpx/util/zip_iterator.hpp>
#endif
@@ -476,7 +476,7 @@ namespace hpx { namespace parallel { inline namespace v1
std::move(f1),
// step 2 propagates the partition results from left
// to right
hpx::util::unwrapped(std::plus<std::size_t>()),
hpx::util::unwrapping(std::plus<std::size_t>()),
// step 3 runs final accumulation on each partition
std::move(f3),
// step 4 use this return value
@@ -13,7 +13,7 @@
#include <hpx/traits/segmented_iterator_traits.hpp>
#include <hpx/util/bind.hpp>
#include <hpx/util/range.hpp>
#include <hpx/util/unwrapped.hpp>
#include <hpx/util/unwrap.hpp>
#include <hpx/parallel/algorithms/detail/dispatch.hpp>
#include <hpx/parallel/execution_policy.hpp>
@@ -145,7 +145,7 @@ namespace hpx { namespace parallel { inline namespace v1
std::forward<ExPolicy>(policy),
first, std::distance(first, last),
std::move(f1),
hpx::util::unwrapped(
hpx::util::unwrapping(
[](std::vector<difference_type>&& results)
{
return util::accumulate_n(
@@ -312,7 +312,7 @@ namespace hpx { namespace parallel { inline namespace v1
std::forward<ExPolicy>(policy),
first, std::distance(first, last),
std::move(f1),
hpx::util::unwrapped(
hpx::util::unwrapping(
[](std::vector<difference_type> && results)
{
return util::accumulate_n(
@@ -12,7 +12,7 @@
#include <hpx/config.hpp>
#include <hpx/traits/is_iterator.hpp>
#include <hpx/util/invoke.hpp>
#include <hpx/util/unwrapped.hpp>
#include <hpx/util/unwrap.hpp>
#include <hpx/util/zip_iterator.hpp>
#include <hpx/parallel/algorithms/detail/dispatch.hpp>
@@ -167,7 +167,7 @@ namespace hpx { namespace parallel { inline namespace v1
},
// step 2 propagates the partition results from left
// to right
hpx::util::unwrapped(op),
hpx::util::unwrapping(op),
// step 3 runs final accumulation on each partition
std::move(f3),
// step 4 use this return value
@@ -12,7 +12,7 @@
#include <hpx/config.hpp>
#include <hpx/traits/is_iterator.hpp>
#include <hpx/util/invoke.hpp>
#include <hpx/util/unwrapped.hpp>
#include <hpx/util/unwrap.hpp>
#include <hpx/util/zip_iterator.hpp>
#include <hpx/parallel/algorithms/detail/dispatch.hpp>
@@ -161,7 +161,7 @@ namespace hpx { namespace parallel { inline namespace v1
},
// step 2 propagates the partition results from left
// to right
hpx::util::unwrapped(op),
hpx::util::unwrapping(op),
// step 3 runs final accumulation on each partition
std::move(f3),
// step 4 use this return value
@@ -144,7 +144,7 @@ namespace hpx { namespace parallel { inline namespace v1
return util::partitioner<ExPolicy, FwdIter, FwdIter>::call(
std::forward<ExPolicy>(policy),
first, std::distance(first, last),
std::move(f1), hpx::util::unwrapped(std::move(f2))
std::move(f1), hpx::util::unwrapping(std::move(f2))
);
}
};
@@ -377,7 +377,7 @@ namespace hpx { namespace parallel { inline namespace v1
return util::partitioner<ExPolicy, FwdIter, FwdIter>::call(
std::forward<ExPolicy>(policy),
first, std::distance(first, last),
std::move(f1), hpx::util::unwrapped(std::move(f2))
std::move(f1), hpx::util::unwrapping(std::move(f2))
);
}
};
@@ -633,7 +633,7 @@ namespace hpx { namespace parallel { inline namespace v1
call(
std::forward<ExPolicy>(policy),
result.first, std::distance(result.first, last),
std::move(f1), hpx::util::unwrapped(std::move(f2))
std::move(f1), hpx::util::unwrapping(std::move(f2))
);
}
};
@@ -435,7 +435,7 @@ namespace hpx { namespace parallel { inline namespace v1
std::move(f1),
// step 2 propagates the partition results from left
// to right
hpx::util::unwrapped(
hpx::util::unwrapping(
[](output_iterator_offset const& prev_sum,
output_iterator_offset const& curr)
-> output_iterator_offset
@@ -11,7 +11,7 @@
#include <hpx/config.hpp>
#include <hpx/traits/is_iterator.hpp>
#include <hpx/util/range.hpp>
#include <hpx/util/unwrapped.hpp>
#include <hpx/util/unwrap.hpp>
#include <hpx/parallel/algorithms/detail/dispatch.hpp>
#include <hpx/parallel/execution_policy.hpp>
@@ -72,7 +72,7 @@ namespace hpx { namespace parallel { inline namespace v1
return util::accumulate_n(++part_begin, --part_size,
std::move(val), r);
},
hpx::util::unwrapped(
hpx::util::unwrapping(
[init, r](std::vector<T> && results) -> T
{
return util::accumulate_n(hpx::util::begin(results),
@@ -13,7 +13,7 @@
#include <hpx/traits/concepts.hpp>
#include <hpx/traits/is_iterator.hpp>
#include <hpx/util/tagged_pair.hpp>
#include <hpx/util/unwrapped.hpp>
#include <hpx/util/unwrap.hpp>
#include <hpx/parallel/algorithms/copy.hpp>
#include <hpx/parallel/algorithms/detail/dispatch.hpp>
@@ -160,7 +160,7 @@ namespace hpx { namespace parallel { inline namespace v1
},
// step 2 propagates the partition results from left
// to right
hpx::util::unwrapped(op),
hpx::util::unwrapping(op),
// step 3 runs final_accumulation on each partition
std::move(f3),
// use this return value
@@ -159,7 +159,7 @@ namespace hpx { namespace parallel { inline namespace v1
},
// step 2 propagates the partition results from left
// to right
hpx::util::unwrapped(op),
hpx::util::unwrapping(op),
// step 3 runs final accumulation on each partition
std::move(f3),
// step 4 use this return value
@@ -15,7 +15,7 @@
#include <hpx/traits/segmented_iterator_traits.hpp>
#include <hpx/util/range.hpp>
#include <hpx/util/result_of.hpp>
#include <hpx/util/unwrapped.hpp>
#include <hpx/util/unwrap.hpp>
#include <hpx/parallel/algorithms/detail/dispatch.hpp>
#include <hpx/parallel/algorithms/detail/predicates.hpp>
@@ -97,7 +97,7 @@ namespace hpx { namespace parallel { inline namespace v1
hpx::util::invoke(conv, next));
});
},
hpx::util::unwrapped(
hpx::util::unwrapping(
[init, r](std::vector<T> && results) -> T
{
return util::accumulate_n(hpx::util::begin(results),
@@ -215,7 +215,7 @@ namespace hpx { namespace parallel { inline namespace v1
std::move(f1),
// step 2 propagates the partition results from left
// to right
hpx::util::unwrapped(std::plus<std::size_t>()),
hpx::util::unwrapping(std::plus<std::size_t>()),
// step 3 runs final accumulation on each partition
std::move(f3),
// step 4 use this return value
@@ -26,7 +26,7 @@
#include <hpx/util/invoke.hpp>
#include <hpx/util/range.hpp>
#include <hpx/util/tuple.hpp>
#include <hpx/util/unwrapped.hpp>
#include <hpx/util/unwrap.hpp>
#include <cstddef>
#include <iterator>
@@ -1062,7 +1062,7 @@ namespace hpx { namespace parallel { namespace execution
execution::async_execute(exec, f, elem, ts...)
);
}
return hpx::util::unwrapped(results);
return hpx::util::unwrap(results);
}
catch (std::bad_alloc const& ba) {
throw ba;
@@ -18,7 +18,7 @@
#include <hpx/util/decay.hpp>
#include <hpx/util/deferred_call.hpp>
#include <hpx/util/result_of.hpp>
#include <hpx/util/unwrapped.hpp>
#include <hpx/util/unwrap.hpp>
#include <hpx/parallel/executors/execution.hpp>
#include <hpx/parallel/executors/execution_information.hpp>
@@ -22,7 +22,7 @@
#include <hpx/util/deferred_call.hpp>
#include <hpx/util/invoke.hpp>
#include <hpx/util/range.hpp>
#include <hpx/util/unwrapped.hpp>
#include <hpx/util/unwrap.hpp>
#include <hpx/parallel/executors/execution_fwd.hpp>
#include <hpx/parallel/executors/rebind_executor.hpp>
@@ -284,7 +284,7 @@ namespace hpx { namespace parallel { inline namespace v3
struct bulk_execute_result_impl<F, Shape, false, Ts...>
{
typedef decltype(
util::unwrapped(std::declval<typename bulk_async_execute_result<F,
util::unwrap(std::declval<typename bulk_async_execute_result<F,
Shape, Ts...>::type>())) type;
};
@@ -337,7 +337,7 @@ namespace hpx { namespace parallel { inline namespace v3
{
results.push_back(exec.async_execute(f, elem, ts...));
}
return hpx::util::unwrapped(results);
return hpx::util::unwrap(results);
}
catch (std::bad_alloc const& ba) {
throw ba;
@@ -16,7 +16,7 @@
#include <hpx/traits/is_executor.hpp>
#include <hpx/util/deferred_call.hpp>
#include <hpx/util/invoke.hpp>
#include <hpx/util/unwrapped.hpp>
#include <hpx/util/unwrap.hpp>
#include <hpx/parallel/exception_list.hpp>
@@ -122,7 +122,7 @@ namespace hpx { namespace parallel { namespace execution
static typename detail::bulk_execute_result<F, S, Ts...>::type
bulk_sync_execute(F && f, S const& shape, Ts &&... ts)
{
return hpx::util::unwrapped(
return hpx::util::unwrap(
bulk_async_execute(std::forward<F>(f), shape,
std::forward<Ts>(ts)...));
}
@@ -20,7 +20,7 @@
#include <hpx/util/deferred_call.hpp>
#include <hpx/util/range.hpp>
#include <hpx/util/tuple.hpp>
#include <hpx/util/unwrapped.hpp>
#include <hpx/util/unwrap.hpp>
#include <hpx/parallel/executors/execution.hpp>
@@ -160,7 +160,7 @@ namespace hpx { namespace threads
elem, ts...));
}
return hpx::util::unwrapped(results);
return hpx::util::unwrap(results);
}
///////////////////////////////////////////////////////////////////////////
@@ -21,7 +21,7 @@
#include <hpx/util/decay.hpp>
#include <hpx/util/deferred_call.hpp>
#include <hpx/util/range.hpp>
#include <hpx/util/unwrapped.hpp>
#include <hpx/util/unwrap.hpp>
#include <cstddef>
#include <functional>
@@ -274,7 +274,7 @@ namespace hpx { namespace parallel { inline namespace v3
elem, ts...));
}
return hpx::util::unwrapped(results);
return hpx::util::unwrap(results);
}
/// Retrieve whether this executor has operations pending or not.
@@ -173,7 +173,7 @@ namespace hpx { namespace parallel { inline namespace v1
return result::get(
dataflow(
hpx::util::unwrapped([=](std::vector<value_type> && r)
hpx::util::unwrapping([=](std::vector<value_type> && r)
{
return std::accumulate(r.begin(), r.end(), value_type());
}),
@@ -53,7 +53,7 @@ namespace hpx { namespace parallel { inline namespace v1 { namespace detail
return util::accumulate_n(++part_begin, --part_size,
std::move(val), r);
},
hpx::util::unwrapped([r](std::vector<T> && results) -> T
hpx::util::unwrapping([r](std::vector<T> && results) -> T
{
auto rfirst = hpx::util::begin(results);
auto rlast = hpx::util::end(results);
@@ -113,7 +113,7 @@ namespace hpx { namespace parallel { inline namespace v1 { namespace detail
hpx::util::invoke(conv, next));
});
},
hpx::util::unwrapped([r](std::vector<T> && results) -> T
hpx::util::unwrapping([r](std::vector<T> && results) -> T
{
auto rfirst = hpx::util::begin(results);
auto rlast = hpx::util::end(results);
@@ -16,7 +16,7 @@
#include <hpx/util/invoke.hpp>
#include <hpx/util/tuple.hpp>
#include <hpx/util/unused.hpp>
#include <hpx/util/unwrapped.hpp>
#include <hpx/util/unwrap.hpp>
#include <hpx/util/void_guard.hpp>
#include <hpx/parallel/algorithms/detail/dispatch.hpp>
@@ -109,7 +109,7 @@ namespace hpx { namespace parallel { inline namespace v1
}
return ret;
},
hpx::util::unwrapped(
hpx::util::unwrapping(
[op, policy](std::vector<T>&& results) -> T
{
HPX_UNUSED(policy);
@@ -650,7 +650,7 @@ namespace hpx { namespace parallel { inline namespace v1
finalitems.push_back(
hpx::dataflow(
policy.executor(),
hpx::util::unwrapped(
hpx::util::unwrapping(
[=, &op, &conv](T last_value, T) -> void
{
dispatch(traits_out::get_id(out_it),
@@ -669,7 +669,7 @@ namespace hpx { namespace parallel { inline namespace v1
workitems.push_back(
hpx::dataflow(
policy.executor(),
hpx::util::unwrapped(op),
hpx::util::unwrapping(op),
workitems.back(),
res
)
@@ -798,7 +798,7 @@ namespace hpx { namespace parallel { inline namespace v1
finalitems.push_back(
hpx::dataflow(
policy.executor(),
hpx::util::unwrapped(
hpx::util::unwrapping(
[&, dest](T last_value, vector_type r)
{
// merge function
@@ -815,11 +815,11 @@ namespace hpx { namespace parallel { inline namespace v1
workitems.push_back(
hpx::dataflow(
policy.executor(),
hpx::util::unwrapped(op),
hpx::util::unwrapping(op),
workitems.back(),
execution::async_execute(
policy.executor(),
hpx::util::unwrapped(f2),
hpx::util::unwrapping(f2),
res
)
)
Oops, something went wrong.

0 comments on commit b6545ba

Please sign in to comment.