Skip to content

Commit

Permalink
Couple of unrelated changes
Browse files Browse the repository at this point in the history
- define ASIO_NO_NOMINMAX
- disambiguate member access in basic_function
- add datapar algorithms to hpx/local/algorithm.hpp
- suppress dll-export and unused variable warnings
- #include datapar headers more consistently
- more consequent implementation of policy.base_policy()
  • Loading branch information
hkaiser committed Jun 19, 2022
1 parent dbf82fe commit b584e06
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 10 deletions.
2 changes: 2 additions & 0 deletions cmake/HPX_SetupAsio.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,6 @@ if(NOT HPX_FIND_PACKAGE)
# Disable experimental std::string_view support as a workaround to
# https://github.com/chriskohlhoff/asio/issues/597
hpx_add_config_cond_define(ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW)
# Disable Asio's definition of NOMINMAX
hpx_add_config_cond_define(ASIO_NO_NOMINMAX)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,11 @@ namespace hpx { namespace execution { inline namespace v1 {

using base_policy_type =
sequenced_task_policy_shim<Executor, Parameters>;

base_policy_type base_policy()
{
return simd_task_policy_shim<Executor, Parameters>(exec_, params_);
return sequenced_task_policy_shim<Executor, Parameters>(
exec_, params_);
}

/// Return the associated executor object.
Expand Down
55 changes: 55 additions & 0 deletions libs/core/executors/include/hpx/executors/execution_policy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
#include <hpx/executors/parallel_executor.hpp>
#include <hpx/executors/sequenced_executor.hpp>
#include <hpx/serialization/serialize.hpp>
#if defined(HPX_HAVE_DATAPAR)
#include <hpx/executors/datapar/execution_policy.hpp>
#endif

#include <memory>
#include <type_traits>
Expand Down Expand Up @@ -1393,6 +1396,12 @@ namespace hpx { namespace execution {
}

public:
using base_policy_type = parallel_task_policy;
base_policy_type base_policy()
{
return parallel_task_policy{};
}

/// Return the associated executor object.
executor_type& executor()
{
Expand Down Expand Up @@ -1526,6 +1535,14 @@ namespace hpx { namespace execution {
}

public:
using base_policy_type =
parallel_task_policy_shim<Executor, Parameters>;
base_policy_type base_policy()
{
return parallel_task_policy_shim<Executor, Parameters>(
exec_, params_);
}

/// Return the associated executor object.
executor_type& executor()
{
Expand Down Expand Up @@ -1686,6 +1703,12 @@ namespace hpx { namespace execution {
}

public:
using base_policy_type = parallel_policy;
base_policy_type base_policy()
{
return parallel_policy{};
}

/// Return the associated executor object.
executor_type& executor()
{
Expand Down Expand Up @@ -1831,6 +1854,12 @@ namespace hpx { namespace execution {
}

public:
using base_policy_type = parallel_policy_shim<Executor, Parameters>;
base_policy_type base_policy()
{
return parallel_policy_shim<Executor, Parameters>(exec_, params_);
}

/// Return the associated executor object.
executor_type& executor()
{
Expand Down Expand Up @@ -1998,6 +2027,12 @@ namespace hpx { namespace execution {
}

public:
using base_policy_type = sequenced_policy;
base_policy_type base_policy()
{
return sequenced_policy{};
}

/// Return the associated executor object.
executor_type& executor()
{
Expand Down Expand Up @@ -2139,6 +2174,14 @@ namespace hpx { namespace execution {
}

public:
using base_policy_type =
sequenced_task_policy_shim<Executor, Parameters>;
base_policy_type base_policy()
{
return sequenced_task_policy_shim<Executor, Parameters>(
exec_, params_);
}

/// Return the associated executor object.
executor_type& executor()
{
Expand Down Expand Up @@ -2305,6 +2348,12 @@ namespace hpx { namespace execution {
}

public:
using base_policy_type = sequenced_policy;
base_policy_type base_policy()
{
return sequenced_policy{};
}

/// Return the associated executor object.
executor_type& executor()
{
Expand Down Expand Up @@ -2447,6 +2496,12 @@ namespace hpx { namespace execution {
}

public:
using base_policy_type = sequenced_policy_shim<Executor, Parameters>;
base_policy_type base_policy()
{
return sequenced_policy_shim<Executor, Parameters>(exec_, params_);
}

/// Return the associated executor object.
executor_type& executor()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ namespace hpx { namespace util { namespace detail {

HPX_FORCEINLINE R operator()(Ts... vs) const
{
vtable const* vptr = static_cast<vtable const*>(base_type::vptr);
return vptr->invoke(object, HPX_FORWARD(Ts, vs)...);
vtable const* f_vptr = static_cast<vtable const*>(base_type::vptr);
return f_vptr->invoke(object, HPX_FORWARD(Ts, vs)...);
}

using base_type::get_function_address;
Expand Down
3 changes: 3 additions & 0 deletions libs/core/include_local/include/hpx/local/algorithm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@
#include <hpx/config.hpp>
#include <hpx/parallel/algorithm.hpp>
#include <hpx/parallel/container_algorithms.hpp>
#if defined(HPX_HAVE_DATAPAR)
#include <hpx/parallel/datapar.hpp>
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include <utility>
#include <vector>

#include <hpx/config/warnings_prefix.hpp>

///////////////////////////////////////////////////////////////////////////////
namespace hpx { namespace util {

Expand Down Expand Up @@ -98,3 +100,5 @@ namespace hpx { namespace util {
int argc, char** argv);
};
}} // namespace hpx::util

#include <hpx/config/warnings_suffix.hpp>
22 changes: 15 additions & 7 deletions wrap/include/hpx/wrap_main.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2007-2014 Hartmut Kaiser
// Copyright (c) 2007-2022 Hartmut Kaiser
// Copyright (c) 2018-2020 Nikunj Gupta
//
// SPDX-License-Identifier: BSL-1.0
Expand All @@ -8,18 +8,23 @@
#pragma once

#include <hpx/config.hpp>

#if defined(HPX_MSVC)
#pragma warning(push)
#pragma warning(disable : 4100)
#endif

#include <hpx/hpx_init.hpp>

// We support different implementation depending upon the Operating
// System in use.
#if defined(HPX_HAVE_DYNAMIC_HPX_MAIN) && \
(defined(__linux) || defined(__linux__) || defined(linux) || \
defined(__APPLE__))
#if defined(HPX_HAVE_DYNAMIC_HPX_MAIN) && \
(defined(__linux) || defined(__linux__) || defined(linux) || \
defined(__APPLE__))

#include <string>

namespace hpx_start
{
namespace hpx_start {
// include_libhpx_wrap here is an override for the one present in
// src/hpx_wrap.cpp. The value of this variable defines if we need
// to change the program's entry point or not.
Expand All @@ -35,7 +40,7 @@ namespace hpx_start
// HPX::wrap_main instead of an orthogonal exception about thread not
// registered with the HPX runtime system.
HPX_SYMBOL_EXPORT bool is_linked __attribute__((weak)) = false;
}
} // namespace hpx_start

#else

Expand All @@ -49,3 +54,6 @@ namespace hpx_start
#define main hpx_startup::user_main
#endif

#if defined(HPX_MSVC)
#pragma warning(pop)
#endif

0 comments on commit b584e06

Please sign in to comment.