Skip to content

Commit d7498f8

Browse files
authored
Merge branch 'main' into syssched-R6-work
2 parents 263c854 + 9514e7b commit d7498f8

96 files changed

Lines changed: 480 additions & 414 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.

.clang-tidy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ ImplementationFileExtensions:
1313
- cpp
1414
- cxx
1515
HeaderFilterRegex: ''
16-
AnalyzeTemporaryDtors: false
1716
FormatStyle: none
1817
User: eniebler
1918
CheckOptions:

.clangd

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,33 @@ If:
66

77
---
88

9-
# Apply a config conditionally to all C++ files
9+
# Apply a config conditionally to all C++ files except those in the
10+
# include/execpools directory which need platform-dependent headers
1011
If:
11-
PathMatch: .*\.(c|h)pp
12+
PathMatch: .*\.(c|h)pp$
13+
PathExclude: .*/execpools/.*
1214

1315
---
1416

1517
# Apply a config conditionally to all CUDA files
1618
If:
17-
PathMatch: .*\.cuh?
19+
PathMatch: .*\.cuh?$
1820
CompileFlags:
1921
Add:
2022
# Allow variadic CUDA functions
2123
- "-Xclang=-fcuda-allow-variadic-functions"
2224

2325
---
2426

27+
# The following file assumes a define.
28+
If:
29+
PathMatch: .*/__system_context_default_impl_entry\.hpp
30+
CompileFlags:
31+
Add:
32+
- "-DSTDEXEC_SYSTEM_CONTEXT_INLINE=inline"
33+
34+
---
35+
2536
# Use clang++ in CUDA mode to provide intellisense for files with `nvexec` in their path
2637
If:
2738
PathMatch: (include|examples|test)/nvexec.*
@@ -70,3 +81,5 @@ Diagnostics:
7081
# The NVHPC version of _NVCXX_EXPAND_PACK macro triggers this clang error.
7182
# Temporarily suppressing it, but should probably fix
7283
- "template_param_shadow"
84+
- "pp_expr_bad_token_binop" # erroneous error from STDEXEC_ENABLE_EXTRA_TYPE_CHECKING()
85+
- "#warnings"

CMakeLists.txt

Lines changed: 61 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ endif()
1818
# - Download and initialize RAPIDS CMake helpers -----------------------------
1919

2020
# Fetch rapids-cmake
21-
if(NOT EXISTS ${CMAKE_BINARY_DIR}/RAPIDS.cmake)
21+
if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/RAPIDS.cmake)
2222
file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-24.02/RAPIDS.cmake
23-
${CMAKE_BINARY_DIR}/RAPIDS.cmake)
23+
${CMAKE_CURRENT_BINARY_DIR}/RAPIDS.cmake)
2424
endif()
2525
# Initialize rapids-cmake
26-
include(${CMAKE_BINARY_DIR}/RAPIDS.cmake)
26+
include(${CMAKE_CURRENT_BINARY_DIR}/RAPIDS.cmake)
2727
# utilities for generating export set package metadata
2828
include(rapids-export)
2929
# utilities for finding packages
@@ -37,11 +37,11 @@ include(rapids-cpm)
3737
# - Project definition -------------------------------------------------------
3838

3939
# Define the project and set the version and languages
40-
if(NOT EXISTS ${CMAKE_BINARY_DIR}/execution.bs)
40+
if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/execution.bs)
4141
file(DOWNLOAD "https://raw.githubusercontent.com/cplusplus/sender-receiver/main/execution.bs"
42-
${CMAKE_BINARY_DIR}/execution.bs)
42+
${CMAKE_CURRENT_BINARY_DIR}/execution.bs)
4343
endif()
44-
file(STRINGS "${CMAKE_BINARY_DIR}/execution.bs" STD_EXECUTION_BS_REVISION_LINE REGEX "Revision: [0-9]+")
44+
file(STRINGS "${CMAKE_CURRENT_BINARY_DIR}/execution.bs" STD_EXECUTION_BS_REVISION_LINE REGEX "Revision: [0-9]+")
4545
string(REGEX REPLACE "Revision: ([0-9]+)" "\\1" STD_EXECUTION_BS_REVISION ${STD_EXECUTION_BS_REVISION_LINE})
4646

4747
# nvc++ isn't supported by (s)ccache yet, so unset these before the `project()`
@@ -151,19 +151,38 @@ set(stdexec_export_targets)
151151
# Define the main library
152152
add_library(stdexec INTERFACE)
153153

154+
file(GLOB_RECURSE exec_headers CONFIGURE_DEPENDS include/exec/*.hpp)
155+
file(GLOB_RECURSE stdexec_headers CONFIGURE_DEPENDS include/stdexec/*.hpp)
156+
target_sources(stdexec
157+
PUBLIC
158+
FILE_SET headers
159+
TYPE HEADERS
160+
BASE_DIRS include
161+
FILES
162+
${exec_headers}
163+
${stdexec_headers}
164+
# stdexec_version_config.hpp is generated by rapids' script
165+
FILE_SET version_config
166+
TYPE HEADERS
167+
BASE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/include
168+
FILES
169+
${CMAKE_CURRENT_BINARY_DIR}/include/stdexec_version_config.hpp
170+
)
154171
list(APPEND stdexec_export_targets stdexec)
155172

156173
# Set library version
157174
set_target_properties(stdexec PROPERTIES
158175
VERSION "${STDEXEC_VERSION}"
159176
SOVERSION "${STDEXEC_VERSION_MAJOR}")
160177

178+
if (BUILD_TESTING)
179+
# Test headers are self-contained
180+
set_target_properties(stdexec PROPERTIES
181+
VERIFY_INTERFACE_HEADER_SETS TRUE)
182+
endif()
183+
161184
# Declare the public include directories
162185
include(GNUInstallDirs)
163-
target_include_directories(stdexec INTERFACE
164-
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/>
165-
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
166-
)
167186

168187
target_link_libraries(stdexec INTERFACE Threads::Threads)
169188

@@ -269,9 +288,15 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC")
269288
endif()
270289

271290
if(STDEXEC_ENABLE_CUDA)
272-
273-
file(GLOB_RECURSE nvexec_sources include/nvexec/*.cuh)
274-
add_library(nvexec INTERFACE ${nvexec_sources})
291+
file(GLOB_RECURSE nvexec_headers CONFIGURE_DEPENDS include/nvexec/*.cuh)
292+
add_library(nvexec INTERFACE)
293+
target_sources(nvexec
294+
PUBLIC
295+
FILE_SET headers
296+
TYPE HEADERS
297+
BASE_DIRS include
298+
FILES ${nvexec_headers}
299+
)
275300
list(APPEND stdexec_export_targets nvexec)
276301
add_library(STDEXEC::nvexec ALIAS nvexec)
277302

@@ -283,6 +308,10 @@ if(STDEXEC_ENABLE_CUDA)
283308
target_link_options(nvexec INTERFACE
284309
$<$<AND:$<CXX_COMPILER_ID:NVHPC>,$<COMPILE_LANGUAGE:CXX>>:-stdpar -gpu=cc${CMAKE_CUDA_ARCHITECTURES}>)
285310

311+
install(TARGETS nvexec
312+
EXPORT stdexec-exports
313+
FILE_SET headers)
314+
286315
if(NOT (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC"))
287316
include(rapids-cuda)
288317
# Needs to run before `enable_language(CUDA)`
@@ -330,16 +359,29 @@ if (STDEXEC_ENABLE_TBB)
330359
INSTALL_EXPORT_SET stdexec-exports
331360
)
332361

333-
file(GLOB_RECURSE tbbpool_sources include/execpools/tbb/*.hpp)
334-
add_library(tbbpool INTERFACE ${tbbpool_sources})
362+
# CONFIGURE_DEPENDS ensures that CMake reconfigures when a relevant hpp file is
363+
# added or removed.
364+
file(GLOB_RECURSE tbbpool_headers CONFIGURE_DEPENDS include/execpools/tbb/*.hpp)
365+
add_library(tbbpool INTERFACE)
335366
list(APPEND stdexec_export_targets tbbpool)
336367
add_library(STDEXEC::tbbpool ALIAS tbbpool)
368+
target_sources(tbbpool
369+
PUBLIC
370+
FILE_SET headers
371+
TYPE HEADERS
372+
BASE_DIRS include
373+
FILES ${tbbpool_headers}
374+
)
337375

338376
target_link_libraries(tbbpool
339377
INTERFACE
340378
STDEXEC::stdexec
341379
TBB::tbb
342380
)
381+
382+
install(TARGETS tbbpool
383+
EXPORT stdexec-exports
384+
FILE_SET headers)
343385
endif()
344386

345387
option(STDEXEC_ENABLE_TASKFLOW "Enable TaskFlow targets" OFF)
@@ -436,10 +478,6 @@ endif()
436478

437479
set(SYSTEM_CONTEXT_SOURCES src/system_context/system_context.cpp)
438480
add_library(system_context STATIC ${SYSTEM_CONTEXT_SOURCES})
439-
target_include_directories(system_context PRIVATE
440-
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/>
441-
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
442-
)
443481
target_compile_features(system_context PUBLIC cxx_std_20)
444482
set_target_properties(system_context PROPERTIES
445483
CXX_STANDARD 20
@@ -449,7 +487,7 @@ target_compile_options(system_context PUBLIC
449487
$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/Zc:__cplusplus /Zc:preprocessor>
450488
)
451489
add_library(STDEXEC::system_context ALIAS system_context)
452-
490+
target_link_libraries(system_context PUBLIC stdexec)
453491

454492

455493
if(CMAKE_CROSSCOMPILING)
@@ -500,16 +538,9 @@ endif()
500538
include(CPack)
501539

502540
install(TARGETS stdexec system_context
503-
DESTINATION ${CMAKE_INSTALL_LIBDIR}
504-
EXPORT stdexec-exports)
505-
506-
install(
507-
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
508-
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
509-
510-
install(
511-
FILES ${CMAKE_CURRENT_BINARY_DIR}/include/stdexec_version_config.hpp
512-
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
541+
EXPORT stdexec-exports
542+
FILE_SET headers
543+
FILE_SET version_config)
513544

514545
##############################################################################
515546
# Install exports ------------------------------------------------------------

include/exec/__detail/__bit_cast.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#endif
2727

2828
#include <cstring>
29-
#include <type_traits>
3029

3130
namespace exec {
3231

include/exec/__detail/__bwos_lifo_queue.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include <cstddef>
2525
#include <cstdint>
2626
#include <memory>
27-
#include <new>
2827
#include <utility>
2928
#include <vector>
3029

include/exec/__detail/__numa.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@
1717
#pragma once
1818

1919
#include "../../stdexec/__detail/__config.hpp"
20-
#include "../scope.hpp"
20+
#include "../../stdexec/__detail/__meta.hpp"
21+
#include "../scope.hpp" // IWYU pragma: keep
2122

22-
#include <algorithm>
23+
#include <algorithm> // IWYU pragma: keep
2324
#include <cstddef>
2425
#include <memory>
25-
#include <new>
26+
#include <new> // IWYU pragma: keep
2627
#include <thread>
28+
#include <utility>
2729

2830
// Work around a bug in the NVHPC compilers prior to version 24.03
2931
#if STDEXEC_NVHPC()

include/exec/__detail/__system_context_default_impl_entry.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# error "STDEXEC_SYSTEM_CONTEXT_INLINE must be defined before including this header"
2222
#endif
2323

24-
#include "__system_context_default_impl.hpp"
24+
#include "__system_context_default_impl.hpp" // IWYU pragma: keep
2525

2626
#define __STDEXEC_SYSTEM_CONTEXT_API extern STDEXEC_SYSTEM_CONTEXT_INLINE STDEXEC_ATTRIBUTE((weak))
2727

include/exec/__detail/__system_context_replaceability_api.hpp

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@
1919

2020
#include "stdexec/__detail/__execution_fwd.hpp"
2121

22+
#include <cstdint>
23+
#include <exception>
2224
#include <typeindex>
25+
#include <type_traits>
2326
#include <optional>
2427

2528
struct __uuid {
26-
uint64_t __parts1;
27-
uint64_t __parts2;
29+
std::uint64_t __parts1;
30+
std::uint64_t __parts2;
2831

2932
friend bool operator==(__uuid, __uuid) noexcept = default;
3033
};
@@ -73,8 +76,8 @@ namespace exec::system_context_replaceability {
7376
extern __system_context_backend_factory<_Interface>
7477
set_system_context_backend_factory(__system_context_backend_factory<_Interface> __new_factory);
7578

76-
/// Interface for completing a sender operation.
77-
/// Backend will call frontend though this interface for completing the `schedule` and `schedule_bulk` operations.
79+
/// Interface for completing a sender operation. Backend will call frontend though this interface
80+
/// for completing the `schedule` and `schedule_bulk` operations.
7881
struct receiver {
7982
virtual ~receiver() = default;
8083

@@ -106,14 +109,14 @@ namespace exec::system_context_replaceability {
106109
/// Receiver for bulk sheduling operations.
107110
struct bulk_item_receiver : receiver {
108111
/// Called for each item of a bulk operation, possible on different threads.
109-
virtual void start(uint32_t) noexcept = 0;
112+
virtual void start(std::uint32_t) noexcept = 0;
110113
};
111114

112115
/// Describes a storage space.
113116
/// Used to pass preallocated storage from the frontend to the backend.
114117
struct storage {
115118
void* __data;
116-
uint32_t __size;
119+
std::uint32_t __size;
117120
};
118121

119122
/// Interface for the system scheduler
@@ -122,12 +125,15 @@ namespace exec::system_context_replaceability {
122125

123126
virtual ~system_scheduler() = default;
124127

125-
/// Schedule work on system scheduler, calling `__r` when done and using `__s` for preallocated memory.
128+
/// Schedule work on system scheduler, calling `__r` when done and using `__s` for preallocated
129+
/// memory.
126130
virtual void schedule(storage __s, receiver* __r) noexcept = 0;
127-
/// Schedule bulk work of size `__n` on system scheduler, calling `__r` for each item and then when done, and using `__s` for preallocated memory.
128-
virtual void bulk_schedule(uint32_t __n, storage __s, bulk_item_receiver* __r) noexcept = 0;
131+
/// Schedule bulk work of size `__n` on system scheduler, calling `__r` for each item and then
132+
/// when done, and using `__s` for preallocated memory.
133+
virtual void
134+
bulk_schedule(std::uint32_t __n, storage __s, bulk_item_receiver* __r) noexcept = 0;
129135
};
130136

131137
} // namespace exec::system_context_replaceability
132138

133-
#endif
139+
#endif

include/exec/__detail/intrusive_heap.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#include <cstddef>
2222
#include <bit>
23+
#include <utility>
2324

2425
STDEXEC_PRAGMA_PUSH()
2526
STDEXEC_PRAGMA_IGNORE_EDG(not_used_in_partial_spec_arg_list)

0 commit comments

Comments
 (0)