Skip to content

Commit 35bd323

Browse files
authored
Merge pull request #6817 from STEllAR-GROUP/cuda_modules
Adapting HPX CUDA modules to C++ modules
2 parents b3ed893 + b735a4f commit 35bd323

359 files changed

Lines changed: 3071 additions & 3021 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,6 +1407,9 @@ if((HPX_WITH_NETWORKING AND HPX_WITH_PARCELPORT_MPI)
14071407
# hpx_add_compile_flag() below does not add the extra options to the top
14081408
# level directory
14091409
hpx_add_config_define(OMPI_IMPORTS)
1410+
if(HPX_WITH_CUDA)
1411+
hpx_add_config_cond_define(NOMINMAX)
1412+
endif()
14101413
endif()
14111414
endif()
14121415

cmake/HPX_AddModule.cmake

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,9 @@ function(add_hpx_module libname modulename)
351351
)
352352
set(generated_headers ${generated_headers} ${cache_line_size_file})
353353

354-
# Generate an empty placeholder file for hpx/config/std_headers.hpp This
355-
# will be overwritten in libs/CMakeLists.txt with some real content.
354+
# Generate empty placeholder files for hpx/config/std_headers.hpp and
355+
# hpx/config/modules_enabled.hpp. Those will be overwritten in
356+
# libs/CMakeLists.txt with some real content.
356357
if(HPX_WITH_CXX_MODULES)
357358
set(std_header_file
358359
"${CMAKE_CURRENT_BINARY_DIR}/include/hpx/config/std_headers.hpp"
@@ -361,6 +362,11 @@ function(add_hpx_module libname modulename)
361362
set(generated_headers ${generated_headers} ${std_header_file})
362363
endif()
363364

365+
set(modules_enabled_file
366+
"${CMAKE_CURRENT_BINARY_DIR}/include/hpx/config/modules_enabled.hpp"
367+
)
368+
file(WRITE ${modules_enabled_file} "")
369+
set(generated_headers ${generated_headers} ${modules_enabled_file})
364370
endif()
365371

366372
# collect zombie generated headers

cmake/templates/std_headers.hpp.in

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
#include <hpx/config/modules_enabled.hpp>
1515

1616
@cxx_standard_headers@
17-
// Some standard headers include the following headers.
18-
#include <numeric>
19-
2017
#if defined(HPX_HAVE_STDEXEC)
2118
# if defined(HPX_GCC_VERSION)
2219
# pragma GCC diagnostic push
@@ -95,8 +92,33 @@
9592
// Include LCI headers if required
9693
#if (defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_PARCELPORT_LCI)) || \
9794
defined(HPX_HAVE_MODULE_LCI_BASE)
98-
9995
# include "lci.hpp"
10096
# include "lct.h"
97+
#endif
10198

99+
#if defined(HPX_HAVE_MODULE_THRUST)
100+
# include <hpx/thrust/thrust_headers.hpp>
101+
#endif
102+
103+
#if defined(HPX_HAVE_MM_PREFETCH)
104+
# if defined(HPX_MSVC)
105+
# include <intrin.h>
106+
# endif
107+
# if defined(HPX_GCC_VERSION)
108+
# include <emmintrin.h>
109+
# endif
110+
#endif
111+
112+
#if defined(HPX_HAVE_DATAPAR)
113+
# if defined(HPX_HAVE_DATAPAR_EVE)
114+
# include <eve/eve.hpp>
115+
# include <eve/memory/aligned_ptr.hpp>
116+
# endif
117+
# if defined(HPX_HAVE_DATAPAR_STD_EXPERIMENTAL_SIMD)
118+
# include <experimental/simd>
119+
# endif
120+
# if defined(HPX_HAVE_DATAPAR_VC)
121+
# include <Vc/Vc>
122+
# include <Vc/global.h>
123+
# endif
102124
#endif

components/component_storage/include/hpx/components/component_storage/component_storage.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
#include <hpx/config.hpp>
1010
#include <hpx/components/client_base.hpp>
11-
#include <hpx/modules/futures.hpp>
1211
#include <hpx/modules/async_base.hpp>
12+
#include <hpx/modules/futures.hpp>
1313
#include <hpx/naming_base/address.hpp>
1414
#include <hpx/naming_base/id_type.hpp>
1515

components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_segmented_iterator.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
// http://lafstern.org/matt/segmented.pdf.
1515

1616
#include <hpx/config.hpp>
17-
#include <hpx/algorithms/traits/is_value_proxy.hpp>
18-
#include <hpx/algorithms/traits/segmented_iterator_traits.hpp>
1917
#include <hpx/assert.hpp>
18+
#include <hpx/modules/algorithms.hpp>
2019
#include <hpx/modules/async_base.hpp>
2120
#include <hpx/modules/iterator_support.hpp>
2221
#include <hpx/naming_base/id_type.hpp>

components/containers/partitioned_vector/tests/unit/partitioned_vector_view.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
#include <hpx/collectives/spmd_block.hpp>
1010
#include <hpx/components/containers/partitioned_vector/partitioned_vector_local_view.hpp>
1111
#include <hpx/components/containers/partitioned_vector/partitioned_vector_view.hpp>
12-
#include <hpx/modules/executors.hpp>
1312
#include <hpx/hpx_main.hpp>
1413
#include <hpx/include/partitioned_vector_predef.hpp>
1514
#include <hpx/include/partitioned_vector_view.hpp>
15+
#include <hpx/modules/executors.hpp>
1616
#include <hpx/modules/testing.hpp>
1717
#include <hpx/runtime_distributed/find_all_localities.hpp>
1818

docs/sphinx/manual/creating_hpx_projects.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,12 @@ implicitly using ``main()`` as the entry point. If you want the same wrapping
265265
behavior without including :hpx-header:`wrap/include,hpx/hpx_main.hpp`, link to
266266
the ``HPX::auto_wrap_main`` target instead. This enables the runtime
267267
initialization around ``main()`` unconditionally and is useful for codebases
268-
where adding the header to ``main.cpp`` is impractical.
268+
where adding the header to ``main.cpp`` is impractical
269+
270+
.. note::
271+
272+
The use of ``HPX::auto_wrap_main`` is not supported when using the
273+
native Windows MSVC toolchain.
269274

270275
If you want to use the facilities exposed by ``hpx::runtime_manager`` in binaries
271276
that were not linked as executables (e.g., in shared libraries), you will need

docs/sphinx/manual/executors.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Parallel Executor
5353
.. code-block:: c++
5454

5555
#include <hpx/execution.hpp>
56-
#include <hpx/parallel/algorithms/for_each.hpp>
56+
#include <hpx/algorithm.hpp>
5757
#include <vector>
5858

5959
std::vector<int> data(100, 1);
@@ -77,7 +77,7 @@ Fork-Join Executor
7777
.. code-block:: c++
7878

7979
#include <hpx/execution.hpp>
80-
#include <hpx/parallel/algorithms/for_each.hpp>
80+
#include <hpx/algorithm.hpp>
8181
#include <vector>
8282

8383
std::vector<int> data(100, 1);
@@ -103,7 +103,7 @@ Sequential Executor
103103
.. code-block:: c++
104104

105105
#include <hpx/execution.hpp>
106-
#include <hpx/parallel/algorithms/for_each.hpp>
106+
#include <hpx/algorithm.hpp>
107107
#include <vector>
108108

109109
std::vector<int> data(100, 1);

docs/sphinx/manual/starting_the_hpx_runtime.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ you cannot or do not want to include ``hpx/hpx_main.hpp`` in ``main.cpp``, you
5959
can instead link against ``HPX::auto_wrap_main``. That target enables the same
6060
runtime startup path without needing the header-triggered opt-in.
6161

62+
.. note::
63+
64+
The use of ``HPX::auto_wrap_main`` is not supported when using the
65+
native Windows MSVC toolchain.
6266

6367
.. note::
6468

examples/quickstart/sort_by_key_demo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
// Distributed under the Boost Software License, Version 1.0. (See accompanying
55
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
66

7+
#include <hpx/algorithm.hpp>
78
#include <hpx/execution.hpp>
89
#include <hpx/init.hpp>
9-
#include <hpx/parallel/algorithms/sort_by_key.hpp>
1010

1111
#include <cstddef>
1212
#include <iostream>

0 commit comments

Comments
 (0)