Skip to content

Commit 9d4cf64

Browse files
committed
fix problems exposed by eschewing static_get_completion_signatures members
1 parent 36a92fd commit 9d4cf64

19 files changed

+115
-61
lines changed

.clangd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ CompileFlags:
8080
- -profiler
8181
- -ignore-system
8282
- "-fconcepts-diagnostics-depth=*"
83+
- "-gopt"
8384
Diagnostics:
8485
Suppress:
8586
- "variadic_device_fn"

.vscode/launch.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@
7474
"args": "-v normal ${input:CUDA_TEST_TAGS}",
7575
},
7676
{
77-
"name": "maxwell_gpu_s (cuda-gdb)",
77+
"name": "maxwell_cpu_st (cuda-gdb)",
7878
"type": "cuda-gdb",
7979
"request": "launch",
8080
"stopAtEntry": false,
8181
"breakOnLaunch": false,
8282
"internalConsoleOptions": "openOnFirstSessionStart",
83-
"program": "${command:cmake.buildDirectory}/examples/nvexec/maxwell_gpu_s",
83+
"program": "${command:cmake.buildDirectory}/examples/nvexec/maxwell_cpu_st",
8484
"cwd": "${command:cmake.buildDirectory}",
85-
"args": ["--iterations=1000", "--N=512", "--run-cuda", "--run-stdpar", "--run-stream-scheduler"],
85+
"args": ["--iterations=1000", "--N=512", "--run-cpp", "--run-inline-scheduler"],
8686
},
8787
],
8888
"inputs": [

examples/nvexec/maxwell/common.cuh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ struct deleter_t {
5656
};
5757

5858
template <class T>
59-
STDEXEC_ATTRIBUTE(host, device)
6059
inline auto allocate_on(bool gpu, std::size_t elements = 1) -> std::unique_ptr<T, deleter_t> {
6160
T *ptr{};
6261

examples/nvexec/maxwell_cpu_mt.cu

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17+
// This file causes clangd to crash during parsing
18+
#if !defined(STDEXEC_CLANGD_INVOKED)
19+
1720
#include "maxwell/snr.cuh"
1821
#include "maxwell/std.cuh"
1922
#include "maxwell/stdpar.cuh" // IWYU pragma: keep
@@ -85,3 +88,5 @@ auto main(int argc, char *argv[]) -> int {
8588
}
8689
#endif
8790
}
91+
92+
#endif // !defined(STDEXEC_CLANGD_INVOKED)

examples/nvexec/maxwell_cpu_st.cu

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17+
// This file causes clangd to crash during parsing
18+
#if !defined(STDEXEC_CLANGD_INVOKED)
19+
1720
#include "maxwell/snr.cuh"
1821
#include "maxwell/cpp.cuh"
1922

@@ -65,3 +68,5 @@ auto main(int argc, char *argv[]) -> int {
6568
run_cpp(dt, write_vtk, n_iterations, grid, "CPU (cpp)");
6669
}
6770
}
71+
72+
#endif // !defined(STDEXEC_CLANGD_INVOKED)

examples/nvexec/maxwell_distributed.cu

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17+
// This file causes clangd to crash during parsing
18+
#if !defined(STDEXEC_CLANGD_INVOKED)
19+
1720
#include "maxwell/snr.cuh" // IWYU pragma: keep
1821
#include "nvexec/stream_context.cuh" // IWYU pragma: keep
1922

@@ -512,7 +515,7 @@ auto main(int argc, char *argv[]) -> int {
512515
}
513516

514517
write();
515-
# else
518+
# else // ^^ defined(OVERLAP) ^^ // vv !defined(OVERLAP) vv
516519
for (std::size_t compute_step = 0; compute_step < n_iterations; compute_step++) {
517520
auto compute_h =
518521
ex::just()
@@ -531,7 +534,7 @@ auto main(int argc, char *argv[]) -> int {
531534
}
532535

533536
write();
534-
# endif
537+
# endif // defined(OVERLAP)
535538

536539
MPI_Barrier(MPI_COMM_WORLD);
537540
const auto end = std::chrono::system_clock::now();
@@ -550,3 +553,5 @@ auto main(int argc, char *argv[]) -> int {
550553
MPI_Finalize();
551554
}
552555
#endif
556+
557+
#endif // !defined(STDEXEC_CLANGD_INVOKED)

examples/nvexec/maxwell_gpu_m.cu

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17+
// This file causes clangd to crash during parsing
18+
#if !defined(STDEXEC_CLANGD_INVOKED)
19+
1720
#include "maxwell/snr.cuh"
1821

1922
auto main(int argc, char *argv[]) -> int {
@@ -52,3 +55,5 @@ auto main(int argc, char *argv[]) -> int {
5255
nvexec::multi_gpu_stream_context stream_context{};
5356
run_snr_on("GPU (multi-GPU)", stream_context.get_scheduler());
5457
}
58+
59+
#endif // !defined(STDEXEC_CLANGD_INVOKED)

examples/nvexec/maxwell_gpu_s.cu

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17+
// This file causes clangd to crash during parsing
18+
#if !defined(STDEXEC_CLANGD_INVOKED)
19+
1720
#include "maxwell/snr.cuh"
1821
#include "maxwell/stdpar.cuh" // IWYU pragma: keep
1922
#include "maxwell/cuda.cuh"
@@ -79,5 +82,7 @@ auto main(int argc, char *argv[]) -> int {
7982

8083
run_stdpar(dt, write_vtk, n_iterations, grid, stdexec::par_unseq, method);
8184
}
82-
#endif
85+
#endif // STDEXEC_HAS_PARALLEL_ALGORITHMS()
8386
}
87+
88+
#endif // !defined(STDEXEC_CLANGD_INVOKED)

include/exec/sequence/merge_each.hpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include "../../stdexec/__detail/__senders_core.hpp"
3333
#include "../../stdexec/__detail/__stop_token.hpp"
3434
#include "../../stdexec/__detail/__transform_completion_signatures.hpp"
35-
#include "../../stdexec/__detail/__unstoppable.hpp"
3635
#include "../../stdexec/__detail/__variant.hpp"
3736

3837
#include <atomic>
@@ -240,7 +239,7 @@ namespace exec {
240239

241240
__operation_base_interface_t* __op_;
242241

243-
template <std::same_as<__t> _Self, class... _Env>
242+
template <class _Self, class... _Env>
244243
STDEXEC_EXPLICIT_THIS_BEGIN(
245244
auto get_completion_signatures)(this _Self&&, _Env&&...) noexcept
246245
-> stdexec::__mapply<
@@ -252,8 +251,9 @@ namespace exec {
252251
> {
253252
return {};
254253
}
254+
STDEXEC_EXPLICIT_THIS_END(get_completion_signatures)
255255

256-
template <std::same_as<__t> _Self, receiver _ErrorReceiver>
256+
template <class _Self, receiver _ErrorReceiver>
257257
STDEXEC_EXPLICIT_THIS_BEGIN(auto connect)(this _Self&& __self, _ErrorReceiver&& __rcvr)
258258
noexcept(__nothrow_move_constructible<_ErrorReceiver>)
259259
-> __error_op_t<stdexec::__id<_ErrorReceiver>> {
@@ -607,7 +607,7 @@ namespace exec {
607607
_NestedValueSender __nested_value_;
608608
__operation_base_interface_t* __op_;
609609

610-
template <std::same_as<__t> _Self, class... _Env>
610+
template <class _Self, class... _Env>
611611
STDEXEC_EXPLICIT_THIS_BEGIN(
612612
auto get_completion_signatures)(this _Self&&, _Env&&...) noexcept
613613
-> stdexec::transform_completion_signatures<
@@ -618,8 +618,9 @@ namespace exec {
618618
> {
619619
return {};
620620
}
621+
STDEXEC_EXPLICIT_THIS_END(get_completion_signatures)
621622

622-
template <std::same_as<__t> _Self, receiver _NestedValueReceiver>
623+
template <class _Self, receiver _NestedValueReceiver>
623624
STDEXEC_EXPLICIT_THIS_BEGIN(
624625
auto connect)(this _Self&& __self, _NestedValueReceiver&& __rcvr)
625626
noexcept(__nothrow_constructible_from<
@@ -1072,14 +1073,16 @@ namespace exec {
10721073
_OperationBase* __op_;
10731074
_NestedSequenceSender __nested_sequence_;
10741075

1075-
template <std::same_as<__t> _Self, class... _Env>
1076+
template <class _Self, class... _Env>
10761077
STDEXEC_EXPLICIT_THIS_BEGIN(
10771078
auto get_completion_signatures)(this _Self&&, _Env&&...) noexcept
10781079
-> stdexec::completion_signatures<stdexec::set_value_t(), stdexec::set_stopped_t()> {
10791080
return {};
10801081
}
1082+
STDEXEC_EXPLICIT_THIS_END(get_completion_signatures)
10811083

1082-
template <std::same_as<__t> _Self, receiver _NextReceiver>
1084+
1085+
template <class _Self, receiver _NextReceiver>
10831086
STDEXEC_EXPLICIT_THIS_BEGIN(auto connect)(this _Self&& __self, _NextReceiver&& __rcvr)
10841087
noexcept(__nothrow_constructible_from<
10851088
__next_sequence_op_t<stdexec::__id<_NextReceiver>>,

include/exec/when_any.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,6 @@ namespace exec {
274274
template <class _Self, class... _Env>
275275
STDEXEC_EXPLICIT_THIS_BEGIN(
276276
auto get_completion_signatures)(this _Self&&, const _Env&...) noexcept {
277-
static_assert(__decay_copyable<_Self>);
278-
static_assert(
279-
(__decay_copyable<__copy_cvref_t<_Self, stdexec::__t<_SenderIds>>> && ...),
280-
"All senders passed to when_any must be copyable.");
281277
return __mexception<
282278
_SENDER_TYPE_IS_NOT_COPYABLE_,
283279
_WITH_SENDERS_<stdexec::__t<_SenderIds>>...

0 commit comments

Comments
 (0)