1 #ifndef HeterogeneousCore_CUDACore_ScopedContext_h 2 #define HeterogeneousCore_CUDACore_ScopedContext_h 19 class TestScopedContext;
69 template <
typename... Args>
72 void synchronizeStreams(
int dataDevice, cudaStream_t dataStream,
bool available, cudaEvent_t dataEvent);
125 template <
typename F>
164 template <
typename T>
170 template <
typename T,
typename... Args>
202 template <
typename F>
229 template <
typename F>
ScopedContextAcquire(edm::StreamID streamID, edm::WaitingTaskWithArenaHolder waitingTaskHolder)
Constructor to create a new CUDA stream (no need for context beyond acquire())
ScopedContextTask(ContextState const *state, edm::WaitingTaskWithArenaHolder waitingTaskHolder)
Constructor to re-use the CUDA stream of acquire() (ExternalWork module)
std::shared_ptr< std::remove_pointer_t< cudaEvent_t > > SharedEventPtr
ScopedContextGetterBase(Args &&... args)
void synchronizeStreams(int dataDevice, cudaStream_t dataStream, bool available, cudaEvent_t dataEvent)
ScopedContextHolderHelper(edm::WaitingTaskWithArenaHolder waitingTaskHolder)
void pushNextTask(F &&f, ContextState const *state)
std::shared_ptr< std::remove_pointer_t< cudaStream_t > > SharedStreamPtr
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
ScopedContextAnalyze(const ProductBase &data)
Constructor to (possibly) re-use a CUDA stream.
ContextState * contextState_
void replaceWaitingTaskHolder(edm::WaitingTaskWithArenaHolder waitingTaskHolder)
void replaceWaitingTaskHolder(edm::WaitingTaskWithArenaHolder waitingTaskHolder)
oneapi::tbb::task_group * group() const
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t Func __host__ __device__ V int Func func
const SharedStreamPtr & streamPtr() const
ContextState const * contextState_
ScopedContextProduce(const ProductBase &data)
Constructor to (possibly) re-use a CUDA stream (non-ExternalWork module)
impl::ScopedContextHolderHelper holderHelper_
~ScopedContextProduce()
Record the CUDA event, all asynchronous work must have been queued before the destructor.
edm::WaitingTaskWithArenaHolder waitingTaskHolder_
Namespace of DDCMS conversion namespace.
std::unique_ptr< Product< T > > wrap(T data)
ScopedContextAcquire(edm::StreamID streamID, edm::WaitingTaskWithArenaHolder waitingTaskHolder, ContextState &state)
Constructor to create a new CUDA stream, and the context is needed after acquire() ...
ScopedContextAcquire(const ProductBase &data, edm::WaitingTaskWithArenaHolder waitingTaskHolder, ContextState &state)
Constructor to (possibly) re-use a CUDA stream, and the context is needed after acquire() ...
auto make_waiting_task_with_holder(WaitingTaskWithArenaHolder h, F &&f)
char data[epos_bytes_allocation]
ScopedContextProduce(int device, SharedStreamPtr stream, SharedEventPtr event)
ScopedContextProduce(ContextState &state)
Constructor to re-use the CUDA stream of acquire() (ExternalWork module)
void replaceWaitingTaskHolder(edm::WaitingTaskWithArenaHolder waitingTaskHolder)
ScopedContextAcquire(const ProductBase &data, edm::WaitingTaskWithArenaHolder waitingTaskHolder)
Constructor to (possibly) re-use a CUDA stream (no need for context beyond acquire()) ...
friend class cudatest::TestScopedContext
EventCache & getEventCache()
ScopedContextProduce(edm::StreamID streamID)
Constructor to create a new CUDA stream (non-ExternalWork module)
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
cudaStream_t stream() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
impl::ScopedContextHolderHelper holderHelper_
auto emplace(edm::Event &iEvent, edm::EDPutTokenT< T > token, Args &&... args)
void enqueueCallback(int device, cudaStream_t stream)
ScopedContextBase(edm::StreamID streamID)