Skip to content

Commit

Permalink
Merge pull request #2928 from STEllAR-GROUP/fixing_execution_parameters
Browse files Browse the repository at this point in the history
Fixing execution parameters
  • Loading branch information
hkaiser committed Oct 4, 2017
2 parents a1a0e05 + 2472ad8 commit b7efe4b
Show file tree
Hide file tree
Showing 52 changed files with 795 additions and 359 deletions.
4 changes: 2 additions & 2 deletions hpx/compute/cuda/concurrent_executor.hpp
Expand Up @@ -199,7 +199,7 @@ namespace hpx { namespace compute { namespace cuda
};
}}}

namespace hpx { namespace traits
namespace hpx { namespace parallel { namespace execution
{
template <typename Executor>
struct executor_execution_category<
Expand Down Expand Up @@ -231,7 +231,7 @@ namespace hpx { namespace traits
compute::cuda::concurrent_executor<Executor> >
: std::true_type
{};
}}
}}}

#endif
#endif
4 changes: 2 additions & 2 deletions hpx/compute/cuda/concurrent_executor_parameters.hpp
Expand Up @@ -27,13 +27,13 @@ namespace hpx { namespace compute { namespace cuda
};
}}}

namespace hpx { namespace traits
namespace hpx { namespace parallel { namespace execution
{
template <>
struct is_executor_parameters<compute::cuda::concurrent_executor_parameters>
: std::true_type
{};
}}
}}}

#endif
#endif
4 changes: 2 additions & 2 deletions hpx/compute/cuda/default_executor.hpp
Expand Up @@ -230,7 +230,7 @@ namespace hpx { namespace compute { namespace cuda
};
}}}

namespace hpx { namespace traits
namespace hpx { namespace parallel { namespace execution
{
template <>
struct executor_execution_category<compute::cuda::default_executor>
Expand All @@ -257,7 +257,7 @@ namespace hpx { namespace traits
struct is_bulk_two_way_executor<compute::cuda::default_executor>
: std::true_type
{};
}}
}}}

#endif
#endif
4 changes: 2 additions & 2 deletions hpx/compute/cuda/default_executor_parameters.hpp
Expand Up @@ -28,13 +28,13 @@ namespace hpx { namespace compute { namespace cuda
};
}}}

namespace hpx { namespace traits
namespace hpx { namespace parallel { namespace execution
{
template <>
struct is_executor_parameters<compute::cuda::default_executor_parameters>
: std::true_type
{};
}}
}}}

#endif
#endif
9 changes: 4 additions & 5 deletions hpx/compute/cuda/target.hpp
Expand Up @@ -188,13 +188,12 @@ namespace hpx { namespace compute { namespace cuda
}

private:
#if !defined(HPX_COMPUTE_DEVICE_CODE)
friend class hpx::serialization::access;

template <typename Archive>
void serialize(Archive& ar, const unsigned int version)
{
ar & handle_.device_ & locality_;
}
void serialize(serialization::input_archive& ar, const unsigned int);
void serialize(serialization::output_archive& ar, const unsigned int);
#endif

native_handle_type handle_;
hpx::id_type locality_;
Expand Down
4 changes: 2 additions & 2 deletions hpx/compute/host/block_executor.hpp
Expand Up @@ -244,7 +244,7 @@ namespace hpx { namespace compute { namespace host
};
}}}

namespace hpx { namespace traits
namespace hpx { namespace parallel { namespace execution
{
template <typename Executor>
struct executor_execution_category<
Expand Down Expand Up @@ -276,6 +276,6 @@ namespace hpx { namespace traits
compute::host::block_executor<Executor> >
: std::true_type
{};
}}
}}}

#endif
4 changes: 2 additions & 2 deletions hpx/compute/host/default_executor.hpp
Expand Up @@ -74,7 +74,7 @@ namespace hpx { namespace compute { namespace host
};
}}}

namespace hpx { namespace traits
namespace hpx { namespace parallel { namespace execution
{
template <>
struct executor_execution_category<compute::host::default_executor>
Expand All @@ -101,6 +101,6 @@ namespace hpx { namespace traits
struct is_bulk_two_way_executor<compute::host::default_executor>
: std::true_type
{};
}}
}}}

#endif
7 changes: 2 additions & 5 deletions hpx/compute/host/target.hpp
Expand Up @@ -120,11 +120,8 @@ namespace hpx { namespace compute { namespace host
private:
friend class hpx::serialization::access;

template <typename Archive>
void serialize(Archive& ar, const unsigned int version)
{
ar & handle_.mask_ & locality_;
}
void serialize(serialization::input_archive& ar, const unsigned int);
void serialize(serialization::output_archive& ar, const unsigned int);

native_handle_type handle_;
hpx::id_type locality_;
Expand Down
9 changes: 6 additions & 3 deletions hpx/parallel/algorithms/detail/dispatch.hpp
Expand Up @@ -106,10 +106,13 @@ namespace hpx { namespace parallel { inline namespace v1 { namespace detail
typedef typename
hpx::util::decay<ExPolicy>::type::executor_parameters_type
parameters_type;
typedef typename
hpx::util::decay<ExPolicy>::type::executor_type
executor_type;

parallel::util::detail::scoped_executor_parameters<
parameters_type
> scoped_param(policy.parameters());
parallel::util::detail::scoped_executor_parameters_ref<
parameters_type, executor_type
> scoped_param(policy.parameters(), policy.executor());

return parallel::util::detail::algorithm_result<
ExPolicy, local_result_type
Expand Down
1 change: 0 additions & 1 deletion hpx/parallel/execution.hpp
Expand Up @@ -12,7 +12,6 @@
#include <hpx/parallel/executors/execution_parameters.hpp>
#include <hpx/parallel/executors/thread_execution.hpp>
#include <hpx/parallel/executors/thread_execution_information.hpp>
#include <hpx/parallel/executors/thread_execution_parameters.hpp>
#include <hpx/parallel/executors/thread_timed_execution.hpp>
#include <hpx/parallel/executors/timed_execution.hpp>

Expand Down
4 changes: 2 additions & 2 deletions hpx/parallel/executors/auto_chunk_size.hpp
Expand Up @@ -100,15 +100,15 @@ namespace hpx { namespace parallel { namespace execution
};
}}}

namespace hpx { namespace traits
namespace hpx { namespace parallel { namespace execution
{
/// \cond NOINTERNAL
template <>
struct is_executor_parameters<parallel::execution::auto_chunk_size>
: std::true_type
{};
/// \endcond
}}
}}}

#if defined(HPX_HAVE_EXECUTOR_COMPATIBILITY)

Expand Down
2 changes: 1 addition & 1 deletion hpx/parallel/executors/default_executor.hpp
Expand Up @@ -9,9 +9,9 @@
#define HPX_PARALLEL_EXECUTORS_DEFAULT_EXECUTOR_AUG_24_2015_0624PM

#include <hpx/config.hpp>
#include <hpx/parallel/executors/execution_parameters.hpp>
#include <hpx/parallel/executors/thread_execution.hpp>
#include <hpx/parallel/executors/thread_execution_information.hpp>
#include <hpx/parallel/executors/thread_execution_parameters.hpp>
#include <hpx/parallel/executors/thread_timed_execution.hpp>
#include <hpx/runtime/threads/executors/default_executor.hpp>

Expand Down
5 changes: 1 addition & 4 deletions hpx/parallel/executors/distribution_policy_executor.hpp
Expand Up @@ -193,18 +193,15 @@ namespace hpx { namespace parallel { namespace execution
return distribution_policy_executor<dist_policy_type>(
std::forward<DistPolicy>(policy));
}
}}}

namespace hpx { namespace traits
{
/// \cond NOINTERNAL
template <typename DistPolicy>
struct is_two_way_executor<
parallel::execution::distribution_policy_executor<DistPolicy> >
: std::true_type
{};
/// \endcond
}}
}}}

#if defined(HPX_HAVE_EXECUTOR_COMPATIBILITY)
#include <hpx/traits/v1/is_executor.hpp>
Expand Down
4 changes: 2 additions & 2 deletions hpx/parallel/executors/dynamic_chunk_size.hpp
Expand Up @@ -65,15 +65,15 @@ namespace hpx { namespace parallel { namespace execution
};
}}}

namespace hpx { namespace traits
namespace hpx { namespace parallel { namespace execution
{
/// \cond NOINTERNAL
template <>
struct is_executor_parameters<parallel::execution::dynamic_chunk_size>
: std::true_type
{};
/// \endcond
}}
}}}

#if defined(HPX_HAVE_EXECUTOR_COMPATIBILITY)

Expand Down
15 changes: 9 additions & 6 deletions hpx/parallel/executors/execution_information.hpp
Expand Up @@ -31,8 +31,9 @@ namespace hpx { namespace threads
namespace hpx { namespace parallel { inline namespace v3 { namespace detail
{
/// \cond NOINTERNAL
template <typename Parameters>
std::size_t call_processing_units_parameter_count(Parameters && params);
template <typename Parameters, typename Executor>
std::size_t call_processing_units_parameter_count(Parameters && params,
Executor && exec);
/// \endcond
}}}}

Expand All @@ -56,18 +57,20 @@ namespace hpx { namespace parallel { namespace execution
template <typename AnyExecutor, typename Parameters>
HPX_FORCEINLINE static auto
call(hpx::traits::detail::wrap_int, AnyExecutor && exec,
Parameters& params)
Parameters& params)
-> decltype(parallel::v3::detail::
call_processing_units_parameter_count(params))
call_processing_units_parameter_count(params,
std::forward<AnyExecutor>(exec)))
{
return parallel::v3::detail::
call_processing_units_parameter_count(params);
call_processing_units_parameter_count(params,
std::forward<AnyExecutor>(exec));
}

template <typename AnyExecutor, typename Parameters>
HPX_FORCEINLINE static auto
call(int, AnyExecutor && exec, Parameters&)
-> decltype(exec.processing_units_count())
-> decltype(exec.processing_units_count())
{
return exec.processing_units_count();
}
Expand Down
4 changes: 2 additions & 2 deletions hpx/parallel/executors/execution_information_fwd.hpp
Expand Up @@ -120,8 +120,8 @@ namespace hpx { namespace parallel { namespace execution
template <typename Executor, typename Parameters>
HPX_FORCEINLINE auto operator()(
Executor&& exec, Parameters& params) const
-> decltype(processing_units_count(std::forward<Executor>(exec),
params))
-> decltype(processing_units_count(
std::forward<Executor>(exec), params))
{
return processing_units_count(
std::forward<Executor>(exec), params);
Expand Down

0 comments on commit b7efe4b

Please sign in to comment.