Skip to content

Commit be07d47

Browse files
authored
add some c++23 jobs to the CI job matrix (#1884)
1 parent 4f0a4b2 commit be07d47

File tree

7 files changed

+41
-20
lines changed

7 files changed

+41
-20
lines changed

.github/workflows/ci.cpu.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,17 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
include:
22-
- { name: "CPU (clang 16, Debug)", build: "Debug", tag: llvm16-cuda12.9, cxxflags: "-stdlib=libc++" }
23-
- { name: "CPU (clang 16, Release)", build: "Release", tag: llvm16-cuda12.9, cxxflags: "-stdlib=libc++" }
24-
- { name: "CPU (clang 16, Release, ASAN)", build: "Release", tag: llvm16-cuda12.9, cxxflags: "-stdlib=libc++ -fsanitize=address -fsanitize-ignorelist=/home/coder/stdexec/sanitizer-ignorelist.txt" }
25-
- { name: "CPU (gcc 11, Debug)", build: "Debug", tag: gcc11-cuda12.9, cxxflags: "", }
26-
- { name: "CPU (gcc 11, Release)", build: "Release", tag: gcc11-cuda12.9, cxxflags: "", }
27-
- { name: "CPU (gcc 11, Release, ASAN)", build: "Release", tag: gcc11-cuda12.9, cxxflags: "-fsanitize=address" }
28-
- { name: "CPU (gcc 12, Release, TSAN)", build: "Release", tag: gcc12-cuda12.9, cxxflags: "-fsanitize=thread" }
29-
- { name: "CPU (gcc 13, Debug)", build: "Release", tag: gcc13-cuda12.9, cxxflags: "", }
30-
- { name: "CPU (gcc 14, Release, LEAK)", build: "Release", tag: gcc14-cuda12.9, cxxflags: "-fsanitize=leak", }
22+
- { name: "CPU (clang 16, Debug)", build: "Debug", tag: llvm16-cuda12.9, cxxstd: "20", cxxflags: "-stdlib=libc++" }
23+
- { name: "CPU (clang 16, Debug, c++23)", build: "Debug", tag: llvm16-cuda12.9, cxxstd: "23", cxxflags: "-stdlib=libc++" }
24+
- { name: "CPU (clang 16, Release)", build: "Release", tag: llvm16-cuda12.9, cxxstd: "20", cxxflags: "-stdlib=libc++" }
25+
- { name: "CPU (clang 16, Release, ASAN)", build: "Release", tag: llvm16-cuda12.9, cxxstd: "20", cxxflags: "-stdlib=libc++ -fsanitize=address -fsanitize-ignorelist=/home/coder/stdexec/sanitizer-ignorelist.txt" }
26+
- { name: "CPU (gcc 11, Debug)", build: "Debug", tag: gcc11-cuda12.9, cxxstd: "20", cxxflags: "", }
27+
- { name: "CPU (gcc 11, Release)", build: "Release", tag: gcc11-cuda12.9, cxxstd: "20", cxxflags: "", }
28+
- { name: "CPU (gcc 11, Release, ASAN)", build: "Release", tag: gcc11-cuda12.9, cxxstd: "20", cxxflags: "-fsanitize=address" }
29+
- { name: "CPU (gcc 12, Release, TSAN)", build: "Release", tag: gcc12-cuda12.9, cxxstd: "20", cxxflags: "-fsanitize=thread" }
30+
- { name: "CPU (gcc 13, Debug)", build: "Release", tag: gcc13-cuda12.9, cxxstd: "20", cxxflags: "", }
31+
- { name: "CPU (gcc 14, Release, LEAK)", build: "Release", tag: gcc14-cuda12.9, cxxstd: "20", cxxflags: "-fsanitize=leak", }
32+
- { name: "CPU (gcc 14, Release, c++23)", build: "Release", tag: gcc14-cuda12.9, cxxstd: "23", cxxflags: "", }
3133
container:
3234
options: -u root
3335
image: rapidsai/devcontainers:26.02-cpp-${{ matrix.tag }}
@@ -100,6 +102,8 @@ jobs:
100102
-DSTDEXEC_ENABLE_TBB:BOOL=${{ !contains(matrix.cxxflags, '-fsanitize') }} \
101103
-DSTDEXEC_ENABLE_ASIO:BOOL=TRUE \
102104
-DSTDEXEC_ASIO_IMPLEMENTATION:STRING=boost \
105+
-DCMAKE_CXX_STANDARD=${{ matrix.cxxstd }} \
106+
-DCMAKE_CXX_EXTENSIONS=OFF \
103107
;
104108
105109
# Compile

include/exec/async_scope.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ namespace experimental::execution
498498

499499
~__future_state_base()
500500
{
501+
[[maybe_unused]]
501502
std::unique_lock __guard{__mutex_};
502503
if (__step_ == __future_step::__created)
503504
{
@@ -511,11 +512,12 @@ namespace experimental::execution
511512
}
512513
}
513514

514-
constexpr void __step_from_to_(std::unique_lock<std::mutex>& __guard,
515-
__future_step __from,
516-
__future_step __to)
515+
constexpr void __step_from_to_([[maybe_unused]] std::unique_lock<std::mutex>& __guard,
516+
[[maybe_unused]] __future_step __from,
517+
__future_step __to)
517518
{
518519
STDEXEC_ASSERT(__guard.owns_lock());
520+
[[maybe_unused]]
519521
auto actual = std::exchange(__step_, __to);
520522
STDEXEC_ASSERT(actual == __from);
521523
}

include/exec/linux/io_uring_context.hpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
# include <linux/io_uring.h>
2323

2424
# include "../../stdexec/__detail/__atomic.hpp"
25+
# include "../../stdexec/__detail/__utility.hpp"
2526
# include "../../stdexec/execution.hpp"
2627
# include "../timed_scheduler.hpp"
2728

@@ -1109,7 +1110,9 @@ namespace experimental::execution
11091110
auto secs = std::chrono::duration_cast<std::chrono::seconds>(dur);
11101111
dur -= secs;
11111112
secs = (std::max) (secs, std::chrono::seconds{0});
1112-
dur = std::clamp(dur, std::chrono::nanoseconds{0}, std::chrono::nanoseconds{999'999'999});
1113+
dur = STDEXEC::__clamp(dur,
1114+
std::chrono::nanoseconds{0},
1115+
std::chrono::nanoseconds{999'999'999});
11131116
return __kernel_timespec{secs.count(), dur.count()};
11141117
}
11151118
# else
@@ -1125,9 +1128,9 @@ namespace experimental::execution
11251128
__nsec = std::chrono::nanoseconds{__timerspec.it_value.tv_nsec} + __nsec;
11261129
auto __sec = std::chrono::duration_cast<std::chrono::seconds>(__nsec);
11271130
__nsec -= __sec;
1128-
__nsec = std::clamp(__nsec,
1129-
std::chrono::nanoseconds{0},
1130-
std::chrono::nanoseconds{999'999'999});
1131+
__nsec = STDEXEC::__clamp(__nsec,
1132+
std::chrono::nanoseconds{0},
1133+
std::chrono::nanoseconds{999'999'999});
11311134
__timerspec.it_value.tv_sec += __sec.count();
11321135
__timerspec.it_value.tv_nsec = __nsec.count();
11331136
STDEXEC_ASSERT(0 <= __timerspec.it_value.tv_nsec

include/stdexec/__detail/__any.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
#include <type_traits>
3333
#include <utility>
3434

35+
STDEXEC_PRAGMA_PUSH()
36+
STDEXEC_PRAGMA_IGNORE_GNU("-Wredundant-consteval-if")
37+
3538
namespace STDEXEC::__any
3639
{
3740

@@ -1698,10 +1701,9 @@ namespace STDEXEC::__any
16981701
if (__empty(__other))
16991702
{
17001703
return;
1701-
// NOLINTNEXTLINE(bugprone-branch-clone)
17021704
}
17031705
else if constexpr (_Other::__root_kind == __root_kind::__reference || !__ptr_convertible)
1704-
{
1706+
{ // NOLINT(bugprone-branch-clone)
17051707
return __other.__slice_to_(*this);
17061708
}
17071709
else if (__other.__in_situ_())
@@ -2012,3 +2014,5 @@ namespace STDEXEC::__any
20122014
};
20132015

20142016
} // namespace STDEXEC::__any
2017+
2018+
STDEXEC_PRAGMA_POP()

include/stdexec/__detail/__config.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ namespace STDEXEC
612612

613613
#define STDEXEC_ASSERT(_XP) \
614614
do { \
615-
static_assert(noexcept(_XP)); \
615+
/*static_assert(noexcept(_XP));*/ \
616616
STDEXEC_ASSERT_FN(_XP); \
617617
} while (false)
618618

include/stdexec/__detail/__task.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ namespace STDEXEC
103103
// promise object. We now use that allocator to deallocate the entire block of
104104
// memory:
105105
size_t const __promise_blocks = __task::__divmod(__bytes, sizeof(__memblock));
106-
void* const __alloc_loc = static_cast<__memblock*>(__ptr) + __promise_blocks;
106+
[[maybe_unused]]
107+
void* const __alloc_loc = static_cast<__memblock*>(__ptr) + __promise_blocks;
107108
// the number of blocks needed to store an object of type __palloc_t:
108109
static constexpr size_t __alloc_blocks =
109110
__task::__divmod(sizeof(__task::__any_alloc<_PAlloc>), sizeof(__task::__memblock));

include/stdexec/__detail/__utility.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,13 @@ namespace STDEXEC
196196
return static_cast<__copy_cvref_t<_Ty&&, STDEXEC_REMOVE_REFERENCE(_Uy)>>(__uy);
197197
}
198198

199+
template <class _Ty>
200+
constexpr _Ty const & __clamp(_Ty const & v, _Ty const & lo, _Ty const & hi)
201+
{
202+
STDEXEC_ASSERT(!(hi < lo));
203+
return v < lo ? lo : hi < v ? hi : v; // NOLINT(bugprone-return-const-ref-from-parameter)
204+
}
205+
199206
STDEXEC_PRAGMA_PUSH()
200207
STDEXEC_PRAGMA_IGNORE_GNU("-Wold-style-cast")
201208

0 commit comments

Comments
 (0)