#include <TBBThreadPool.h>
Definition at line 22 of file TBBThreadPool.h.
◆ TBBThreadPool()
tensorflow::TBBThreadPool::TBBThreadPool |
( |
int |
nThreads = -1 | ) |
|
|
inlineexplicit |
◆ 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 34 of file TBBThreadPool.h.
39 tbb::task_arena taskArena;
40 tbb::task_group taskGroup;
43 auto doneWithTaskGroup = [&taskArena, &taskGroup](
void*) {
44 taskArena.execute([&taskGroup]() { taskGroup.wait(); });
46 std::unique_ptr<tbb::task_group, decltype(doneWithTaskGroup)> taskGuard(&taskGroup, doneWithTaskGroup);
49 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 |