Lines Matching refs:T

39 template< typename T >
41 size_t operator()(const T &v) const { return size_t(v); } in operator ()()
44 template< typename T >
45 bool wait_try_get( tbb::flow::graph &g, tbb::flow::sequencer_node<T> &q, T &value ) { in wait_try_get()
50 template< typename T >
51 void spin_try_get( tbb::flow::queue_node<T> &q, T &value ) { in spin_try_get()
55 template< typename T >
58 tbb::flow::sequencer_node<T> &my_q;
61 …parallel_puts( tbb::flow::sequencer_node<T> &q, int num_threads ) : my_q(q), my_num_threads(num_th… in parallel_puts()
65 bool msg = my_q.try_put( T(j) ); in operator ()()
72 template< typename T >
76 T *my_last_touch;
80 my_last_touch = new T[my_num_threads]; in touches()
83 my_last_touch[p] = T(-1); in touches()
98 bool check( int tid, T v ) { in check()
136 template< typename T >
139 tbb::flow::sequencer_node<T> &my_q;
141 touches<T> &my_touches;
143 …parallel_gets( tbb::flow::sequencer_node<T> &q, int num_threads, touches<T> &t ) : my_q(q), my_num… in parallel_gets()
147 T v; in operator ()()
155 template< typename T >
158 tbb::flow::sequencer_node<T> &my_s1;
159 tbb::flow::sequencer_node<T> &my_s2;
162 touches<T> &my_touches;
164 …parallel_put_get( tbb::flow::sequencer_node<T> &s1, tbb::flow::sequencer_node<T> &s2, int num_thre… in parallel_put_get()
165 …std::atomic<int> &counter, touches<T> &t ) : my_s1(s1), my_s2(s2), my_num_threads(num_threads), my… in parallel_put_get()
173 bool msg = my_s1.try_put( T(i) ); in operator ()()
178 T v; in operator ()()
194 template< typename T >
198 tbb::flow::sequencer_node<T> s(g, seq_inspector<T>()); in test_parallel()
199 utils::NativeParallelFor( num_threads, parallel_puts<T>(s, num_threads) ); in test_parallel()
201 touches<T> t( num_threads ); in test_parallel()
202 utils::NativeParallelFor( num_threads, parallel_gets<T>(s, num_threads, t) ); in test_parallel()
206 T bogus_value(-1); in test_parallel()
207 T j = bogus_value; in test_parallel()
212 tbb::flow::sequencer_node<T> s1(g, seq_inspector<T>()); in test_parallel()
213 tbb::flow::sequencer_node<T> s2(g, seq_inspector<T>()); in test_parallel()
214 tbb::flow::sequencer_node<T> s3(g, seq_inspector<T>()); in test_parallel()
219 touches<T> t( num_threads ); in test_parallel()
222 … utils::NativeParallelFor( num_threads, parallel_put_get<T>(s1, s3, num_threads, counter, t) ); in test_parallel()
235 tbb::flow::sequencer_node<T> s_copy(s); in test_parallel()
236 utils::NativeParallelFor( num_threads, parallel_puts<T>(s_copy, num_threads) ); in test_parallel()
261 template< typename T >
264 T bogus_value(-1); in test_serial()
266 tbb::flow::sequencer_node<T> s(g, seq_inspector<T>()); in test_serial()
267 tbb::flow::sequencer_node<T> s2(g, seq_inspector<T>()); in test_serial()
268 T j = bogus_value; in test_serial()
284 bool msg = s.try_put( T(i) ); in test_serial()
286 CHECK_MESSAGE(!s.try_put( T(i) ), ""); // second attempt to put should reject in test_serial()
294 … CHECK_MESSAGE(!s.try_put( T(i) ),"" ); // after retrieving value, subsequent put should fail in test_serial()
306 bool msg = s2.try_put( T(i) ); in test_serial()
324 tbb::flow::sequencer_node<T> s3(g, seq_inspector<T>()); in test_serial()
325 tbb::flow::sequencer_node<T> s4(g, seq_inspector<T>()); in test_serial()
326 tbb::flow::sequencer_node<T> s5(g, seq_inspector<T>()); in test_serial()
331 bool msg = s3.try_put( T(i) ); in test_serial()
360 tbb::flow::sequencer_node<T> s6(g, seq_inspector<T>()); in test_serial()
361 tbb::flow::sequencer_node<T> s7(g, seq_inspector<T>()); in test_serial()
362 tbb::flow::sequencer_node<T> s8(g, seq_inspector<T>()); in test_serial()
367 bool msg = s6.try_put( T(i) ); in test_serial()
482 template <typename T, typename Sequencer>
485 tbb::flow::sequencer_node<T>(graph, seq);
487 tbb::flow::sequencer_node<T>(tbb::flow::follows(f), seq);