OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
threading_tbb Namespace Reference

Namespaces

 this_task_arena
 

Classes

struct  tbb_packaged_task
 
struct  tbb_packaged_task< void >
 
struct  future
 
struct  future< void >
 

Functions

template<typename... X>
void parallel_for (X &&...x)
 
template<typename... X>
auto parallel_reduce (X &&...x) -> decltype(tbb::parallel_reduce(std::forward< X >(x)...))
 
template<typename Fn , typename... Args, typename Result = std::result_of_t<Fn && (Args && ...)>>
future< Result > async (Fn &&fn, Args &&...args)
 

Variables

tbb::task_arena g_tbb_arena
 

Function Documentation

template<typename Fn , typename... Args, typename Result = std::result_of_t<Fn && (Args && ...)>>
future<Result> threading_tbb::async ( Fn &&  fn,
Args &&...  args 
)

Definition at line 73 of file threading_tbb.h.

References run_benchmark_import::args, f(), and g_tbb_arena.

73  {
74  auto f = std::bind(std::forward<Fn>(fn), std::forward<Args>(args)...);
75  auto ptask = std::make_unique<tbb_packaged_task<Result>>();
76 #if TBB_INTERFACE_VERSION >= 12040
77  g_tbb_arena.enqueue(ptask->defer(f));
78 #else
79  g_tbb_arena.execute([&] { ptask->run(f); });
80 #endif
81  return future<Result>(std::move(ptask));
82 }
tbb::task_arena g_tbb_arena
torch::Tensor f(torch::Tensor x, torch::Tensor W_target, torch::Tensor b_target)

+ Here is the call graph for this function:

template<typename... X>
void threading_tbb::parallel_for ( X &&...  x)

Definition at line 20 of file threading_tbb.h.

References g_tbb_arena, and threading_serial::parallel_for().

20  {
21  g_tbb_arena.execute([&] {
22  this_task_arena::isolate([&] { tbb::parallel_for(std::forward<X>(x)...); });
23  });
24 }
tbb::task_arena g_tbb_arena
void parallel_for(const blocked_range< Int > &range, const Body &body, const Partitioner &p=Partitioner())

+ Here is the call graph for this function:

template<typename... X>
auto threading_tbb::parallel_reduce ( X &&...  x) -> decltype(tbb::parallel_reduce(std::forward<X>(x)...))

Definition at line 27 of file threading_tbb.h.

References g_tbb_arena, and threading_serial::parallel_reduce().

27  {
28  return g_tbb_arena.execute([&] {
29  return this_task_arena::isolate(
30  [&] { return tbb::parallel_reduce(std::forward<X>(x)...); });
31  });
32 }
tbb::task_arena g_tbb_arena
Value parallel_reduce(const blocked_range< Int > &range, const Value &identity, const RealBody &real_body, const Reduction &reduction, const Partitioner &p=Partitioner())
Parallel iteration with reduction.

+ Here is the call graph for this function:

Variable Documentation