MeshLib Documentation
Loading...
Searching...
No Matches
MRParallel.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRPch/MRTBB.h"
4
5namespace MR
6{
7
8namespace Parallel
9{
10
12{
13 auto operator() ( auto && f, auto id ) const { return f( id ); }
14 auto operator() ( auto && f, auto id, auto && subrange ) const { return f( id, subrange ); }
15};
16
18{
19 auto operator() () const { return CallSimply{}; }
20};
21
22template<typename T>
24{
25 T & tls;
26 auto operator() ( auto && f, auto id ) const { return f( id, tls ); }
27 auto operator() ( auto && f, auto id, auto && subrange ) const { return f( id, subrange, tls ); }
28};
29
30template<typename L>
32{
33 tbb::enumerable_thread_specific<L> & e;
34 auto operator() () const { return CallWithTLS<L>{ e.local() }; }
35};
36
37} //namespace Parallel
38
39} //namespace MR
Definition MRCameraOrientationPlugin.h:8
Definition MRParallel.h:18
auto operator()() const
Definition MRParallel.h:19
Definition MRParallel.h:12
auto operator()(auto &&f, auto id) const
Definition MRParallel.h:13
Definition MRParallel.h:32
auto operator()() const
Definition MRParallel.h:34
tbb::enumerable_thread_specific< L > & e
Definition MRParallel.h:33
Definition MRParallel.h:24
T & tls
Definition MRParallel.h:25
auto operator()(auto &&f, auto id) const
Definition MRParallel.h:26