#include <SerialTaskQueueChain.h>
|
template<typename T > |
void | actionToRun (T &&iAction) |
|
template<typename T > |
void | passDownChain (unsigned int iIndex, oneapi::tbb::task_group &iGroup, T &&iAction) |
|
Definition at line 32 of file SerialTaskQueueChain.h.
◆ SerialTaskQueueChain() [1/4]
edm::SerialTaskQueueChain::SerialTaskQueueChain |
( |
| ) |
|
|
inline |
◆ SerialTaskQueueChain() [2/4]
edm::SerialTaskQueueChain::SerialTaskQueueChain |
( |
std::vector< std::shared_ptr< SerialTaskQueue >> |
iQueues | ) |
|
|
inlineexplicit |
◆ SerialTaskQueueChain() [3/4]
◆ SerialTaskQueueChain() [4/4]
Definition at line 40 of file SerialTaskQueueChain.h.
std::vector< std::shared_ptr< SerialTaskQueue > > m_queues
std::atomic< unsigned long > m_outstandingTasks
◆ actionToRun()
template<typename T >
void SerialTaskQueueChain::actionToRun |
( |
T && |
iAction | ) |
|
|
private |
Definition at line 101 of file SerialTaskQueueChain.h.
Referenced by passDownChain(), and push().
103 using Queues = std::vector<std::shared_ptr<SerialTaskQueue>>;
105 auto& vec = iChain->m_queues;
106 for (
auto it = vec.rbegin() + 1; it != vec.rend(); ++it) {
109 --(iChain->m_outstandingTasks);
112 std::unique_ptr<SerialTaskQueueChain, decltype(sentryAction)> sentry(
this, sentryAction);
◆ numberOfQueues()
std::size_t edm::SerialTaskQueueChain::numberOfQueues |
( |
| ) |
const |
|
inline |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ outstandingTasks()
unsigned long edm::SerialTaskQueueChain::outstandingTasks |
( |
| ) |
const |
|
inline |
◆ passDownChain()
template<typename T >
void SerialTaskQueueChain::passDownChain |
( |
unsigned int |
iIndex, |
|
|
oneapi::tbb::task_group & |
iGroup, |
|
|
T && |
iAction |
|
) |
| |
|
private |
Definition at line 86 of file SerialTaskQueueChain.h.
References actionToRun(), and m_queues.
Referenced by push().
91 if (iQueueIndex + 1 ==
m_queues.size()) {
92 m_queues[iQueueIndex]->push(iGroup, [
this, iAction]()
mutable { this->
actionToRun(iAction); });
94 auto nextQueue = iQueueIndex + 1;
96 iGroup, [
this, nextQueue, &iGroup, iAction]()
mutable { this->
passDownChain(nextQueue, iGroup, iAction); });
std::vector< std::shared_ptr< SerialTaskQueue > > m_queues
void passDownChain(unsigned int iIndex, oneapi::tbb::task_group &iGroup, T &&iAction)
void actionToRun(T &&iAction)
◆ push()
template<typename T >
void SerialTaskQueueChain::push |
( |
oneapi::tbb::task_group & |
iGroup, |
|
|
T && |
iAction |
|
) |
| |
asynchronously pushes functor iAction into queue
The function will return immediately and iAction will either process concurrently with the calling thread or wait until the protected resource becomes available or until a CPU becomes available.
- Parameters
-
[in] | iAction | Must be a functor that takes no arguments and return no values. |
Definition at line 75 of file SerialTaskQueueChain.h.
References actionToRun(), cms::cuda::assert(), m_outstandingTasks, m_queues, and passDownChain().
Referenced by edm::EventProcessor::beginLumiAsync(), edm::EventProcessor::beginRunAsync(), edm::EventProcessor::handleNextEventForStreamAsync(), edm::Worker::TaskQueueAdaptor::push(), edm::EventProcessor::readAndMergeLumiEntriesAsync(), and edm::EventProcessor::readAndMergeRunEntriesAsync().
81 m_queues[0]->push(iGroup, [
this, &iGroup, iAction]()
mutable { this->
passDownChain(1, iGroup, iAction); });
std::vector< std::shared_ptr< SerialTaskQueue > > m_queues
void passDownChain(unsigned int iIndex, oneapi::tbb::task_group &iGroup, T &&iAction)
std::atomic< unsigned long > m_outstandingTasks
void actionToRun(T &&iAction)
◆ m_outstandingTasks
std::atomic<unsigned long> edm::SerialTaskQueueChain::m_outstandingTasks {0} |
|
private |
◆ m_queues
std::vector<std::shared_ptr<SerialTaskQueue> > edm::SerialTaskQueueChain::m_queues |
|
private |