Go to the documentation of this file. 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>
ScopedContextTask(ContextState const *state, edm::WaitingTaskWithArenaHolder waitingTaskHolder)
Constructor to re-use the CUDA stream of acquire() (ExternalWork module)
edm::WaitingTaskWithArenaHolder waitingTaskHolder_
impl::ScopedContextHolderHelper holderHelper_
ContextState const * contextState_
ScopedContextProduce(edm::StreamID streamID)
Constructor to create a new CUDA stream (non-ExternalWork module)
auto emplace(edm::Event &iEvent, edm::EDPutTokenT< T > token, Args &&... args)
const T & get(const Product< T > &data)
ScopedContextAcquire(edm::StreamID streamID, edm::WaitingTaskWithArenaHolder waitingTaskHolder)
Constructor to create a new CUDA stream (no need for context beyond acquire())
std::shared_ptr< std::remove_pointer_t< cudaEvent_t > > SharedEventPtr
impl::ScopedContextHolderHelper holderHelper_
cudaStream_t stream() const
std::shared_ptr< std::remove_pointer_t< cudaStream_t > > SharedStreamPtr
void enqueueCallback(int device, cudaStream_t stream)
void replaceWaitingTaskHolder(edm::WaitingTaskWithArenaHolder waitingTaskHolder)
ScopedContextAnalyze(const ProductBase &data)
Constructor to (possibly) re-use a CUDA stream.
void synchronizeStreams(int dataDevice, cudaStream_t dataStream, bool available, cudaEvent_t dataEvent)
ContextState * contextState_
void pushNextTask(F &&f, ContextState const *state)
void replaceWaitingTaskHolder(edm::WaitingTaskWithArenaHolder waitingTaskHolder)
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
ScopedContextGetterBase(Args &&... args)
cudaStream_t T uint32_t const T *__restrict__ const uint32_t *__restrict__ uint32_t int cudaStream_t Func V int Func func
const SharedStreamPtr & streamPtr() const
auto make_waiting_task_with_holder(ALLOC &&iAlloc, WaitingTaskWithArenaHolder h, F &&f)
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()
~ScopedContextProduce()
Record the CUDA event, all asynchronous work must have been queued before the destructor.
ScopedContextProduce(const ProductBase &data)
Constructor to (possibly) re-use a CUDA stream (non-ExternalWork module)
ScopedContextBase(edm::StreamID streamID)
ScopedContextAcquire(const ProductBase &data, edm::WaitingTaskWithArenaHolder waitingTaskHolder)
Constructor to (possibly) re-use a CUDA stream (no need for context beyond acquire())
ScopedContextProduce(int device, SharedStreamPtr stream, SharedEventPtr event)
ScopedContextProduce(ContextState &state)
Constructor to re-use the CUDA stream of acquire() (ExternalWork module)
friend class cudatest::TestScopedContext
ScopedContextAcquire(const ProductBase &data, edm::WaitingTaskWithArenaHolder waitingTaskHolder, ContextState &state)
Constructor to (possibly) re-use a CUDA stream, and the context is needed after acquire()
ScopedContextHolderHelper(edm::WaitingTaskWithArenaHolder waitingTaskHolder)
const T & get(const edm::Event &iEvent, edm::EDGetTokenT< Product< T >> token)
char data[epos_bytes_allocation]
void replaceWaitingTaskHolder(edm::WaitingTaskWithArenaHolder waitingTaskHolder)
EventCache & getEventCache()
Namespace of DDCMS conversion namespace.