-
-
Notifications
You must be signed in to change notification settings - Fork 543
Clean up stdexec-only paths and update affected tests #7123
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 59 commits
a1b0242
ed2e33b
5f8cefd
73b68db
49c50da
76377c0
b97d5c2
d936bdf
3bd1359
66cd010
bccf525
7492415
0566aad
b95a1cd
15d36e9
768590f
6b06ea1
f4472b5
8d573b2
e7da440
b1e27f2
3c10404
d209b3b
94bc3b1
7e49937
b6b5e6d
4873e85
c11b152
5fc985e
e494082
574b5cd
3027182
336b3ab
728ec6e
f753625
76865f1
e23c9f8
0f40e2a
fbfd7ce
687b64f
1703aa6
56d8e00
763afb4
92e0e59
5451901
764e826
5b9a2d9
57e2fe0
aff8789
7b79039
98b3458
d3ee92d
11c9ade
2ce2ba3
dddf55e
59ce7b7
a43f187
e3183de
32683b8
8b4f6fc
ff262f9
9743342
98e25f3
8da4996
68a1953
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 |
|---|---|---|
|
|
@@ -623,11 +623,17 @@ hpx_option( | |
|
|
||
| hpx_option( | ||
| HPX_WITH_STDEXEC BOOL | ||
| "Use STDEXEC executors instead of native HPX.(default: OFF)" OFF | ||
| "Use STDEXEC executors instead of native HPX.(default: ON)" ON | ||
| CATEGORY "Executor" | ||
| ADVANCED | ||
| ) | ||
|
|
||
| if(NOT HPX_WITH_STDEXEC) | ||
| hpx_error( | ||
| "HPX_WITH_STDEXEC=OFF is no longer supported. HPX now requires stdexec." | ||
| ) | ||
| endif() | ||
|
||
|
|
||
| hpx_option( | ||
| HPX_WITH_FETCH_STDEXEC BOOL "Use FetchContent to fetch STDEXEC.(default: ON)" | ||
| ON | ||
|
|
@@ -2065,6 +2071,13 @@ if(WIN32) | |
| # Make sure that __cplusplus is properly defined | ||
| hpx_add_target_compile_option(-Zc:__cplusplus PUBLIC) | ||
|
|
||
| # stdexec requires the conforming MSVC preprocessor. | ||
| if(NOT (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" | ||
| AND "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") | ||
| ) | ||
| hpx_add_target_compile_option(-Zc:preprocessor PUBLIC) | ||
| endif() | ||
|
|
||
| # Silence C++17 deprecation warnings | ||
| hpx_add_config_cond_define(_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,83 +10,108 @@ if(STDEXEC_ROOT AND NOT Stdexec_ROOT) | |
| unset(STDEXEC_ROOT CACHE) | ||
| endif() | ||
|
|
||
| if(HPX_WITH_STDEXEC) | ||
| # prefer HPX_WITH_FETCH_STDEXEC by default | ||
| if(Stdexec_ROOT AND HPX_WITH_FETCH_STDEXEC) | ||
| hpx_warn( | ||
| "Both Stdexec_ROOT and HPX_WITH_FETCH_STDEXEC are provided. HPX_WITH_FETCH_STDEXEC will take precedence." | ||
| if(Stdexec_ROOT AND HPX_WITH_FETCH_STDEXEC) | ||
| hpx_warn( | ||
| "Both Stdexec_ROOT and HPX_WITH_FETCH_STDEXEC are provided. HPX_WITH_FETCH_STDEXEC will take precedence." | ||
| ) | ||
| endif() | ||
|
|
||
| function(_hpx_patch_stdexec_header header) | ||
| file(READ "${header}" _content) | ||
| set(_patched_content "${_content}") | ||
|
|
||
| # clang-scan-deps used for C++ modules currently rejects apostrophe-separated | ||
| # pp-number literals in stdexec. Remove digit separators in the fetched copy | ||
| # so dependency scanning succeeds. | ||
| set(_previous_content "") | ||
| while(NOT _patched_content STREQUAL _previous_content) | ||
| set(_previous_content "${_patched_content}") | ||
| string(REGEX REPLACE "([0-9])'([0-9])" "\\1\\2" _patched_content | ||
| "${_patched_content}" | ||
| ) | ||
| endwhile() | ||
|
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 should be changed in the upstream version Please create a PR for them.
Contributor
Author
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. Fixed upstream in NVIDIA/stdexec PR #2035. |
||
|
|
||
| if(NOT _content STREQUAL _patched_content) | ||
| file(WRITE "${header}" "${_patched_content}") | ||
| endif() | ||
| endfunction() | ||
|
guptapratykshh marked this conversation as resolved.
Outdated
|
||
|
|
||
| function(_hpx_patch_stdexec_headers include_dir) | ||
| if(HPX_WITH_CXX_MODULES AND (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" | ||
| OR CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") | ||
| ) | ||
| hpx_info("Patching stdexec headers for C++ modules dependency scanning") | ||
| file(GLOB_RECURSE stdexec_headers "${include_dir}/*.hpp") | ||
| foreach(stdexec_header IN LISTS stdexec_headers) | ||
| _hpx_patch_stdexec_header("${stdexec_header}") | ||
| endforeach() | ||
| endif() | ||
| endfunction() | ||
|
|
||
| if(HPX_WITH_FETCH_STDEXEC) | ||
| hpx_info( | ||
| "HPX_WITH_FETCH_STDEXEC=${HPX_WITH_FETCH_STDEXEC}, Stdexec will be fetched using CMake's FetchContent and installed alongside HPX (HPX_WITH_STDEXEC_TAG=${HPX_WITH_STDEXEC_TAG})" | ||
| ) | ||
|
|
||
| include(FetchContent) | ||
|
guptapratykshh marked this conversation as resolved.
|
||
| fetchcontent_declare( | ||
| Stdexec | ||
| GIT_REPOSITORY https://github.com/NVIDIA/stdexec.git | ||
| GIT_TAG ${HPX_WITH_STDEXEC_TAG} | ||
| ) | ||
|
|
||
| fetchcontent_getproperties(Stdexec) | ||
| if(NOT Stdexec_POPULATED) | ||
| fetchcontent_populate(Stdexec) | ||
| endif() | ||
| set(Stdexec_ROOT ${stdexec_SOURCE_DIR}) | ||
| _hpx_patch_stdexec_headers("${stdexec_SOURCE_DIR}/include") | ||
|
|
||
| add_library(Stdexec INTERFACE) | ||
| target_include_directories( | ||
| Stdexec SYSTEM INTERFACE $<BUILD_INTERFACE:${stdexec_SOURCE_DIR}/include> | ||
| $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> | ||
| ) | ||
|
|
||
| install( | ||
| TARGETS Stdexec | ||
| EXPORT HPXStdexecTarget | ||
| COMPONENT core | ||
| ) | ||
|
|
||
| install( | ||
| DIRECTORY ${Stdexec_ROOT}/include/ | ||
| DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} | ||
| COMPONENT core | ||
| FILES_MATCHING | ||
| PATTERN "*.hpp" | ||
| ) | ||
|
|
||
| export( | ||
| TARGETS Stdexec | ||
| NAMESPACE Stdexec:: | ||
| FILE "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/${HPX_PACKAGE_NAME}/HPXStdexecTarget.cmake" | ||
| ) | ||
|
|
||
| install( | ||
| EXPORT HPXStdexecTarget | ||
| NAMESPACE Stdexec:: | ||
| FILE HPXStdexecTarget.cmake | ||
| DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${HPX_PACKAGE_NAME} | ||
| COMPONENT cmake | ||
| ) | ||
|
|
||
| hpx_add_config_define(HPX_HAVE_STDEXEC) | ||
| # TODO: Enforce a single spelling | ||
| add_library(Stdexec::Stdexec ALIAS Stdexec) | ||
| add_library(STDEXEC::stdexec ALIAS Stdexec) | ||
| else() | ||
| find_package(Stdexec) | ||
|
|
||
| if(HPX_WITH_FETCH_STDEXEC) | ||
| hpx_info( | ||
| "HPX_WITH_FETCH_STDEXEC=${HPX_WITH_FETCH_STDEXEC}, Stdexec will be fetched using CMake's FetchContent and installed alongside HPX (HPX_WITH_STDEXEC_TAG=${HPX_WITH_STDEXEC_TAG})" | ||
| if(NOT Stdexec_FOUND) | ||
| hpx_error( | ||
| "Stdexec could not be found, please specify Stdexec_ROOT to point to the correct location or enable HPX_WITH_FETCH_STDEXEC" | ||
| ) | ||
| if(UNIX) | ||
| include(FetchContent) | ||
| fetchcontent_declare( | ||
| Stdexec | ||
| GIT_REPOSITORY https://github.com/NVIDIA/stdexec.git | ||
| GIT_TAG ${HPX_WITH_STDEXEC_TAG} | ||
| ) | ||
|
|
||
| fetchcontent_getproperties(Stdexec) | ||
| if(NOT Stdexec_POPULATED) | ||
| fetchcontent_populate(Stdexec) | ||
| endif() | ||
| set(Stdexec_ROOT ${stdexec_SOURCE_DIR}) | ||
|
|
||
| add_library(Stdexec INTERFACE) | ||
| target_include_directories( | ||
| Stdexec INTERFACE $<BUILD_INTERFACE:${stdexec_SOURCE_DIR}/include> | ||
| $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> | ||
| ) | ||
|
|
||
| install( | ||
| TARGETS Stdexec | ||
| EXPORT HPXStdexecTarget | ||
| COMPONENT core | ||
| ) | ||
|
|
||
| install( | ||
| DIRECTORY ${Stdexec_ROOT}/include/ | ||
| DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} | ||
| COMPONENT core | ||
| FILES_MATCHING | ||
| PATTERN "*.hpp" | ||
| ) | ||
|
|
||
| export( | ||
| TARGETS Stdexec | ||
| NAMESPACE Stdexec:: | ||
| FILE "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/${HPX_PACKAGE_NAME}/HPXStdexecTarget.cmake" | ||
| ) | ||
|
|
||
| install( | ||
| EXPORT HPXStdexecTarget | ||
| NAMESPACE Stdexec:: | ||
| FILE HPXStdexecTarget.cmake | ||
| DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${HPX_PACKAGE_NAME} | ||
| COMPONENT cmake | ||
| ) | ||
|
|
||
| # TODO: Enforce a single spelling | ||
| add_library(Stdexec::Stdexec ALIAS Stdexec) | ||
| add_library(STDEXEC::stdexec ALIAS Stdexec) | ||
|
|
||
| endif() | ||
|
|
||
| else() | ||
| find_package(Stdexec) | ||
|
|
||
| if(Stdexec_FOUND) | ||
| hpx_add_config_define(HPX_HAVE_STDEXEC) | ||
| else() | ||
| hpx_error( | ||
| "Stdexec could not be found, please specify Stdexec_ROOT to point to the correct location or enable HPX_WITH_FETCH_STDEXEC" | ||
| ) | ||
| endif() | ||
| elseif(Stdexec_INCLUDE_DIR) | ||
| _hpx_patch_stdexec_headers("${Stdexec_INCLUDE_DIR}") | ||
|
guptapratykshh marked this conversation as resolved.
Outdated
|
||
| endif() | ||
| endif() | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,6 +87,9 @@ set(disabled_tests error_handling fibonacci_await non_atomic_rma zerocopy_rdma) | |
| if(HPX_WITH_STATIC_LINKING) | ||
| set(disabled_tests ${disabled_tests} hello_world_1) | ||
| endif() | ||
| if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|AppleClang") | ||
|
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. If disabling tests, please make sure to specify the latest compiler version that we know to fail. That will allow for the tests to be re-evaluated if a newer version will be available. |
||
| set(disabled_tests ${disabled_tests} sender_diamond) | ||
| endif() | ||
| if(HPX_WITH_DISTRIBUTED_RUNTIME) | ||
| set(disabled_tests ${disabled_tests} 1d_wave_equation) | ||
| endif() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -140,8 +140,8 @@ namespace hpx::parallel { | |
|
|
||
| HPX_CXX_CORE_EXPORT template <typename ExPolicy, typename FwdIter, | ||
| typename Sent> | ||
| hpx::future<FwdIter> shift_right_helper( | ||
| ExPolicy policy, FwdIter first, Sent last, FwdIter new_first) | ||
| hpx::future<FwdIter> shift_right_helper(ExPolicy policy, FwdIter first, | ||
| Sent last, FwdIter new_first, FwdIter result_first) | ||
| { | ||
| using non_seq = std::false_type; | ||
|
|
||
|
|
@@ -151,16 +151,15 @@ namespace hpx::parallel { | |
|
|
||
| detail::reverse<FwdIter> r; | ||
| return dataflow( | ||
| p.executor(), | ||
| [=](hpx::future<FwdIter>&& f1) mutable -> hpx::future<FwdIter> { | ||
| f1.get(); | ||
|
|
||
| hpx::future<FwdIter> f = r.call2(p, non_seq(), first, last); | ||
| return f.then( | ||
| [=](hpx::future<FwdIter>&& f) mutable -> FwdIter { | ||
| f.get(); | ||
| std::advance( | ||
| first, detail::distance(new_first, last)); | ||
| return first; | ||
| return result_first; | ||
| }); | ||
| }, | ||
| r.call2(p, non_seq(), first, new_first)); | ||
|
|
@@ -280,8 +279,10 @@ namespace hpx::parallel { | |
| } | ||
|
|
||
| auto new_first = std::next(first, dist - n); | ||
| auto result_first = std::next(first, n); | ||
| return util::detail::algorithm_result<ExPolicy, FwdIter2>::get( | ||
| shift_right_helper(policy, first, last, new_first)); | ||
| shift_right_helper( | ||
| policy, first, last, new_first, result_first)); | ||
|
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. The changes to this file seem to be unrelated. |
||
| } | ||
| }; | ||
| /// \endcond | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.