Skip to content

Commit

Permalink
Merge pull request #2711 from STEllAR-GROUP/bump-gcc
Browse files Browse the repository at this point in the history
Adjust code for minimal supported GCC having being bumped to 4.9
  • Loading branch information
hkaiser committed Jun 24, 2017
2 parents 71b792e + 211eda3 commit 792f247
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 98 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Expand Up @@ -924,8 +924,8 @@ link_directories(${CMAKE_BINARY_DIR}/lib)

# Check if the selected compiler versions are supposed to work with our codebase
if(CMAKE_COMPILER_IS_GNUCXX AND HPX_WITH_GCC_VERSION_CHECK)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
hpx_error("GCC 4.8 or higher is required. Specify HPX_GCC_VERSION_CHECK=OFF to ignore this error.")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
hpx_error("GCC 4.9 or higher is required. Specify HPX_GCC_VERSION_CHECK=OFF to ignore this error.")
endif()
endif()

Expand Down
6 changes: 0 additions & 6 deletions hpx/compute/host/target_distribution_policy.hpp
Expand Up @@ -179,15 +179,9 @@ namespace hpx { namespace compute { namespace host

for (std::size_t i = 0; i != v.size(); ++i)
{
#if !defined(HPX_GCC_VERSION) || HPX_GCC_VERSION >= 408000
result.emplace_back(
std::move(localities[i]), v[i].get()
);
#else
result.push_back(std::make_pair(
std::move(localities[i]), v[i].get()
));
#endif
}

return result;
Expand Down
4 changes: 1 addition & 3 deletions hpx/config.hpp
Expand Up @@ -555,10 +555,8 @@
"This function is deprecated and will be removed in the future."
# if defined(HPX_MSVC)
# define HPX_DEPRECATED(x) __declspec(deprecated(x))
# elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
# elif defined(__GNUC__)
# define HPX_DEPRECATED(x) __attribute__((__deprecated__(x)))
# elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
# define HPX_DEPRECATED(x) __attribute__((__deprecated__))
# endif
# if !defined(HPX_DEPRECATED)
# define HPX_DEPRECATED(x) /**/
Expand Down
14 changes: 1 addition & 13 deletions hpx/runtime/parcelset/parcelport.hpp
Expand Up @@ -37,10 +37,6 @@

#include <hpx/config/warnings_prefix.hpp>

#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION < 40900
#define HPX_PARCELSET_PENDING_PARCELS_WORKAROUND
#endif

///////////////////////////////////////////////////////////////////////////////
namespace hpx { namespace agas
{
Expand Down Expand Up @@ -342,18 +338,10 @@ namespace hpx { namespace parcelset
hpx::applier::applier *applier_;

/// The cache for pending parcels
#if defined(HPX_PARCELSET_PENDING_PARCELS_WORKAROUND)
typedef util::tuple<
std::shared_ptr<std::vector<parcel> >
, std::vector<write_handler_type>
>
#else
typedef util::tuple<
std::vector<parcel>
, std::vector<write_handler_type>
>
#endif
map_second_type;
> map_second_type;
typedef std::map<locality, map_second_type> pending_parcels_map;
pending_parcels_map pending_parcels_;

Expand Down
44 changes: 0 additions & 44 deletions hpx/runtime/parcelset/parcelport_impl.hpp
Expand Up @@ -623,13 +623,7 @@ namespace hpx { namespace parcelset
> il(&l);

mapped_type& e = pending_parcels_[locality_id];
#if defined(HPX_PARCELSET_PENDING_PARCELS_WORKAROUND)
if(!util::get<0>(e))
util::get<0>(e) = std::make_shared<std::vector<parcel> >();
util::get<0>(e)->push_back(std::move(p));
#else
util::get<0>(e).push_back(std::move(p));
#endif
util::get<1>(e).push_back(std::move(f));

parcel_destinations_.insert(locality_id);
Expand All @@ -653,39 +647,20 @@ namespace hpx { namespace parcelset
HPX_ASSERT(parcels.size() == handlers.size());

mapped_type& e = pending_parcels_[locality_id];
#if defined(HPX_PARCELSET_PENDING_PARCELS_WORKAROUND)
if(!util::get<0>(e))
{
util::get<0>(e) = std::make_shared<std::vector<parcel> >();
HPX_ASSERT(util::get<1>(e).empty());
std::swap(*util::get<0>(e), parcels);
std::swap(util::get<1>(e), handlers);
}
#else
if (util::get<0>(e).empty())
{
HPX_ASSERT(util::get<1>(e).empty());
std::swap(util::get<0>(e), parcels);
std::swap(util::get<1>(e), handlers);
}
#endif
else
{
#if defined(HPX_PARCELSET_PENDING_PARCELS_WORKAROUND)
HPX_ASSERT(util::get<0>(e)->size() == util::get<1>(e).size());
std::size_t new_size = util::get<0>(e)->size() + parcels.size();
util::get<0>(e)->reserve(new_size);

std::move(parcels.begin(), parcels.end(),
std::back_inserter(*util::get<0>(e)));
#else
HPX_ASSERT(util::get<0>(e).size() == util::get<1>(e).size());
std::size_t new_size = util::get<0>(e).size() + parcels.size();
util::get<0>(e).reserve(new_size);

std::move(parcels.begin(), parcels.end(),
std::back_inserter(util::get<0>(e)));
#endif
util::get<1>(e).reserve(new_size);
std::move(handlers.begin(), handlers.end(),
std::back_inserter(util::get<1>(e)));
Expand All @@ -710,22 +685,13 @@ namespace hpx { namespace parcelset

// do nothing if parcels have already been picked up by
// another thread
#if defined(HPX_PARCELSET_PENDING_PARCELS_WORKAROUND)
if (it != pending_parcels_.end() && !util::get<0>(it->second)->empty())
#else
if (it != pending_parcels_.end() && !util::get<0>(it->second).empty())
#endif
{
HPX_ASSERT(it->first == locality_id);
HPX_ASSERT(handlers.size() == 0);
HPX_ASSERT(handlers.size() == parcels.size());
#if defined(HPX_PARCELSET_PENDING_PARCELS_WORKAROUND)
std::swap(parcels, *util::get<0>(it->second));
HPX_ASSERT(util::get<0>(it->second)->size() == 0);
#else
std::swap(parcels, util::get<0>(it->second));
HPX_ASSERT(util::get<0>(it->second).size() == 0);
#endif
std::swap(handlers, util::get<1>(it->second));
HPX_ASSERT(handlers.size() == parcels.size());

Expand Down Expand Up @@ -761,13 +727,8 @@ namespace hpx { namespace parcelset
{
auto& handlers = util::get<1>(pending.second);
dest = pending.first;
#if defined(HPX_PARCELSET_PENDING_PARCELS_WORKAROUND)
p = std::move(parcels->back());
parcels->pop_back();
#else
p = std::move(parcels.back());
parcels.pop_back();
#endif
handler = std::move(handlers.back());
handlers.pop_back();

Expand Down Expand Up @@ -899,12 +860,7 @@ namespace hpx { namespace parcelset

// HPX_ASSERT(locality_id == sender_connection->destination());
pending_parcels_map::iterator it = pending_parcels_.find(locality_id);
#if defined(HPX_PARCELSET_PENDING_PARCELS_WORKAROUND)
if (it == pending_parcels_.end() ||
(util::get<0>(it->second) && util::get<0>(it->second)->empty()))
#else
if (it == pending_parcels_.end() || util::get<0>(it->second).empty())
#endif
return;
}

Expand Down
22 changes: 0 additions & 22 deletions hpx/runtime/threads/coroutines/detail/tss.hpp
Expand Up @@ -51,33 +51,11 @@ namespace hpx { namespace threads { namespace coroutines { namespace detail
value_(val)
{}

#if !(defined(HPX_INTEL_VERSION) && __GNUC__ == 4 && __GNUC_MINOR__ == 6)
tss_data_node(tss_data_node&& rhs)
: func_(std::move(rhs.func_)),
value_(rhs.value_)
{
rhs.func_.reset();
rhs.value_ = nullptr;
}
#endif

~tss_data_node()
{
cleanup();
}

#if !(defined(HPX_INTEL_VERSION) && __GNUC__ == 4 && __GNUC_MINOR__ == 6)
tss_data_node& operator=(tss_data_node&& rhs)
{
func_ = std::move(rhs.func_);
value_ = rhs.value_;

rhs.func_.reset();
rhs.value_ = nullptr;
return *this;
}
#endif

template <typename T>
T get_data() const
{
Expand Down
7 changes: 0 additions & 7 deletions src/runtime/parcelset/parcelport.cpp
Expand Up @@ -196,17 +196,10 @@ namespace hpx { namespace parcelset
std::int64_t count = 0;
for (auto && p : pending_parcels_)
{
#if defined(HPX_PARCELSET_PENDING_PARCELS_WORKAROUND)
count += hpx::util::get<0>(p.second)->size();
HPX_ASSERT(
hpx::util::get<0>(p.second)->size() ==
hpx::util::get<1>(p.second).size());
#else
count += hpx::util::get<0>(p.second).size();
HPX_ASSERT(
hpx::util::get<0>(p.second).size() ==
hpx::util::get<1>(p.second).size());
#endif
}
return count;
}
Expand Down
2 changes: 1 addition & 1 deletion src/util/backtrace/backtrace.cpp
Expand Up @@ -24,7 +24,7 @@
&& (!defined(__ANDROID__) || !defined(ANDROID))
#define BOOST_HAVE_EXECINFO
#define BOOST_HAVE_DLFCN
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) && !defined(__clang__)
#if defined(__GNUC__) && !defined(__clang__)
# define BOOST_HAVE_UNWIND
#endif
#endif
Expand Down

0 comments on commit 792f247

Please sign in to comment.