CoopSync for TBB 0.1.0
Cooperative synchronization primitives for TBB resumable tasks
Loading...
Searching...
No Matches
coopsync_tbb::hip Namespace Reference

HIP integration. More...

Functions

static COOPSYNC_TBB_HIP_NODISCARDinline ::hipError_t wait_for (::hipStream_t stream)
 Suspends the current TBB task until all the work in a HIP stream completes. Internally a HIP callback is used to resume the task.
template<typename... StreamTs>
static COOPSYNC_TBB_HIP_NODISCARD std::array<::hipError_t, sizeof...(StreamTs)> wait_for_all (StreamTs... streams)
 Suspends the current TBB task until all the work in all the provided HIP streams is completed. A HIP host callback is enqueued into every stream. The calling task resumes once all callbacks that were successfully enqueued have executed. In case of duplicate streams, the callback is enqueued multiple times, and the task will resume only after all callbacks have executed.
template<typename ForwardIt, typename OutputIt>
static OutputIt wait_for_range (ForwardIt first, ForwardIt last, OutputIt out)
 Suspends the current TBB task until all the work in all the provided HIP streams completes. A HIP host callback is enqueued into every stream. The calling task resumes once all callbacks that were successfully enqueued have executed. In case of duplicate streams, the callback is enqueued multiple times, and the task will resume only after all callbacks have executed.

Detailed Description

HIP integration.

Function Documentation

◆ wait_for()

COOPSYNC_TBB_HIP_NODISCARDinline ::hipError_t coopsync_tbb::hip::wait_for ( ::hipStream_t stream)
static

Suspends the current TBB task until all the work in a HIP stream completes. Internally a HIP callback is used to resume the task.

Parameters
streamHIP stream.
Returns
The HIP error code.
Note
In case of error during callback setup, the task is resumed immediately.

◆ wait_for_all()

template<typename... StreamTs>
COOPSYNC_TBB_HIP_NODISCARD std::array<::hipError_t, sizeof...(StreamTs)> coopsync_tbb::hip::wait_for_all ( StreamTs... streams)
inlinestatic

Suspends the current TBB task until all the work in all the provided HIP streams is completed. A HIP host callback is enqueued into every stream. The calling task resumes once all callbacks that were successfully enqueued have executed. In case of duplicate streams, the callback is enqueued multiple times, and the task will resume only after all callbacks have executed.

Parameters
streamsVariadic list of HIP streams.
Returns
Array of HIP error codes. Element i corresponds to stream i.

◆ wait_for_range()

template<typename ForwardIt, typename OutputIt>
OutputIt coopsync_tbb::hip::wait_for_range ( ForwardIt first,
ForwardIt last,
OutputIt out )
inlinestatic

Suspends the current TBB task until all the work in all the provided HIP streams completes. A HIP host callback is enqueued into every stream. The calling task resumes once all callbacks that were successfully enqueued have executed. In case of duplicate streams, the callback is enqueued multiple times, and the task will resume only after all callbacks have executed.

Parameters
firstIterator to first HIP stream. Must be a LegacyForwardIterator.
lastIterator past the last HIP stream. Must be a LegacyForwardIterator.
outIterator receiving HIP error codes in the same order. Must be a LegacyOutputIterator.
Returns
Iterator past the last written error code.