Skip to content

Commit

Permalink
Merge branch 'master' into docs-fix-parallel-algo
Browse files Browse the repository at this point in the history
  • Loading branch information
bhumitattarde committed Aug 4, 2022
2 parents 7dfdbd0 + 295267f commit 75ec528
Show file tree
Hide file tree
Showing 74 changed files with 5,954 additions and 3,366 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1979,6 +1979,8 @@ else()
"ppc64"
)
set(__has_timestamp_support ON)
elseif("${__target_arch}" STREQUAL "riscv64")
set(__has_timestamp_support ON)
elseif("${__target_arch}" STREQUAL "bgq")
set(__has_timestamp_support ON)
elseif("${__target_arch}" STREQUAL "s390x")
Expand Down
2 changes: 2 additions & 0 deletions cmake/TargetArch.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ set(archdetect_cpp_code
#else
#error cmake_ARCH arm
#endif
#elif defined(__riscv) && (__riscv_xlen == 64)
#error cmake_ARCH riscv64
#elif defined(__i386) || defined(__i386__) || defined(_M_IX86)
#error cmake_ARCH i386
#elif defined(__i486__) || defined(__i586__) || defined(__i686__)
Expand Down
7 changes: 4 additions & 3 deletions docs/sphinx/about_hpx/people.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
..
Copyright (C) 2007-2015 Hartmut Kaiser
Copyright (C) 2007-2022 Hartmut Kaiser
Copyright (C) 2016-2018 Adrian Serio
SPDX-License-Identifier: BSL-1.0
Expand Down Expand Up @@ -153,7 +153,8 @@ the project through discussions, pull requests, documentation patches, etc.
* Bruno Pitrus, for his work with parallel algorithms.
* Nikunj Gupta, for rewriting the implementation of ``hpx_main.hpp`` and for his
fixes for tests.
* Christopher Taylor, for his interest in |hpx| and the fixes he provided.
* Christopher Taylor, for his interest in |hpx| and the fixes he provided. Chris
also contributed support for RISC-V architectures.
* Shoshana Jakobovits, for her work on the resource partitioner.
* Denis Blank, who re-wrote our unwrapped function to accept plain values
arbitrary containers, and properly deal with nested futures.
Expand Down Expand Up @@ -268,7 +269,7 @@ the project through discussions, pull requests, documentation patches, etc.
xaguilar, Andrew Kemp, Dylan Stark, Matthew Anderson, Jeremy Wilke, Jiazheng
Yuan, CyberDrudge, david8dixon, Maxwell Reeser, Raffaele Solca, Marco
Ippolito, Jules Penuchot, Weile Wei, Severin Strobl, Kor de Jong, albestro,
Jeff Trull, Yuri Victorovich, and Gregor Daiß who contributed to the general
Jeff Trull, Yuri Victorovich, and Gregor Daiß who contributed to the general
improvement of |hpx|.

|stellar_hpx_funding|_ lists current and past funding sources for |hpx|. Special thanks to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,38 @@ namespace hpx {
////////////////////////////////////////////////////////////////////////////
/// Assigns each value in the range given by result its corresponding
/// element in the range [first, last] and the one preceding it except
/// *result, which is assigned *first
/// *result, which is assigned *first.
///
/// \note Complexity: Exactly (last - first) - 1 application of the
/// binary operator and (last - first) assignments.
///
/// \tparam FwdIter1 The type of the source iterators used for the
/// input range (deduced).
/// This iterator type must meet the requirements of a
/// forward iterator.
/// \tparam FwdIter2 The type of the source iterators used for the
/// output range (deduced).
/// This iterator type must meet the requirements of a
/// forward iterator.
///
/// \param first Refers to the beginning of the sequence of elements
/// of the range the algorithm will be applied to.
/// \param last Refers to the end of the sequence of elements of
/// the range the algorithm will be applied to.
/// \param dest Refers to the beginning of the sequence of elements
/// the results will be assigned to.
///
/// \returns The \a adjacent_difference algorithm returns a \a FwdIter2.
/// The \a adjacent_difference algorithm returns an iterator to
/// the element past the last element written.
///
template <typename FwdIter1, typename FwdIter2>
FwdIter2 adjacent_difference(FwdIter1 first, FwdIter1 last, FwdIter2 dest);

////////////////////////////////////////////////////////////////////////////
/// Assigns each value in the range given by result its corresponding
/// element in the range [first, last] and the one preceding it except
/// *result, which is assigned *first. Executed according to the policy.
///
/// \note Complexity: Exactly (last - first) - 1 application of the
/// binary operator and (last - first) assignments.
Expand All @@ -26,11 +57,11 @@ namespace hpx {
/// in which it executes the assignments.
/// \tparam FwdIter1 The type of the source iterators used for the
/// input range (deduced).
/// This iterator type must meet the requirements of an
/// This iterator type must meet the requirements of a
/// forward iterator.
/// \tparam FwdIter2 The type of the source iterators used for the
/// output range (deduced).
/// This iterator type must meet the requirements of an
/// This iterator type must meet the requirements of a
/// forward iterator.
///
/// \param policy The execution policy to use for the scheduling of
Expand All @@ -57,19 +88,62 @@ namespace hpx {
/// \a sequenced_task_policy or
/// \a parallel_task_policy and
/// returns \a FwdIter2 otherwise.
/// The \a adjacent_find algorithm returns an iterator to the
/// last element in the output range.
///
/// This overload of \a adjacent_find is available if the user
/// decides to provide their algorithm their own binary
/// predicate \a op.
/// The \a adjacent_difference algorithm returns an iterator to
/// the element past the last element written.
///
template <typename ExPolicy, typename FwdIter1, typename FwdIter2>
inline typename std::enable_if<hpx::is_execution_policy<ExPolicy>::value,
typename util::detail::algorithm_result<ExPolicy, FwdIter2>::type>::type
hpx::parallel::util::detail::algorithm_result_t<ExPolicy, FwdIter2>
adjacent_difference(
ExPolicy&& policy, FwdIter1 first, FwdIter1 last, FwdIter2 dest);

///////////////////////////////////////////////////////////////////////////
/// Assigns each value in the range given by result its corresponding
/// element in the range [first, last] and the one preceding it except
/// *result, which is assigned *first
///
/// \note Complexity: Exactly (last - first) - 1 application of the
/// binary operator and (last - first) assignments.
///
/// \tparam FwdIter1 The type of the source iterators used for the
/// input range (deduced).
/// This iterator type must meet the requirements of a
/// forward iterator.
/// \tparam FwdIter2 The type of the source iterators used for the
/// output range (deduced).
/// This iterator type must meet the requirements of a
/// forward iterator.
/// \tparam Op The type of the function/function object to use
/// (deduced). Unlike its sequential form, the parallel
/// overload of \a adjacent_difference requires \a Op
/// to meet the requirements of \a CopyConstructible.
///
/// \param first Refers to the beginning of the sequence of elements
/// of the range the algorithm will be applied to.
/// \param last Refers to the end of the sequence of elements of
/// the range the algorithm will be applied to.
/// \param dest Refers to the beginning of the sequence of elements
/// the results will be assigned to.
/// \param op The binary operator which returns the difference
/// of elements. The signature should be equivalent
/// to the following:
/// \code
/// bool op(const Type1 &a, const Type1 &b);
/// \endcode \n
/// The signature does not need to have const &, but
/// the function must not modify the objects passed to
/// it. The types \a Type1 must be such
/// that objects of type \a FwdIter1 can be dereferenced
/// and then implicitly converted to the dereferenced
/// type of \a dest.
///
/// \returns The \a adjacent_difference algorithm returns \a FwdIter2.
/// The \a adjacent_difference algorithm returns an iterator to
/// the element past the last element written.
///
template <typename FwdIter1, typename FwdIter2, typename Op>
FwdIter2 adjacent_difference(
FwdIter1 first, FwdIter1 last, FwdIter2 dest, Op&& op);

///////////////////////////////////////////////////////////////////////////
/// Assigns each value in the range given by result its corresponding
/// element in the range [first, last] and the one preceding it except
Expand All @@ -84,11 +158,11 @@ namespace hpx {
/// in which it executes the assignments.
/// \tparam FwdIter1 The type of the source iterators used for the
/// input range (deduced).
/// This iterator type must meet the requirements of an
/// This iterator type must meet the requirements of a
/// forward iterator.
/// \tparam FwdIter2 The type of the source iterators used for the
/// output range (deduced).
/// This iterator type must meet the requirements of an
/// This iterator type must meet the requirements of a
/// forward iterator.
/// \tparam Op The type of the function/function object to use
/// (deduced). Unlike its sequential form, the parallel
Expand Down Expand Up @@ -131,14 +205,13 @@ namespace hpx {
/// \a sequenced_task_policy or
/// \a parallel_task_policy and
/// returns \a FwdIter2 otherwise.
/// The \a adjacent_find algorithm returns an iterator to the
/// last element in the output range.
/// The \a adjacent_difference algorithm returns an iterator to
/// the element past the last element written.
///
///
template <typename ExPolicy, typename FwdIter1, typename FwdIter2,
typename Op>
inline typename std::enable_if<hpx::is_execution_policy<ExPolicy>::value,
typename util::detail::algorithm_result<ExPolicy, FwdIter2>::type>::type
hpx::parallel::util::detail::algorithm_result_t<ExPolicy, FwdIter2>
adjacent_difference(ExPolicy&& policy, FwdIter1 first, FwdIter1 last,
FwdIter2 dest, Op&& op);
} // namespace hpx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
namespace hpx {
/// Searches the range [first, last) for two consecutive identical elements.
///
/// \note Complexity: Exactly the smaller of (result - first) + 1 and
/// (last - first) - 1 application of the predicate
/// \note Complexity: Exactly the smaller of (\a result - \a first) + 1 and
/// (\a last - \a first) - 1 application of the predicate
/// where \a result is the value returned
///
/// \tparam InIter The type of the source iterators used for the
Expand Down Expand Up @@ -45,14 +45,15 @@ namespace hpx {
/// \returns The \a adjacent_find algorithm returns an iterator to the
/// first of the identical elements. If no such elements are
/// found, \a last is returned.
template <typename InIter, typename Pred = detail::equal_to>
template <typename InIter,
typename Pred = hpx::parallel::v1::detail::equal_to>
InIter adjacent_find(InIter first, InIter last, Pred&& pred = Pred());

/// Searches the range [first, last) for two consecutive identical elements.
/// This version uses the given binary predicate pred
///
/// \note Complexity: Exactly the smaller of (result - first) + 1 and
/// (last - first) - 1 application of the predicate
/// \note Complexity: Exactly the smaller of (\a result - \a first) + 1 and
/// (\a last - \a first) - 1 application of the predicate
/// where \a result is the value returned
///
/// \tparam ExPolicy The type of the execution policy to use (deduced).
Expand Down Expand Up @@ -98,11 +99,11 @@ namespace hpx {
/// unordered fashion in unspecified threads, and indeterminately sequenced
/// within each thread.
///
/// \returns The \a adjacent_find algorithm returns a \a hpx::future<InIter>
/// \returns The \a adjacent_find algorithm returns a \a hpx::future<FwdIter>
/// if the execution policy is of type
/// \a sequenced_task_policy or
/// \a parallel_task_policy and
/// returns \a InIter otherwise.
/// returns \a FwdIter otherwise.
/// The \a adjacent_find algorithm returns an iterator to the
/// first of the identical elements. If no such elements are
/// found, \a last is returned.
Expand All @@ -112,9 +113,8 @@ namespace hpx {
/// predicate \a pred.
///
template <typename ExPolicy, typename FwdIter,
typename Pred = detail::equal_to>
typename std::enable_if<hpx::is_execution_policy<ExPolicy>::value,
typename util::detail::algorithm_result<ExPolicy, FwdIter>::type>::type
typename Pred = hpx::parallel::v1::detail::equal_to>
typename parallel::util::detail::algorithm_result<ExPolicy, FwdIter>::type
adjacent_find(
ExPolicy&& policy, FwdIter first, FwdIter last, Pred&& pred = Pred());
} // namespace hpx
Expand Down
Loading

0 comments on commit 75ec528

Please sign in to comment.