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)
ScopedContextGetterBase(Args &&...args)
void synchronizeStreams(int dataDevice, cudaStream_t dataStream, bool available, cudaEvent_t dataEvent)
ScopedContextHolderHelper(edm::WaitingTaskWithArenaHolder waitingTaskHolder)
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
std::shared_ptr< std::remove_pointer_t< cudaEvent_t >> SharedEventPtr
void pushNextTask(F &&f, ContextState const *state)
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.
const SharedStreamPtr & streamPtr() const
ContextState * contextState_
void replaceWaitingTaskHolder(edm::WaitingTaskWithArenaHolder waitingTaskHolder)
void replaceWaitingTaskHolder(edm::WaitingTaskWithArenaHolder waitingTaskHolder)
std::shared_ptr< std::remove_pointer_t< cudaStream_t >> SharedStreamPtr
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_
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() ...
OrphanHandle< PROD > emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
ScopedContextAcquire(const ProductBase &data, edm::WaitingTaskWithArenaHolder waitingTaskHolder, ContextState &state)
Constructor to (possibly) re-use a CUDA stream, and the context is needed after acquire() ...
cudaStream_t stream() const
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)
auto emplace(edm::Event &iEvent, edm::EDPutTokenT< T > token, Args &&...args)
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)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
impl::ScopedContextHolderHelper holderHelper_
void enqueueCallback(int device, cudaStream_t stream)
ScopedContextBase(edm::StreamID streamID)