#include <TBBThreadPool.h>
Definition at line 22 of file TBBThreadPool.h.
◆ TBBThreadPool()
tensorflow::TBBThreadPool::TBBThreadPool |
( |
int |
nThreads = -1 | ) |
|
|
inlineexplicit |
Definition at line 29 of file TBBThreadPool.h.
31 : tbb::global_control::active_value(tbb::global_control::max_allowed_parallelism)),
◆ Cancel()
void tensorflow::TBBThreadPool::Cancel |
( |
| ) |
|
|
inlineoverride |
◆ CurrentThreadId()
int tensorflow::TBBThreadPool::CurrentThreadId |
( |
| ) |
const |
|
inlineoverride |
◆ GetNumScheduleCalled()
int tensorflow::TBBThreadPool::GetNumScheduleCalled |
( |
| ) |
|
|
inline |
◆ instance()
static TBBThreadPool& tensorflow::TBBThreadPool::instance |
( |
int |
nThreads = -1 | ) |
|
|
inlinestatic |
◆ NumThreads()
int tensorflow::TBBThreadPool::NumThreads |
( |
| ) |
const |
|
inlineoverride |
◆ Schedule()
void tensorflow::TBBThreadPool::Schedule |
( |
std::function< void()> |
fn | ) |
|
|
inlineoverride |
Definition at line 36 of file TBBThreadPool.h.
41 tbb::task_arena taskArena;
42 tbb::task_group taskGroup;
45 auto doneWithTaskGroup = [&taskArena, &taskGroup](
void*) {
46 taskArena.execute([&taskGroup]() { taskGroup.wait(); });
48 std::unique_ptr<tbb::task_group, decltype(doneWithTaskGroup)> taskGuard(&taskGroup, doneWithTaskGroup);
51 taskArena.execute([&taskGroup, &
fn] { taskGroup.run(
fn); });
References personalPlayback::fn, and numScheduleCalled_.
Referenced by ScheduleWithHint().
◆ ScheduleWithHint()
void tensorflow::TBBThreadPool::ScheduleWithHint |
( |
std::function< void()> |
fn, |
|
|
int |
start, |
|
|
int |
end |
|
) |
| |
|
inlineoverride |
◆ nThreads_
const int tensorflow::TBBThreadPool::nThreads_ |
|
private |
◆ numScheduleCalled_
std::atomic<int> tensorflow::TBBThreadPool::numScheduleCalled_ |
|
private |