Skip to content

Commit

Permalink
Fixing some warnings from HPX complaining about use of obsolete types
Browse files Browse the repository at this point in the history
  • Loading branch information
hkaiser committed Sep 30, 2020
1 parent c0c5270 commit 5cb20b3
Show file tree
Hide file tree
Showing 14 changed files with 124 additions and 114 deletions.
@@ -1,5 +1,5 @@
// Copyright Eric Niebler 2013-2015
// Copyright 2015 Hartmut Kaiser
// Copyright 2015-2020 Hartmut Kaiser
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
Expand Down Expand Up @@ -43,7 +43,7 @@ namespace hpx { namespace util {
struct unpack_getter
{
typedef typename Tag::template getter<T,
typename tuple_element<I, T>::type, I>
typename hpx::tuple_element<I, T>::type, I>
type;

private:
Expand Down
34 changes: 18 additions & 16 deletions libs/core/datastructures/include/hpx/datastructures/tagged_pair.hpp
@@ -1,5 +1,5 @@
// Copyright Eric Niebler 2013-2015
// Copyright 2015 Hartmut Kaiser
// Copyright 2015-2020 Hartmut Kaiser
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
Expand Down Expand Up @@ -67,32 +67,34 @@ namespace hpx { namespace util {
}

template <typename Tag1, typename Tag2, typename... Ts>
constexpr HPX_FORCEINLINE
tagged_pair<Tag1(typename tuple_element<0, tuple<Ts...>>::type),
Tag2(typename tuple_element<1, tuple<Ts...>>::type)>
make_tagged_pair(tuple<Ts...>&& p)
constexpr HPX_FORCEINLINE tagged_pair<
Tag1(typename hpx::tuple_element<0, hpx::tuple<Ts...>>::type),
Tag2(typename hpx::tuple_element<1, hpx::tuple<Ts...>>::type)>
make_tagged_pair(hpx::tuple<Ts...>&& p)
{
static_assert(
sizeof...(Ts) >= 2, "tuple must have at least 2 elements");
sizeof...(Ts) >= 2, "hpx::tuple must have at least 2 elements");

typedef tagged_pair<Tag1(typename tuple_element<0, tuple<Ts...>>::type),
Tag2(typename tuple_element<1, tuple<Ts...>>::type)>
typedef tagged_pair<
Tag1(typename hpx::tuple_element<0, hpx::tuple<Ts...>>::type),
Tag2(typename hpx::tuple_element<1, hpx::tuple<Ts...>>::type)>
result_type;

return result_type(std::move(get<0>(p)), std::move(get<1>(p)));
}

template <typename Tag1, typename Tag2, typename... Ts>
constexpr HPX_FORCEINLINE
tagged_pair<Tag1(typename tuple_element<0, tuple<Ts...>>::type),
Tag2(typename tuple_element<1, tuple<Ts...>>::type)>
make_tagged_pair(tuple<Ts...> const& p)
constexpr HPX_FORCEINLINE tagged_pair<
Tag1(typename hpx::tuple_element<0, hpx::tuple<Ts...>>::type),
Tag2(typename hpx::tuple_element<1, hpx::tuple<Ts...>>::type)>
make_tagged_pair(hpx::tuple<Ts...> const& p)
{
static_assert(
sizeof...(Ts) >= 2, "tuple must have at least 2 elements");
sizeof...(Ts) >= 2, "hpx::tuple must have at least 2 elements");

typedef tagged_pair<Tag1(typename tuple_element<0, tuple<Ts...>>::type),
Tag2(typename tuple_element<1, tuple<Ts...>>::type)>
typedef tagged_pair<
Tag1(typename hpx::tuple_element<0, hpx::tuple<Ts...>>::type),
Tag2(typename hpx::tuple_element<1, hpx::tuple<Ts...>>::type)>
result_type;

return result_type(get<0>(p), get<1>(p));
Expand Down Expand Up @@ -122,7 +124,7 @@ namespace hpx {

template <std::size_t N, typename Tag1, typename Tag2>
struct tuple_element<N, util::tagged_pair<Tag1, Tag2>>
: tuple_element<N,
: hpx::tuple_element<N,
std::pair<typename util::detail::tag_elem<Tag1>::type,
typename util::detail::tag_elem<Tag2>::type>>
{
Expand Down
@@ -1,5 +1,5 @@
// Copyright Eric Niebler 2013-2015
// Copyright 2015 Hartmut Kaiser
// Copyright 2015-2020 Hartmut Kaiser
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
Expand All @@ -22,10 +22,10 @@ namespace hpx { namespace util {
///////////////////////////////////////////////////////////////////////////
template <typename... Ts>
struct tagged_tuple
: tagged<tuple<typename detail::tag_elem<Ts>::type...>,
: tagged<hpx::tuple<typename detail::tag_elem<Ts>::type...>,
typename detail::tag_spec<Ts>::type...>
{
typedef tagged<tuple<typename detail::tag_elem<Ts>::type...>,
typedef tagged<hpx::tuple<typename detail::tag_elem<Ts>::type...>,
typename detail::tag_spec<Ts>::type...>
base_type;

Expand All @@ -51,7 +51,8 @@ namespace hpx { namespace util {
tagged_tuple<typename detail::tagged_type<Tags, Ts>::type...>
make_tagged_tuple(Ts&&... ts)
{
typedef tagged_tuple<typename detail::tagged_type<Tags, Ts>::type...>
typedef tagged_tuple<
typename detail::tagged_type<Tags, Ts>::type...>
result_type;

return result_type(std::forward<Ts>(ts)...);
Expand All @@ -60,13 +61,14 @@ namespace hpx { namespace util {
template <typename... Tags, typename... Ts>
constexpr HPX_FORCEINLINE
tagged_tuple<typename detail::tagged_type<Tags, Ts>::type...>
make_tagged_tuple(tuple<Ts...>&& t)
make_tagged_tuple(hpx::tuple<Ts...>&& t)
{
static_assert(sizeof...(Tags) == tuple_size<tuple<Ts...>>::value,
static_assert(sizeof...(Tags) == tuple_size<hpx::tuple<Ts...>>::value,
"the number of tags must be identical to the size of the given "
"tuple");

typedef tagged_tuple<typename detail::tagged_type<Tags, Ts>::type...>
typedef tagged_tuple<
typename detail::tagged_type<Tags, Ts>::type...>
result_type;

return result_type(std::move(t));
Expand All @@ -77,18 +79,19 @@ namespace hpx { namespace util {
template <typename Tag, std::size_t I, typename Tuple>
struct tagged_element_type
{
typedef typename tuple_element<I, Tuple>::type element_type;
typedef typename hpx::tuple_element<I, Tuple>::type element_type;
typedef typename hpx::util::identity<Tag(element_type)>::type type;
};

template <typename Tuple, typename Indices, typename... Tags>
struct tagged_tuple_helper;

template <typename... Ts, std::size_t... Is, typename... Tags>
struct tagged_tuple_helper<tuple<Ts...>, index_pack<Is...>, Tags...>
struct tagged_tuple_helper<hpx::tuple<Ts...>, index_pack<Is...>,
Tags...>
{
typedef tagged_tuple<
typename tagged_element_type<Tags, Is, tuple<Ts...>>::type...>
typedef tagged_tuple<typename tagged_element_type<Tags, Is,
hpx::tuple<Ts...>>::type...>
type;
};
} // namespace detail
Expand All @@ -98,13 +101,14 @@ namespace hpx {
///////////////////////////////////////////////////////////////////////////
template <typename... Ts>
struct tuple_size<util::tagged_tuple<Ts...>>
: tuple_size<tuple<typename util::detail::tag_elem<Ts>::type...>>
: tuple_size<hpx::tuple<typename util::detail::tag_elem<Ts>::type...>>
{
};

template <std::size_t N, typename... Ts>
struct tuple_element<N, util::tagged_tuple<Ts...>>
: tuple_element<N, tuple<typename util::detail::tag_elem<Ts>::type...>>
: tuple_element<N,
hpx::tuple<typename util::detail::tag_elem<Ts>::type...>>
{
};
} // namespace hpx
@@ -1,4 +1,4 @@
// Copyright (c) 2007-2015 Hartmut Kaiser
// Copyright (c) 2007-2020 Hartmut Kaiser
// Copyright (c) 2014 Agustin Berge
//
// SPDX-License-Identifier: BSL-1.0
Expand Down Expand Up @@ -29,9 +29,9 @@ namespace hpx { namespace util {
struct zip_iterator_value;

template <typename... Ts>
struct zip_iterator_value<tuple<Ts...>>
struct zip_iterator_value<hpx::tuple<Ts...>>
{
typedef tuple<typename std::iterator_traits<Ts>::value_type...>
typedef hpx::tuple<typename std::iterator_traits<Ts>::value_type...>
type;
};

Expand All @@ -40,9 +40,10 @@ namespace hpx { namespace util {
struct zip_iterator_reference;

template <typename... Ts>
struct zip_iterator_reference<tuple<Ts...>>
struct zip_iterator_reference<hpx::tuple<Ts...>>
{
typedef tuple<typename std::iterator_traits<Ts>::reference...> type;
typedef hpx::tuple<typename std::iterator_traits<Ts>::reference...>
type;
};

///////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -174,30 +175,32 @@ namespace hpx { namespace util {
struct zip_iterator_category;

template <typename T>
struct zip_iterator_category<tuple<T>,
typename std::enable_if<tuple_size<tuple<T>>::value == 1>::type>
struct zip_iterator_category<hpx::tuple<T>,
typename std::enable_if<hpx::tuple_size<hpx::tuple<T>>::value ==
1>::type>
{
typedef typename std::iterator_traits<T>::iterator_category type;
};

template <typename T, typename U>
struct zip_iterator_category<tuple<T, U>,
typename std::enable_if<tuple_size<tuple<T, U>>::value == 2>::type>
struct zip_iterator_category<hpx::tuple<T, U>,
typename std::enable_if<hpx::tuple_size<hpx::tuple<T, U>>::value ==
2>::type>
: zip_iterator_category_impl<
typename std::iterator_traits<T>::iterator_category,
typename std::iterator_traits<U>::iterator_category>
{
};

template <typename T, typename U, typename... Tail>
struct zip_iterator_category<tuple<T, U, Tail...>,
struct zip_iterator_category<hpx::tuple<T, U, Tail...>,
typename std::enable_if<(
tuple_size<tuple<T, U, Tail...>>::value > 2)>::type>
hpx::tuple_size<hpx::tuple<T, U, Tail...>>::value > 2)>::type>
: zip_iterator_category_impl<
typename zip_iterator_category_impl<
typename std::iterator_traits<T>::iterator_category,
typename std::iterator_traits<U>::iterator_category>::type,
typename zip_iterator_category<tuple<Tail...>>::type>
typename zip_iterator_category<hpx::tuple<Tail...>>::type>
{
};

Expand All @@ -206,12 +209,13 @@ namespace hpx { namespace util {
struct dereference_iterator;

template <typename... Ts>
struct dereference_iterator<tuple<Ts...>>
struct dereference_iterator<hpx::tuple<Ts...>>
{
template <std::size_t... Is>
HPX_HOST_DEVICE static
typename zip_iterator_reference<tuple<Ts...>>::type
call(util::index_pack<Is...>, tuple<Ts...> const& iterators)
typename zip_iterator_reference<hpx::tuple<Ts...>>::type
call(
util::index_pack<Is...>, hpx::tuple<Ts...> const& iterators)
{
return hpx::forward_as_tuple(*hpx::get<Is>(iterators)...);
}
Expand Down Expand Up @@ -357,12 +361,13 @@ namespace hpx { namespace util {

template <typename... Ts>
class zip_iterator
: public detail::zip_iterator_base<tuple<Ts...>, zip_iterator<Ts...>>
: public detail::zip_iterator_base<hpx::tuple<Ts...>, zip_iterator<Ts...>>
{
static_assert(
sizeof...(Ts) != 0, "zip_iterator must wrap at least one iterator");

typedef detail::zip_iterator_base<tuple<Ts...>, zip_iterator<Ts...>>
typedef detail::zip_iterator_base<hpx::tuple<Ts...>,
zip_iterator<Ts...>>
base_type;

public:
Expand All @@ -376,7 +381,7 @@ namespace hpx { namespace util {
{
}

HPX_HOST_DEVICE explicit zip_iterator(tuple<Ts...>&& t)
HPX_HOST_DEVICE explicit zip_iterator(hpx::tuple<Ts...>&& t)
: base_type(std::move(t))
{
}
Expand Down Expand Up @@ -426,15 +431,15 @@ namespace hpx { namespace util {
};

template <typename... Ts>
class zip_iterator<tuple<Ts...>>
: public detail::zip_iterator_base<tuple<Ts...>,
zip_iterator<tuple<Ts...>>>
class zip_iterator<hpx::tuple<Ts...>>
: public detail::zip_iterator_base<hpx::tuple<Ts...>,
zip_iterator<hpx::tuple<Ts...>>>
{
static_assert(
sizeof...(Ts) != 0, "zip_iterator must wrap at least one iterator");

typedef detail::zip_iterator_base<tuple<Ts...>,
zip_iterator<tuple<Ts...>>>
typedef detail::zip_iterator_base<hpx::tuple<Ts...>,
zip_iterator<hpx::tuple<Ts...>>>
base_type;

public:
Expand All @@ -448,7 +453,7 @@ namespace hpx { namespace util {
{
}

HPX_HOST_DEVICE explicit zip_iterator(tuple<Ts...>&& t)
HPX_HOST_DEVICE explicit zip_iterator(hpx::tuple<Ts...>&& t)
: base_type(std::move(t))
{
}
Expand Down
Expand Up @@ -1017,8 +1017,7 @@ namespace hpx {
"Requires at least forward iterator or integral loop "
"boundaries.");

typedef execution::is_sequenced_execution_policy<ExPolicy>
is_seq;
typedef hpx::is_sequenced_execution_policy<ExPolicy> is_seq;

std::size_t size = parallel::v1::detail::distance(first, last);
auto&& t = hpx::forward_as_tuple(std::forward<Args>(args)...);
Expand Down Expand Up @@ -1054,8 +1053,7 @@ namespace hpx {
"Requires at least forward iterator or integral loop "
"boundaries.");

typedef execution::is_sequenced_execution_policy<ExPolicy>
is_seq;
typedef hpx::is_sequenced_execution_policy<ExPolicy> is_seq;

auto&& t = hpx::forward_as_tuple(std::forward<Args>(args)...);

Expand Down
Expand Up @@ -209,8 +209,7 @@ namespace hpx { namespace parallel { inline namespace v1 {
inclusive_scan_(ExPolicy&& policy, FwdIter1 first, FwdIter1 last,
FwdIter2 dest, T&& init, Op&& op, std::false_type, Conv&& conv)
{
typedef parallel::execution::is_sequenced_execution_policy<ExPolicy>
is_seq;
typedef hpx::is_sequenced_execution_policy<ExPolicy> is_seq;

return inclusive_scan<FwdIter2>().call(
std::forward<ExPolicy>(policy), is_seq(), first, last, dest,
Expand All @@ -223,8 +222,7 @@ namespace hpx { namespace parallel { inline namespace v1 {
inclusive_scan_(ExPolicy&& policy, FwdIter1 first, FwdIter1 last,
FwdIter2 dest, Op&& op, std::false_type, Conv&& conv)
{
typedef parallel::execution::is_sequenced_execution_policy<ExPolicy>
is_seq;
typedef hpx::is_sequenced_execution_policy<ExPolicy> is_seq;

return inclusive_scan<FwdIter2>().call(
std::forward<ExPolicy>(policy), is_seq(), first, last, dest,
Expand Down
Expand Up @@ -300,7 +300,7 @@ namespace hpx { namespace parallel { inline namespace v1 {
static_assert((hpx::traits::is_forward_iterator<FwdIterB>::value),
"Requires at least forward iterator.");

using is_seq = execution::is_sequenced_execution_policy<ExPolicy>;
using is_seq = hpx::is_sequenced_execution_policy<ExPolicy>;

return detail::reduce<T>().call(std::forward<ExPolicy>(policy),
is_seq(), first, last, std::move(init), std::forward<F>(f));
Expand Down

0 comments on commit 5cb20b3

Please sign in to comment.