Lines Matching refs:T

41 template< typename T >
42 void spin_try_get( tbb::flow::queue_node<T> &q, T &value ) { in spin_try_get()
57 template< typename T >
58 void check_item( T* next_value, T &value ) { in check_item()
61 CHECK_MESSAGE( next_value[tid] == T(offset), "" ); in check_item()
65 template< typename T >
68 tbb::flow::queue_node<T> &my_q;
70 parallel_puts( tbb::flow::queue_node<T> &q ) : my_q(q) {} in parallel_puts()
74 bool msg = my_q.try_put( T(N*i + j) ); in operator ()()
81 template< typename T >
85 T **my_last_touch;
89 my_last_touch = new T* [my_num_threads]; in touches()
92 my_last_touch[p] = new T[my_num_threads]; in touches()
111 bool check( int tid, T v ) { in check()
150 template< typename T >
153 tbb::flow::queue_node<T> &my_q;
154 touches<T> &my_touches;
156 parallel_gets( tbb::flow::queue_node<T> &q, touches<T> &t) : my_q(q), my_touches(t) {} in parallel_gets()
160 T v; in operator ()()
168 template< typename T >
171 tbb::flow::queue_node<T> &my_q;
172 touches<T> &my_touches;
174 parallel_put_get( tbb::flow::queue_node<T> &q, touches<T> &t ) : my_q(q), my_touches(t) {} in parallel_put_get()
182 CHECK_MESSAGE( my_q.try_put( T (N*tid + j ) ) == true, "" ); in operator ()()
186 T v; in operator ()()
200 template< typename T >
203 T bogus_value(-1); in test_reservation()
206 tbb::flow::queue_node<T> q(g); in test_reservation()
208 q.try_put(T(1)); in test_reservation()
209 q.try_put(T(2)); in test_reservation()
210 q.try_put(T(3)); in test_reservation()
212 T v; in test_reservation()
214 CHECK_MESSAGE( v == T(1), "" ); in test_reservation()
219 CHECK_MESSAGE( v == T(1), "" ); in test_reservation()
225 CHECK_MESSAGE( v == T(2), "" ); in test_reservation()
230 CHECK_MESSAGE( v == T(3), "" ); in test_reservation()
235 CHECK_MESSAGE( v == T(3), "" ); in test_reservation()
251 template< typename T >
254 tbb::flow::queue_node<T> q(g); in test_parallel()
255 tbb::flow::queue_node<T> q2(g); in test_parallel()
256 tbb::flow::queue_node<T> q3(g); in test_parallel()
258 Checker< T > my_check; in test_parallel()
259 T bogus_value(-1); in test_parallel()
260 T j = bogus_value; in test_parallel()
261 utils::NativeParallelFor( num_threads, parallel_puts<T>(q) ); in test_parallel()
263 T *next_value = new T[num_threads]; in test_parallel()
264 for (int tid = 0; tid < num_threads; ++tid) next_value[tid] = T(0); in test_parallel()
272 CHECK_MESSAGE( next_value[tid] == T(N), "" ); in test_parallel()
281 utils::NativeParallelFor( num_threads, parallel_puts<T>(q) ); in test_parallel()
284 touches< T > t( num_threads ); in test_parallel()
285 utils::NativeParallelFor( num_threads, parallel_gets<T>(q, t) ); in test_parallel()
295 touches< T > t2( num_threads ); in test_parallel()
296 utils::NativeParallelFor( num_threads, parallel_put_get<T>(q, t2) ); in test_parallel()
307 utils::NativeParallelFor( num_threads, parallel_puts<T>(q) ); in test_parallel()
309 touches< T > t3( num_threads ); in test_parallel()
310 utils::NativeParallelFor( num_threads, parallel_gets<T>(q3, t3) ); in test_parallel()
325 utils::NativeParallelFor( num_threads, parallel_puts<T>(q) ); in test_parallel()
326 tbb::flow::queue_node<T> q_copy(q); in test_parallel()
332 touches< T > t( num_threads ); in test_parallel()
333 utils::NativeParallelFor( num_threads, parallel_gets<T>(q_copy, t) ); in test_parallel()
356 template< typename T >
359 tbb::flow::queue_node<T> q(g); in test_serial()
360 tbb::flow::queue_node<T> q2(g); in test_serial()
363 Checker<T> my_check; // if CheckType< U > count constructions and destructions in test_serial()
364 T bogus_value(-1); in test_serial()
365 T j = bogus_value; in test_serial()
381 bool msg = q.try_put( T(i) ); in test_serial()
399 bool msg = q.try_put( T(i) ); in test_serial()
425 tbb::flow::queue_node<T> q3(g); in test_serial()
430 bool msg = q.try_put( T(i) ); in test_serial()