Skip to content

Commit f13080a

Browse files
Assert pipeline is active
1 parent f42d0e6 commit f13080a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

libcudacxx/include/cuda/pipeline

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ public:
135135
return __released;
136136
}
137137

138+
_CCCL_API inline bool __is_active() const
139+
{
140+
return __active;
141+
}
142+
138143
_CCCL_API inline void producer_acquire()
139144
{
140145
barrier<_Scope>& __stage_barrier = __shared_state_get_stage(__head)->__consumed;
@@ -487,6 +492,11 @@ template <typename _Group, class _Tp, typename _Size, thread_scope _Scope>
487492
_CCCL_API inline async_contract_fulfillment __memcpy_async_pipeline(
488493
_Group const& __group, _Tp* __destination, _Tp const* __source, _Size __size, pipeline<_Scope>& __pipeline)
489494
{
495+
if constexpr (_Scope != thread_scope_thread)
496+
{
497+
_CCCL_ASSERT(__pipeline.__is_active(), "The pipeline used for memcpy_async must be active (not quitted)");
498+
}
499+
490500
// 1. Set the completion mechanisms that can be used.
491501
//
492502
// Do not (yet) allow async_bulk_group completion. Do not allow

0 commit comments

Comments
 (0)