OmniSciDB  471d68cefb
 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 74 of file threading_tbb.h.

References run_benchmark_import::args, f, and g_tbb_arena.

74  {
75  auto f = std::bind(std::forward<Fn>(fn), std::forward<Args>(args)...);
76  auto ptask = std::make_unique<tbb_packaged_task<Result>>();
77 #if TBB_INTERFACE_VERSION >= 12040
78  g_tbb_arena.enqueue(ptask->defer(f));
79 #else
80  g_tbb_arena.execute([&] { ptask->run(f); });
81 #endif
82  return future<Result>(std::move(ptask));
83 }
tbb::task_arena g_tbb_arena
char * f
template<typename... X>
void threading_tbb::parallel_for ( X &&...  x)

Definition at line 21 of file threading_tbb.h.

References g_tbb_arena, and threading_serial::parallel_for().

21  {
22  g_tbb_arena.execute([&] {
23  this_task_arena::isolate([&] { tbb::parallel_for(std::forward<X>(x)...); });
24  });
25 }
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 28 of file threading_tbb.h.

References g_tbb_arena, and threading_serial::parallel_reduce().

28  {
29  return g_tbb_arena.execute([&] {
30  return this_task_arena::isolate(
31  [&] { return tbb::parallel_reduce(std::forward<X>(x)...); });
32  });
33 }
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