Skip to content

Commit d944106

Browse files
authored
Merge pull request #1081 from NVIDIA/let-completion-scheduler
in `let_[value|error|stopped]` the result sender sees the input sender's completion scheduler as the current scheduler
2 parents beb0190 + db739f6 commit d944106

7 files changed

Lines changed: 284 additions & 140 deletions

File tree

include/exec/env.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
#endif
2424

2525
namespace exec {
26-
template <class... _TagValue>
27-
using with_t = stdexec::__with<_TagValue...>;
26+
template <class _Tag, class _Value = stdexec::__none_such>
27+
using with_t = stdexec::__with<_Tag, _Value>;
2828

2929
namespace __detail {
3030
struct __with_t {

include/exec/task.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
#include "scope.hpp"
3232

3333
STDEXEC_PRAGMA_PUSH()
34-
STDEXEC_PRAGMA_IGNORE("-Wpragmas")
35-
STDEXEC_PRAGMA_IGNORE("-Wundefined-inline")
34+
STDEXEC_PRAGMA_IGNORE_GNU("-Wpragmas")
35+
STDEXEC_PRAGMA_IGNORE_GNU("-Wundefined-inline")
3636

3737
namespace exec {
3838
namespace __task {

include/stdexec/__detail/__config.hpp

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
#define STDEXEC_NVCC() 1
5555
#elif defined(__NVCOMPILER)
5656
#define STDEXEC_NVHPC() 1
57+
#elif defined(__EDG__)
58+
#define LEGATE_EDG() 1
5759
#elif defined(__clang__)
5860
#define STDEXEC_CLANG() 1
5961
#elif defined(__GNUC__)
@@ -68,6 +70,9 @@
6870
#ifndef STDEXEC_NVHPC
6971
#define STDEXEC_NVHPC() 0
7072
#endif
73+
#ifndef STDEXEC_EDG
74+
#define STDEXEC_EDG() 0
75+
#endif
7176
#ifndef STDEXEC_CLANG
7277
#define STDEXEC_CLANG() 0
7378
#endif
@@ -78,15 +83,31 @@
7883
#define STDEXEC_MSVC() 0
7984
#endif
8085

81-
#if STDEXEC_CLANG() || STDEXEC_GCC()
8286
#define STDEXEC_STRINGIZE(_ARG) #_ARG
87+
88+
#if STDEXEC_NVCC()
89+
#define STDEXEC_PRAGMA_PUSH() _Pragma("nv_diagnostic push")
90+
#define STDEXEC_PRAGMA_POP() _Pragma("nv_diagnostic pop")
91+
#define STDEXEC_PRAGMA_IGNORE_EDG(...) _Pragma(STDEXEC_STRINGIZE(nv_diag_suppress __VA_ARGS__))
92+
#elif STDEXEC_NVHPC() || STDEXEC_EDG()
93+
#define STDEXEC_PRAGMA_PUSH() \
94+
_Pragma("diagnostic push") STDEXEC_PRAGMA_IGNORE_EDG(invalid_error_number)
95+
#define STDEXEC_PRAGMA_POP() _Pragma("diagnostic pop")
96+
#define STDEXEC_PRAGMA_IGNORE_EDG(...) _Pragma(STDEXEC_STRINGIZE(diag_suppress __VA_ARGS__))
97+
#elif STDEXEC_CLANG() || STDEXEC_GCC()
8398
#define STDEXEC_PRAGMA_PUSH() _Pragma("GCC diagnostic push")
8499
#define STDEXEC_PRAGMA_POP() _Pragma("GCC diagnostic pop")
85-
#define STDEXEC_PRAGMA_IGNORE(_ARG) _Pragma(STDEXEC_STRINGIZE(GCC diagnostic ignored _ARG))
100+
#define STDEXEC_PRAGMA_IGNORE_GNU(_ARG) _Pragma(STDEXEC_STRINGIZE(GCC diagnostic ignored _ARG))
86101
#else
87102
#define STDEXEC_PRAGMA_PUSH()
88103
#define STDEXEC_PRAGMA_POP()
89-
#define STDEXEC_PRAGMA_IGNORE(_ARG)
104+
#endif
105+
106+
#ifndef STDEXEC_PRAGMA_IGNORE_GNU
107+
#define STDEXEC_PRAGMA_IGNORE_GNU(_ARG)
108+
#endif
109+
#ifndef STDEXEC_PRAGMA_IGNORE_EDG
110+
#define STDEXEC_PRAGMA_IGNORE_EDG(_ARG)
90111
#endif
91112

92113
#if !STDEXEC_MSVC() && defined(__has_builtin)

include/stdexec/__detail/__execution_fwd.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,6 @@ namespace stdexec {
123123
using __get_completion_signatures::get_completion_signatures_t;
124124
extern const get_completion_signatures_t get_completion_signatures;
125125

126-
template <class _Sender, class _Env>
127-
using __completion_signatures_of_t = __call_result_t< get_completion_signatures_t, _Sender, _Env>;
128-
129126
//////////////////////////////////////////////////////////////////////////////////////////////////
130127
namespace __connect {
131128
struct connect_t;

include/stdexec/__detail/__meta.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,12 @@ namespace stdexec {
351351
requires(sizeof...(_False) <= 1)
352352
using __if_c = __minvoke<__if_::__<_Pred>, _True, _False...>;
353353

354+
template <class _Pred, class _True, class... _False>
355+
using __minvoke_if = __minvoke<__if<_Pred, _True, _False...>>;
356+
357+
template <bool _Pred, class _True, class... _False>
358+
using __minvoke_if_c = __minvoke<__if_c<_Pred, _True, _False...>>;
359+
354360
template <class _Tp>
355361
struct __mconst {
356362
template <class...>
@@ -372,6 +378,9 @@ namespace stdexec {
372378
template <class _Fn, class _Default>
373379
using __with_default = __mtry_catch<_Fn, __mconst<_Default>>;
374380

381+
template <template <class...> class _Fn, class _Default>
382+
using __with_default_q = __mtry_catch_q<_Fn, __mconst<_Default>>;
383+
375384
inline constexpr __mstring __mbad_substitution =
376385
"The specified meta-function could not be evaluated with the types provided."__csz;
377386

0 commit comments

Comments
 (0)