Skip to content

Commit e80a7fa

Browse files
committed
Hopefully fix most broken builds
Update the required coroutine frame sizes based on the results of the previous CI run, and exclude the `connect_awaitable` tests from compilers that lack coroutine support.
1 parent 3163082 commit e80a7fa

2 files changed

Lines changed: 37 additions & 3 deletions

File tree

include/stdexec/__detail/__connect_awaitable.hpp

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,41 @@ namespace STDEXEC
4444
// __connect_await
4545
namespace __connect_await
4646
{
47-
// four pointers' worth of space when compiling with Clang or MSVC; five with GCC
48-
static constexpr std::size_t __num_pointers = 4 * (STDEXEC_CLANG() + STDEXEC_MSVC())
49-
+ 5 * STDEXEC_GCC();
47+
# if STDEXEC_CLANG()
48+
// clang normally needs four pointer's worth of storage for the promise type
49+
// but the requirement is different when it's a CUDA compilation
50+
# if !STDEXEC_CUDA_COMPILATION()
51+
# define STDEXEC_CONNECT_AWAITABLE_NUM_POINTERS 4
52+
# elif CUDART_VERSION == 12'00'0
53+
// Clang for CUDA 12.0 only needs three pointers
54+
# define STDEXEC_CONNECT_AWAITBALE_NUM_POINTERS 3
55+
# elif CUDART_VERSION >= 12'09'0
56+
// yes, I experimentally determined this is *56* pointers
57+
# define STDEXEC_CONNECT_AWAITABLE_NUM_POINTERS 56
58+
# else
59+
# error frame size unknown for Clang with this CUDA version
60+
# endif
61+
# elif STDEXEC_GCC()
62+
// GCC needs six pointers through version 14, and five thereafter
63+
# if STDEXEC_GCC_VERSION < 15'00
64+
# define STDEXEC_CONNECT_AWAITABLE_NUM_POINTERS 6
65+
# else
66+
# define STDEXEC_CONNECT_AWAITABLE_NUM_POINTERS 5
67+
# endif
68+
# elif STDEXEC_MSVC()
69+
// this is currently a guess; I don't actually know what MSVC needs
70+
# define STDEXEC_CONNECT_AWAITABLE_NUM_POINTERS 5
71+
# else
72+
// there's no way to define a default for this
73+
# error What compiler are you using?
74+
# endif
75+
76+
static constexpr std::size_t __num_pointers = STDEXEC_CONNECT_AWAITABLE_NUM_POINTERS;
5077
static constexpr std::size_t __storage_size = __num_pointers * sizeof(void*) - 1;
5178
static constexpr std::size_t __storage_align = __STDCPP_DEFAULT_NEW_ALIGNMENT__;
5279

80+
# undef STDEXEC_CONNECT_AWAITABLE_NUM_POINTERS
81+
5382
// clang-format off
5483
template <class _Tp, class _Promise>
5584
concept __has_as_awaitable_member = requires(_Tp&& __t, _Promise& __promise)

test/stdexec/cpos/test_cpo_connect_awaitable.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17+
#include <stdexec/coroutine.hpp>
18+
19+
#if !STDEXEC_NO_STDCPP_COROUTINES()
1720

1821
#include "test_common/receivers.hpp"
1922
#include "test_common/type_helpers.hpp"
@@ -763,3 +766,5 @@ namespace
763766
}
764767
}
765768
} // namespace
769+
770+
#endif

0 commit comments

Comments
 (0)