#include <VUserTaskQueue.hh>
|
template<typename ContainerT , size_t... Idx> |
static auto | ContainerToTupleImpl (ContainerT &&container, mpl::index_sequence< Idx... >) -> decltype(std::make_tuple(std::forward< ContainerT >(container)[Idx]...)) |
|
template<std::size_t N, typename ContainerT > |
static auto | ContainerToTuple (ContainerT &&container) -> decltype(ContainerToTupleImpl(std::forward< ContainerT >(container), mpl::make_index_sequence< N >{})) |
|
template<std::size_t N, std::size_t Nt, typename TupleT , enable_if_t<(N==Nt), int > = 0> |
static void | TExecutor (TupleT &&_t) |
|
template<std::size_t N, std::size_t Nt, typename TupleT , enable_if_t<(N< Nt), int > = 0> |
static void | TExecutor (TupleT &&_t) |
|
template<typename TupleT , std::size_t N = std::tuple_size<decay_t<TupleT>>::value> |
static void | Executor (TupleT &&__t) |
|
template<typename Container , typename std::enable_if< std::is_same< Container, task_pointer >::value, int >::type = 0> |
static void | Execute (Container &obj) |
|
template<typename Container , typename std::enable_if<!std::is_same< Container, task_pointer >::value, int >::type = 0> |
static void | Execute (Container &tasks) |
|
Definition at line 47 of file VUserTaskQueue.hh.
◆ AtomicInt
◆ function_type
◆ size_type
◆ task_pointer
◆ ThreadIdSet
◆ VUserTaskQueue()
VUserTaskQueue::VUserTaskQueue |
( |
intmax_t |
nworkers = -1 | ) |
|
|
explicit |
Definition at line 35 of file VUserTaskQueue.cc.
37{
39 {
42 : (2 * std::thread::hardware_concurrency()) + 1;
43
44 }
45}
virtual int GetNumberOfThreads() const
static TaskRunManager * GetMasterRunManager(bool useTBB=false)
◆ ~VUserTaskQueue()
VUserTaskQueue::~VUserTaskQueue |
( |
| ) |
|
|
virtual |
◆ bin_empty()
virtual bool PTL::VUserTaskQueue::bin_empty |
( |
size_type |
bin | ) |
const |
|
pure virtual |
◆ bin_size()
◆ clone()
◆ ContainerToTuple()
template<std::size_t N, typename ContainerT >
Definition at line 125 of file VUserTaskQueue.hh.
127 {}))
128 {
130 mpl::make_index_sequence<N>{});
131 }
static auto ContainerToTupleImpl(ContainerT &&container, mpl::index_sequence< Idx... >) -> decltype(std::make_tuple(std::forward< ContainerT >(container)[Idx]...))
◆ ContainerToTupleImpl()
template<typename ContainerT , size_t... Idx>
static auto PTL::VUserTaskQueue::ContainerToTupleImpl |
( |
ContainerT && |
container, |
|
|
mpl::index_sequence< Idx... > |
|
|
) |
| -> decltype(std::make_tuple(std::forward<ContainerT>(container)[Idx]...))
|
|
inlinestatic |
Definition at line 118 of file VUserTaskQueue.hh.
120 {
121 return std::make_tuple(std::forward<ContainerT>(container)[Idx]...);
122 }
◆ empty()
virtual bool PTL::VUserTaskQueue::empty |
( |
| ) |
const |
|
pure virtual |
◆ Execute() [1/2]
template<typename Container , typename std::enable_if< std::is_same< Container,
task_pointer >::value, int >::type = 0>
static void PTL::VUserTaskQueue::Execute |
( |
Container & |
obj | ) |
|
|
inlinestatic |
◆ Execute() [2/2]
template<typename Container , typename std::enable_if<!std::is_same< Container,
task_pointer >::value, int >::type = 0>
static void PTL::VUserTaskQueue::Execute |
( |
Container & |
tasks | ) |
|
|
inlinestatic |
Definition at line 168 of file VUserTaskQueue.hh.
169 {
170
171
172
173
174
175
176
179 while(n > 0)
180 {
181 auto compute = (
n > max_n) ? max_n : n;
182 switch(compute)
183 {
184 case 4: {
185 auto t = ContainerToTuple<4>(tasks);
187 break;
188 }
189 case 3: {
190 auto t = ContainerToTuple<3>(tasks);
192 break;
193 }
194 case 2: {
195 auto t = ContainerToTuple<2>(tasks);
197 break;
198 }
199 case 1: {
200 auto t = ContainerToTuple<1>(tasks);
202 break;
203 }
204 case 0: break;
205 }
206
208 }
209 }
static void Executor(TupleT &&__t)
◆ ExecuteOnAllThreads()
◆ ExecuteOnSpecificThreads()
◆ Executor()
template<typename TupleT , std::size_t N = std::tuple_size<decay_t<TupleT>>::value>
static void PTL::VUserTaskQueue::Executor |
( |
TupleT && |
__t | ) |
|
|
inlinestatic |
◆ GetTask()
virtual task_pointer PTL::VUserTaskQueue::GetTask |
( |
intmax_t |
subq = -1 , |
|
|
intmax_t |
nitr = -1 |
|
) |
| |
|
pure virtual |
◆ GetThreadBin()
virtual intmax_t PTL::VUserTaskQueue::GetThreadBin |
( |
| ) |
const |
|
pure virtual |
◆ InsertTask()
virtual intmax_t PTL::VUserTaskQueue::InsertTask |
( |
task_pointer |
, |
|
|
ThreadData * |
= nullptr , |
|
|
intmax_t |
subq = -1 |
|
) |
| |
|
pure virtual |
◆ resize()
virtual void PTL::VUserTaskQueue::resize |
( |
intmax_t |
| ) |
|
|
pure virtual |
◆ size()
virtual size_type PTL::VUserTaskQueue::size |
( |
| ) |
const |
|
pure virtual |
◆ TExecutor() [1/2]
template<std::size_t N, std::size_t Nt, typename TupleT ,
enable_if_t<(N==Nt), int > = 0>
static void PTL::VUserTaskQueue::TExecutor |
( |
TupleT && |
_t | ) |
|
|
inlinestatic |
Definition at line 135 of file VUserTaskQueue.hh.
136 {
137 if(std::get<N>(_t).
get())
138 (*(std::get<N>(_t)))();
139 }
auto get(Tuple< Elements... > &t) -> decltype(get_height< sizeof...(Elements) - I - 1 >(t))
Referenced by Executor().
◆ TExecutor() [2/2]
template<std::size_t N, std::size_t Nt, typename TupleT ,
enable_if_t<(N< Nt), int > = 0>
static void PTL::VUserTaskQueue::TExecutor |
( |
TupleT && |
_t | ) |
|
|
inlinestatic |
Definition at line 143 of file VUserTaskQueue.hh.
144 {
145 if(std::get<N>(_t).
get())
146 (*(std::get<N>(_t)))();
147 TExecutor<N + 1, Nt, TupleT>(std::forward<TupleT>(_t));
148 }
◆ true_empty()
virtual bool PTL::VUserTaskQueue::true_empty |
( |
| ) |
const |
|
inlinevirtual |
◆ true_size()
virtual size_type PTL::VUserTaskQueue::true_size |
( |
| ) |
const |
|
inlinevirtual |
◆ Wait()
virtual void PTL::VUserTaskQueue::Wait |
( |
| ) |
|
|
pure virtual |
◆ workers()
intmax_t PTL::VUserTaskQueue::workers |
( |
| ) |
const |
|
inline |
◆ m_workers
intmax_t PTL::VUserTaskQueue::m_workers = 0 |
|
protected |
The documentation for this class was generated from the following files: