Skip to content

Commit

Permalink
Merge branch 'master' into fix_this_thread_executor
Browse files Browse the repository at this point in the history
  • Loading branch information
sithhell committed Oct 13, 2017
2 parents bff5b95 + c043c77 commit a71173b
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 7 deletions.
8 changes: 8 additions & 0 deletions cmake/HPX_AddConfigTest.cmake
Expand Up @@ -548,6 +548,14 @@ macro(hpx_check_for_cxx11_noreturn_attribute)
FILE ${ARGN})
endmacro()

###############################################################################
macro(hpx_check_for_cxx11_override)
add_hpx_config_test(HPX_WITH_CXX11_OVERRIDE
SOURCE cmake/tests/cxx11_override.cpp
FILE ${ARGN}
CMAKECXXFEATURE cxx_override)
endmacro()

###############################################################################
macro(hpx_check_for_cxx14_constexpr)
add_hpx_config_test(HPX_WITH_CXX14_CONSTEXPR
Expand Down
3 changes: 3 additions & 0 deletions cmake/HPX_PerformCxxFeatureTests.cmake
Expand Up @@ -79,6 +79,9 @@ macro(hpx_perform_cxx_feature_tests)
hpx_check_for_cxx11_variadic_templates(
REQUIRED "HPX needs support for C++11 variadic templates")

hpx_check_for_cxx11_override(
REQUIRED "HPX needs support for C++11 override")

# Check the availability of certain C++11 library features
hpx_check_for_cxx11_std_array(
REQUIRED "HPX needs support for C++11 std::array")
Expand Down
29 changes: 29 additions & 0 deletions cmake/tests/cxx11_override.cpp
@@ -0,0 +1,29 @@
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2017 Denis Blank
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
////////////////////////////////////////////////////////////////////////////////

class my_base
{
public:
my_base() { }
virtual ~my_base() { }

virtual void do_sth() { }
};

class my_inh : public my_base
{
public:
my_inh() { }

void do_sth() override { }
};

int main()
{
my_base* obj = new my_inh();
delete obj;
}
8 changes: 4 additions & 4 deletions hpx/parallel/util/detail/chunk_size_iterator.hpp
Expand Up @@ -25,13 +25,13 @@ namespace hpx { namespace parallel { namespace util { namespace detail
: public hpx::util::iterator_facade<
chunk_size_iterator<Iterator>,
hpx::util::tuple<Iterator, std::size_t> const,
std::forward_iterator_tag>
std::input_iterator_tag>
{
private:
typedef hpx::util::iterator_facade<
chunk_size_iterator<Iterator>,
hpx::util::tuple<Iterator, std::size_t> const,
std::forward_iterator_tag
std::input_iterator_tag
> base_type;

public:
Expand Down Expand Up @@ -90,13 +90,13 @@ namespace hpx { namespace parallel { namespace util { namespace detail
: public hpx::util::iterator_facade<
chunk_size_idx_iterator<Iterator>,
hpx::util::tuple<Iterator, std::size_t, std::size_t> const,
std::forward_iterator_tag>
std::input_iterator_tag>
{
private:
typedef hpx::util::iterator_facade<
chunk_size_idx_iterator<Iterator>,
hpx::util::tuple<Iterator, std::size_t, std::size_t> const,
std::forward_iterator_tag
std::input_iterator_tag
> base_type;

public:
Expand Down
7 changes: 4 additions & 3 deletions src/runtime/threads/policies/affinity_data.cpp
Expand Up @@ -137,6 +137,8 @@ namespace hpx { namespace threads { namespace policies { namespace detail
hpx::util::safe_lexical_cast<std::size_t>(
get_config_entry("hpx.cores", 0), 0);

init_cached_pu_nums(num_system_pus);

#if defined(HPX_HAVE_HWLOC)
std::string affinity_desc;
hpx::detail::get_affinity_description(cfg_, affinity_desc);
Expand All @@ -145,7 +147,7 @@ namespace hpx { namespace threads { namespace policies { namespace detail
// don't use any affinity for any of the os-threads
threads::resize(no_affinity_, num_system_pus);
for (std::size_t i = 0; i != num_threads_; ++i)
threads::set(no_affinity_, i);
threads::set(no_affinity_, get_pu_num(i));
}
else if (!affinity_desc.empty())
{
Expand Down Expand Up @@ -186,7 +188,6 @@ namespace hpx { namespace threads { namespace policies { namespace detail
}

pu_offset_ %= num_system_pus;
init_cached_pu_nums(num_system_pus);

std::vector<std::size_t> cores;
cores.reserve(num_threads_);
Expand Down Expand Up @@ -320,7 +321,7 @@ namespace hpx { namespace threads { namespace policies { namespace detail

void affinity_data::init_cached_pu_nums(std::size_t hardware_concurrency)
{
if(pu_nums_.empty())
if (pu_nums_.empty())
{
pu_nums_.resize(num_threads_);
for (std::size_t i = 0; i != num_threads_; ++i)
Expand Down

0 comments on commit a71173b

Please sign in to comment.