-
-
Notifications
You must be signed in to change notification settings - Fork 542
Adapting HPX actions module to C++20 modules #7237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 2 commits
5945111
5013ced
ee3d2d6
a5ba56a
d36ed2f
f53b135
4ac4103
e8805e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,7 @@ include(HPX_AddModule) | |
| add_hpx_module( | ||
| core gasnet_base | ||
| GLOBAL_HEADER_GEN ON | ||
| GLOBAL_HEADER_MODULE_GEN ON | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please separate into a new PR. |
||
| SOURCES ${gasnet_base_sources} | ||
| HEADERS ${gasnet_base_headers} | ||
| DEPENDENCIES PkgConfig::GASNET ${gasnet_additional_dependencies} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ include(HPX_AddModule) | |
| add_hpx_module( | ||
| core lcw_base | ||
| GLOBAL_HEADER_GEN ON | ||
| GLOBAL_HEADER_MODULE_GEN ON | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, please keep this unrelated change separate. |
||
| SOURCES ${lcw_base_sources} | ||
| HEADERS ${lcw_base_headers} | ||
| MODULE_DEPENDENCIES hpx_logging hpx_runtime_configuration hpx_string_util | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,7 +29,9 @@ include(HPX_AddModule) | |
| add_hpx_module( | ||
| core preprocessor NO_CONFIG_IN_GENERATED_HEADERS | ||
| GLOBAL_HEADER_GEN ON | ||
| GLOBAL_HEADER_MODULE_GEN OFF | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the default, no need to specify. |
||
| HEADERS ${preprocessor_headers} | ||
| MACRO_HEADERS ${preprocessor_headers} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. copilot is correct here. |
||
| COMPAT_HEADERS ${preprocessor_compat_headers} | ||
| CMAKE_SUBDIRS tests | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| // Copyright (c) 2026 Arpit Khandelwal | ||
| // | ||
| // SPDX-License-Identifier: BSL-1.0 | ||
| // 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) | ||
|
|
||
| #pragma once | ||
|
|
||
|
arpittkhandelwal marked this conversation as resolved.
|
||
| #include <hpx/config.hpp> | ||
| #include <hpx/modules/preprocessor.hpp> | ||
|
|
||
| #if defined(HPX_HAVE_NETWORKING) | ||
|
|
||
| // Helper macro for action serialization; each of the defined actions needs to | ||
| // be registered with the serialization library. | ||
|
|
||
| #define HPX_DEFINE_GET_ACTION_NAME(action) \ | ||
| HPX_DEFINE_GET_ACTION_NAME_(action, action) \ | ||
| /**/ | ||
|
|
||
| #define HPX_DEFINE_GET_ACTION_NAME_(action, actionname) \ | ||
| HPX_DEFINE_GET_ACTION_NAME_ITT(action, actionname) \ | ||
| namespace hpx::actions::detail { \ | ||
| template <> \ | ||
| HPX_ALWAYS_EXPORT char const* get_action_name</**/ action>() noexcept \ | ||
| { \ | ||
| return HPX_PP_STRINGIZE(actionname); \ | ||
| } \ | ||
| } \ | ||
| /**/ | ||
|
|
||
| /////////////////////////////////////////////////////////////////////////////// | ||
| #if defined(HPX_HAVE_ITTNOTIFY) && HPX_HAVE_ITTNOTIFY != 0 && \ | ||
| !defined(HPX_HAVE_APEX) | ||
| #define HPX_DEFINE_GET_ACTION_NAME_ITT(action, actionname) \ | ||
| namespace hpx::actions::detail { \ | ||
| template <> \ | ||
| HPX_ALWAYS_EXPORT util::itt::string_handle const& \ | ||
| get_action_name_itt</**/ action>() noexcept \ | ||
| { \ | ||
| static util::itt::string_handle sh(HPX_PP_STRINGIZE(actionname)); \ | ||
| return sh; \ | ||
| } \ | ||
| } \ | ||
| /**/ | ||
|
|
||
| #define HPX_REGISTER_ACTION_DECLARATION_NO_DEFAULT_GUID_ITT(action) \ | ||
| namespace hpx::actions::detail { \ | ||
| template <> \ | ||
| HPX_ALWAYS_EXPORT util::itt::string_handle const& \ | ||
| get_action_name_itt</**/ action>() noexcept; \ | ||
| } \ | ||
| /**/ | ||
| #else // HPX_HAVE_ITTNOTIFY != 0 && !defined(HPX_HAVE_APEX) | ||
| #define HPX_DEFINE_GET_ACTION_NAME_ITT(action, actionname) /**/ | ||
| #define HPX_REGISTER_ACTION_DECLARATION_NO_DEFAULT_GUID_ITT(action) /**/ | ||
| #endif // HPX_HAVE_ITTNOTIFY != 0 && !defined(HPX_HAVE_APEX) | ||
|
|
||
| #define HPX_REGISTER_ACTION_DECLARATION_NO_DEFAULT_GUID(action) \ | ||
| HPX_REGISTER_ACTION_DECLARATION_NO_DEFAULT_GUID_ITT(action) \ | ||
| namespace hpx::actions::detail { \ | ||
| template <> \ | ||
| HPX_ALWAYS_EXPORT char const* get_action_name<action>() noexcept; \ | ||
| } \ | ||
| HPX_REGISTER_ACTION_EXTERN_DECLARATION(action) \ | ||
| \ | ||
| namespace hpx::traits { \ | ||
| template <> \ | ||
| struct is_action</**/ action> : std::true_type \ | ||
| { \ | ||
| }; \ | ||
| template <> \ | ||
| struct needs_automatic_registration</**/ action> : std::false_type \ | ||
| { \ | ||
| }; \ | ||
| } \ | ||
| /**/ | ||
|
|
||
| #define HPX_REGISTER_ACTION_DECLARATION_2(action, actionname) \ | ||
| HPX_REGISTER_ACTION_DECLARATION_NO_DEFAULT_GUID(action) \ | ||
| /**/ | ||
|
|
||
| #if defined(HPX_MSVC) || defined(HPX_MINGW) | ||
| #define HPX_REGISTER_ACTION_2(action, actionname) \ | ||
| HPX_DEFINE_GET_ACTION_NAME_(action, actionname) \ | ||
| HPX_REGISTER_ACTION_INVOCATION_COUNT(action) \ | ||
| HPX_REGISTER_PER_ACTION_DATA_COUNTER_TYPES(action) \ | ||
| namespace hpx::actions { \ | ||
| template struct HPX_ALWAYS_EXPORT transfer_action</**/ action>; \ | ||
| template struct HPX_ALWAYS_EXPORT \ | ||
| transfer_continuation_action</**/ action>; \ | ||
| } \ | ||
| /**/ | ||
| #define HPX_REGISTER_ACTION_EXTERN_DECLARATION(action) /**/ | ||
|
|
||
| #else // defined(HPX_MSVC) || defined(HPX_MINGW) | ||
|
|
||
| #define HPX_REGISTER_ACTION_2(action, actionname) \ | ||
| HPX_DEFINE_GET_ACTION_NAME_(action, actionname) \ | ||
| HPX_REGISTER_ACTION_INVOCATION_COUNT(action) \ | ||
| HPX_REGISTER_PER_ACTION_DATA_COUNTER_TYPES(action) \ | ||
| namespace hpx::actions { \ | ||
| template struct transfer_action</**/ action>; \ | ||
| template struct transfer_continuation_action</**/ action>; \ | ||
| } \ | ||
| /**/ | ||
| #define HPX_REGISTER_ACTION_EXTERN_DECLARATION(action) \ | ||
| namespace hpx::actions { \ | ||
| extern template struct HPX_ALWAYS_IMPORT transfer_action</**/ action>; \ | ||
| extern template struct HPX_ALWAYS_IMPORT \ | ||
| transfer_continuation_action</**/ action>; \ | ||
| } \ | ||
| /**/ | ||
|
|
||
| #endif // defined(HPX_MSVC) || defined(HPX_MINGW) | ||
|
|
||
| #endif // HPX_HAVE_NETWORKING | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,7 @@ include(HPX_AddModule) | |
| add_hpx_module( | ||
| full agas | ||
| GLOBAL_HEADER_GEN ON | ||
| GLOBAL_HEADER_MODULE_GEN ON | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think that this should be part of this PR. |
||
| SOURCES ${agas_sources} | ||
| HEADERS ${agas_headers} | ||
| COMPAT_HEADERS ${agas_compat_headers} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please separate this into its own PR?