Skip to content

Commit

Permalink
Merge pull request #3495 from STEllAR-GROUP/fix_dataflow
Browse files Browse the repository at this point in the history
Fixing dataflow
  • Loading branch information
biddisco authored Oct 17, 2018
2 parents 72a4010 + 72f2fe4 commit d4a820b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
9 changes: 8 additions & 1 deletion hpx/util/detail/pack_traversal_async_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <atomic>
#include <cstddef>
#include <exception>
#include <functional>
#include <iterator>
#include <memory>
#include <type_traits>
Expand Down Expand Up @@ -362,6 +363,12 @@ namespace util {
return Range{std::begin(element), std::end(element)};
}

template <typename T, typename Range = dynamic_async_range_of_t<T>>
Range make_dynamic_async_range(std::reference_wrapper<T> ref_element)
{
return Range{std::begin(ref_element.get()), std::end(ref_element.get())};
}

/// Represents a particular point in a asynchronous traversal hierarchy
template <typename Frame, typename... Hierarchy>
class async_traversal_point
Expand Down Expand Up @@ -483,7 +490,7 @@ namespace util {
void async_traverse_one(Current&& current)
{
using ElementType =
typename std::decay<decltype(*current)>::type;
typename hpx::util::decay_unwrap<decltype(*current)>::type;
return async_traverse_one_impl(
container_category_of_t<ElementType>{},
std::forward<Current>(current));
Expand Down
6 changes: 3 additions & 3 deletions hpx/util/detail/pack_traversal_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -902,22 +902,22 @@ namespace util {
auto traverse(Strategy, T&& element)
-> decltype(std::declval<mapping_helper>().match(
std::declval<container_category_of_t<
typename std::decay<T>::type>>(),
typename hpx::util::decay_unwrap<T>::type>>(),
std::declval<T>()));

/// \copybrief traverse
template <typename T>
auto try_traverse(Strategy, T&& element)
-> decltype(std::declval<mapping_helper>().try_match(
std::declval<container_category_of_t<
typename std::decay<T>::type>>(),
typename hpx::util::decay_unwrap<T>::type>>(),
std::declval<T>()))
{
// We use tag dispatching here, to categorize the type T whether
// it satisfies the container or tuple like requirements.
// Then we can choose the underlying implementation accordingly.
return try_match(
container_category_of_t<typename std::decay<T>::type>{},
container_category_of_t<typename hpx::util::decay_unwrap<T>::type>{},
std::forward<T>(element));
}

Expand Down

0 comments on commit d4a820b

Please sign in to comment.