Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#pragma once

#include <hpx/config.hpp>
#include <hpx/actions/transfer_action.hpp>
#include <hpx/modules/actions.hpp>
#include <hpx/async_distributed/transfer_continuation_action.hpp>
#include <hpx/modules/actions_base.hpp>
#include <hpx/modules/naming_base.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/// classes are asynchronous API which return the futures.

#include <hpx/config.hpp>
#include <hpx/actions/transfer_action.hpp>
#include <hpx/modules/actions.hpp>
#include <hpx/async_distributed/transfer_continuation_action.hpp>
#include <hpx/components/client_base.hpp>
#include <hpx/modules/actions_base.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/// classes are asynchronous API which return the futures.

#include <hpx/config.hpp>
#include <hpx/actions/transfer_action.hpp>
#include <hpx/modules/actions.hpp>
#include <hpx/assert.hpp>
#include <hpx/async_distributed/transfer_continuation_action.hpp>
#include <hpx/components/client_base.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#pragma once

#include <hpx/config.hpp>
#include <hpx/actions/transfer_action.hpp>
#include <hpx/modules/actions.hpp>
#include <hpx/async_distributed/transfer_continuation_action.hpp>
#include <hpx/modules/actions_base.hpp>
#include <hpx/modules/components_base.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#pragma once

#include <hpx/config.hpp>
#include <hpx/actions/transfer_action.hpp>
#include <hpx/modules/actions.hpp>
#include <hpx/async_distributed/transfer_continuation_action.hpp>
#include <hpx/modules/actions_base.hpp>
#include <hpx/modules/components_base.hpp>
Expand Down
2 changes: 2 additions & 0 deletions libs/core/async_sycl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ include(HPX_AddModule)
add_hpx_module(
core async_sycl
GLOBAL_HEADER_GEN ON
GLOBAL_HEADER_MODULE_GEN ON
ADD_TO_GLOBAL_HEADER hpx/async_sycl/detail/sycl_event_callback.hpp
Copy link
Copy Markdown
Contributor

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?

SOURCES ${async_sycl_sources}
HEADERS ${async_sycl_headers}
COMPAT_HEADERS ${async_sycl_compat_headers}
Expand Down
1 change: 1 addition & 0 deletions libs/core/gasnet_base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ include(HPX_AddModule)
add_hpx_module(
core gasnet_base
GLOBAL_HEADER_GEN ON
GLOBAL_HEADER_MODULE_GEN ON
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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}
Expand Down
1 change: 1 addition & 0 deletions libs/core/lcw_base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ include(HPX_AddModule)
add_hpx_module(
core lcw_base
GLOBAL_HEADER_GEN ON
GLOBAL_HEADER_MODULE_GEN ON
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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
Expand Down
2 changes: 2 additions & 0 deletions libs/core/preprocessor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copilot is correct here.

COMPAT_HEADERS ${preprocessor_compat_headers}
CMAKE_SUBDIRS tests
)
5 changes: 5 additions & 0 deletions libs/full/actions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ set(actions_headers
hpx/actions/actions_fwd.hpp
hpx/actions/base_action.hpp
hpx/actions/invoke_function.hpp
hpx/actions/macros.hpp
hpx/actions/post_helper_fwd.hpp
hpx/actions/post_helper.hpp
hpx/actions/register_action.hpp
hpx/actions/transfer_base_action.hpp
hpx/actions/transfer_action.hpp
)

set(actions_macro_headers hpx/actions/macros.hpp)

# Default location is $HPX_ROOT/libs/actions/include_compatibility
# cmake-format: off
set(actions_compat_headers
Expand All @@ -43,8 +46,10 @@ include(HPX_AddModule)
add_hpx_module(
full actions
GLOBAL_HEADER_GEN ON
GLOBAL_HEADER_MODULE_GEN ON
SOURCES ${actions_sources}
HEADERS ${actions_headers}
MACRO_HEADERS ${actions_macro_headers}
COMPAT_HEADERS ${actions_compat_headers}
MODULE_DEPENDENCIES hpx_actions_base hpx_components_base hpx_naming_base
hpx_parcelset_base
Expand Down
104 changes: 1 addition & 103 deletions libs/full/actions/include/hpx/actions/base_action.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,109 +194,7 @@ namespace hpx::serialization {
} // namespace hpx::serialization

#include <hpx/config/warnings_suffix.hpp>

// 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)
#include <hpx/actions/macros.hpp>

HPX_TRAITS_SERIALIZED_WITH_ID(hpx::actions::base_action)
HPX_TRAITS_SERIALIZED_WITH_ID(hpx::actions::base_action_data)
Expand Down
117 changes: 117 additions & 0 deletions libs/full/actions/include/hpx/actions/macros.hpp
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

Comment thread
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
1 change: 1 addition & 0 deletions libs/full/agas/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ include(HPX_AddModule)
add_hpx_module(
full agas
GLOBAL_HEADER_GEN ON
GLOBAL_HEADER_MODULE_GEN ON
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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}
Expand Down
2 changes: 2 additions & 0 deletions libs/full/agas_base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ include(HPX_AddModule)
add_hpx_module(
full agas_base
GLOBAL_HEADER_GEN ON
GLOBAL_HEADER_MODULE_GEN ON
ADD_TO_GLOBAL_HEADER hpx/agas_base/detail/bootstrap_component_namespace.hpp hpx/agas_base/detail/bootstrap_locality_namespace.hpp hpx/agas_base/detail/hosted_component_namespace.hpp hpx/agas_base/detail/hosted_locality_namespace.hpp
SOURCES ${agas_base_sources}
HEADERS ${agas_base_headers}
COMPAT_HEADERS ${agas_base_compat_headers}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#pragma once

#include <hpx/config.hpp>
#include <hpx/actions/transfer_action.hpp>
#include <hpx/modules/actions.hpp>
#include <hpx/agas_base/agas_fwd.hpp>
#include <hpx/async_distributed/base_lco_with_value.hpp>
#include <hpx/async_distributed/transfer_continuation_action.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#pragma once

#include <hpx/config.hpp>
#include <hpx/actions/transfer_action.hpp>
#include <hpx/modules/actions.hpp>
#include <hpx/agas_base/agas_fwd.hpp>
#include <hpx/async_distributed/base_lco_with_value.hpp>
#include <hpx/async_distributed/transfer_continuation_action.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#pragma once

#include <hpx/config.hpp>
#include <hpx/actions/transfer_action.hpp>
#include <hpx/modules/actions.hpp>
#include <hpx/agas_base/agas_fwd.hpp>
#include <hpx/agas_base/gva.hpp>
#include <hpx/async_distributed/base_lco_with_value.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#pragma once

#include <hpx/config.hpp>
#include <hpx/actions/transfer_action.hpp>
#include <hpx/modules/actions.hpp>
#include <hpx/agas_base/agas_fwd.hpp>
#include <hpx/async_distributed/base_lco_with_value.hpp>
#include <hpx/async_distributed/transfer_continuation_action.hpp>
Expand Down
2 changes: 2 additions & 0 deletions libs/full/async_colocated/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ include(HPX_AddModule)
add_hpx_module(
full async_colocated
GLOBAL_HEADER_GEN ON
GLOBAL_HEADER_MODULE_GEN ON
ADD_TO_GLOBAL_HEADER hpx/async_distributed/detail/async_colocated.hpp hpx/async_distributed/detail/async_colocated_callback.hpp hpx/async_distributed/detail/async_colocated_callback_fwd.hpp hpx/async_distributed/detail/async_colocated_fwd.hpp
SOURCES ${async_colocated_sources}
HEADERS ${async_colocated_headers}
COMPAT_HEADERS ${async_colocated_compat_headers}
Expand Down
Loading
Loading