Skip to content

Commit

Permalink
Merge pull request #2693 from STEllAR-GROUP/P0443R2
Browse files Browse the repository at this point in the history
P0443 r2
  • Loading branch information
hkaiser committed Jul 3, 2017
2 parents 12e7720 + 4bb1c27 commit 25d5634
Show file tree
Hide file tree
Showing 44 changed files with 615 additions and 377 deletions.
6 changes: 3 additions & 3 deletions hpx/compute/cuda/concurrent_executor.hpp
Expand Up @@ -118,7 +118,7 @@ namespace hpx { namespace compute { namespace cuda
}

template <typename F, typename ... Ts>
void apply_execute(F && f, Ts &&... ts)
void post(F && f, Ts &&... ts)
{
std::size_t current = ++current_ % cuda_executors_.size();
parallel::execution::post(
Expand Down Expand Up @@ -167,7 +167,7 @@ namespace hpx { namespace compute { namespace cuda

template <typename F, typename Shape, typename ... Ts>
std::vector<hpx::future<void> >
async_bulk_execute(F && f, Shape const& shape, Ts &&... ts)
bulk_async_execute(F && f, Shape const& shape, Ts &&... ts)
{
// Before Boost V1.56 boost::size() does not respect the iterator category of
// its argument.
Expand All @@ -190,7 +190,7 @@ namespace hpx { namespace compute { namespace cuda
shape_type;

std::array<shape_type, 1> cuda_shape{{s}};
parallel::execution::sync_bulk_execute(
parallel::execution::bulk_sync_execute(
cuda_executors_[current], std::forward<F>(f),
cuda_shape, std::forward<Ts>(ts)...);
},
Expand Down
10 changes: 5 additions & 5 deletions hpx/compute/cuda/default_executor.hpp
Expand Up @@ -168,7 +168,7 @@ namespace hpx { namespace compute { namespace cuda
}

template <typename F, typename ... Ts>
void apply_execute(F && f, Ts &&... ts) const
void post(F && f, Ts &&... ts) const
{
detail::launch(target_, 1, 1,
std::forward<F>(f), std::forward<Ts>(ts)...);
Expand All @@ -177,14 +177,14 @@ namespace hpx { namespace compute { namespace cuda
template <typename F, typename ... Ts>
hpx::future<void> async_execute(F && f, Ts &&... ts) const
{
apply_execute(std::forward<F>(f), std::forward<Ts>(ts)...);
post(std::forward<F>(f), std::forward<Ts>(ts)...);
return target_.get_future();
}

template <typename F, typename ... Ts>
void sync_execute(F && f, Ts &&... ts) const
{
apply_execute(std::forward<F>(f), std::forward<Ts>(ts)...);
post(std::forward<F>(f), std::forward<Ts>(ts)...);
target_.synchronize();
}

Expand All @@ -197,7 +197,7 @@ namespace hpx { namespace compute { namespace cuda

template <typename F, typename Shape, typename ... Ts>
std::vector<hpx::future<void> >
async_bulk_execute(F && f, Shape const& shape, Ts &&... ts) const
bulk_async_execute(F && f, Shape const& shape, Ts &&... ts) const
{
bulk_launch(std::forward<F>(f), shape, std::forward<Ts>(ts)...);

Expand All @@ -207,7 +207,7 @@ namespace hpx { namespace compute { namespace cuda
}

template <typename F, typename Shape, typename ... Ts>
void sync_bulk_execute(F && f, Shape const& shape, Ts &&... ts) const
void bulk_sync_execute(F && f, Shape const& shape, Ts &&... ts) const
{
bulk_launch(std::forward<F>(f), shape, std::forward<Ts>(ts)...);
target_.synchronize();
Expand Down
10 changes: 5 additions & 5 deletions hpx/compute/host/block_executor.hpp
Expand Up @@ -109,7 +109,7 @@ namespace hpx { namespace compute { namespace host
/// \endcond

template <typename F, typename ... Ts>
void apply_execute(F && f, Ts &&... ts)
void post(F && f, Ts &&... ts)
{
parallel::execution::post(executors_[current_],
std::forward<F>(f), std::forward<Ts>(ts)...);
Expand Down Expand Up @@ -140,7 +140,7 @@ namespace hpx { namespace compute { namespace host
F, Shape, Ts...
>::type>
>
async_bulk_execute(F && f, Shape const& shape, Ts &&... ts)
bulk_async_execute(F && f, Shape const& shape, Ts &&... ts)
{
std::vector<hpx::future<
typename hpx::parallel::v3::detail::bulk_async_execute_result<
Expand All @@ -165,7 +165,7 @@ namespace hpx { namespace compute { namespace host
auto part_end = begin;
std::advance(part_end, part_size);
auto futures =
parallel::execution::async_bulk_execute(
parallel::execution::bulk_async_execute(
executors_[i],
std::forward<F>(f),
boost::make_iterator_range(begin, part_end),
Expand All @@ -190,7 +190,7 @@ namespace hpx { namespace compute { namespace host
typename hpx::parallel::v3::detail::bulk_execute_result<
F, Shape, Ts...
>::type
sync_bulk_execute(F && f, Shape const& shape, Ts &&... ts)
bulk_sync_execute(F && f, Shape const& shape, Ts &&... ts)
{
typename hpx::parallel::v3::detail::bulk_execute_result<
F, Shape, Ts...
Expand All @@ -213,7 +213,7 @@ namespace hpx { namespace compute { namespace host
auto part_end = begin;
std::advance(part_end, part_size);
auto part_results =
parallel::execution::sync_bulk_execute(
parallel::execution::bulk_sync_execute(
executors_[i],
std::forward<F>(f),
boost::make_iterator_range(begin, part_end),
Expand Down
6 changes: 3 additions & 3 deletions hpx/compute/host/default_executor.hpp
Expand Up @@ -42,7 +42,7 @@ namespace hpx { namespace compute { namespace host
/// \endcond

template <typename F, typename ... Ts>
void apply_execute(F && f, Ts &&... ts)
void post(F && f, Ts &&... ts)
{
}

Expand All @@ -59,13 +59,13 @@ namespace hpx { namespace compute { namespace host

template <typename F, typename Shape, typename ... Ts>
static std::vector<hpx::future<void> >
async_bulk_execute(F && f, Shape const& shape, Ts &&... ts)
bulk_async_execute(F && f, Shape const& shape, Ts &&... ts)
{
return std::vector<hpx::future<void> >();
}

template <typename F, typename Shape, typename ... Ts>
static void sync_bulk_execute(F && f, Shape const& shape, Ts &&... ts)
static void bulk_sync_execute(F && f, Shape const& shape, Ts &&... ts)
{
}

Expand Down
10 changes: 5 additions & 5 deletions hpx/parallel/executors/distribution_policy_executor.hpp
Expand Up @@ -70,12 +70,12 @@ namespace hpx { namespace parallel { namespace execution
"distribution_policy_executor needs to be instantiated with a "
"distribution policy type");

// apply_execute implementations
// post implementations
template <typename F, typename ... Ts>
typename std::enable_if<
!hpx::traits::is_action<F>::value
>::type
apply_execute_impl(F && f, Ts && ... ts) const
post_impl(F && f, Ts && ... ts) const
{
typedef components::server::invoke_function_action<F> action_type;
policy_.template apply<action_type>(threads::thread_priority_default,
Expand All @@ -86,7 +86,7 @@ namespace hpx { namespace parallel { namespace execution
typename std::enable_if<
hpx::traits::is_action<Action>::value
>::type
apply_execute_impl(Action && act, Ts && ... ts) const
post_impl(Action && act, Ts && ... ts) const
{
policy_.template apply<Action>(threads::thread_priority_default,
std::forward<Ts>(ts)...);
Expand Down Expand Up @@ -151,9 +151,9 @@ namespace hpx { namespace parallel { namespace execution
typedef parallel_execution_tag execution_category;

template <typename F, typename ... Ts>
void apply_execute(F && f, Ts &&... ts) const
void post(F && f, Ts &&... ts) const
{
return apply_execute_impl(std::forward<F>(f),
return post_impl(std::forward<F>(f),
std::forward<Ts>(ts)...);
}

Expand Down

0 comments on commit 25d5634

Please sign in to comment.