Lines Matching refs:T
35 template< typename T >
36 void spin_try_get( tbb::flow::buffer_node<T> &b, T &value ) { in spin_try_get()
40 template< typename T >
41 void check_item( T* count_value, T &value ) { in check_item()
45 template< typename T >
48 tbb::flow::buffer_node<T> &my_b;
50 parallel_puts( tbb::flow::buffer_node<T> &b ) : my_b(b) {} in parallel_puts()
54 bool msg = my_b.try_put( T(N*i + j) ); in operator ()()
60 template< typename T >
82 bool check( T v ) { in check()
98 template< typename T >
101 tbb::flow::buffer_node<T> &my_b;
102 touches<T> &my_touches;
104 parallel_gets( tbb::flow::buffer_node<T> &b, touches<T> &t) : my_b(b), my_touches(t) {} in parallel_gets()
108 T v; in operator ()()
116 template< typename T >
119 tbb::flow::buffer_node<T> &my_b;
120 touches<T> &my_touches;
122 parallel_put_get( tbb::flow::buffer_node<T> &b, touches<T> &t ) : my_b(b), my_touches(t) {} in parallel_put_get()
130 CHECK_MESSAGE( my_b.try_put( T (N*tid + j ) ) == true, "" ); in operator ()()
134 T v; in operator ()()
148 template< typename T >
151 T bogus_value(-1); in test_reservation()
154 tbb::flow::buffer_node<T> b(g); in test_reservation()
156 b.try_put(T(1)); in test_reservation()
157 b.try_put(T(2)); in test_reservation()
158 b.try_put(T(3)); in test_reservation()
160 T v, vsum; in test_reservation()
183 CHECK_MESSAGE( vsum == T(6), ""); in test_reservation()
198 template< typename T >
201 tbb::flow::buffer_node<T> b(g); in test_parallel()
202 tbb::flow::buffer_node<T> b2(g); in test_parallel()
203 tbb::flow::buffer_node<T> b3(g); in test_parallel()
204 T bogus_value(-1); in test_parallel()
205 T j = bogus_value; in test_parallel()
207 NativeParallelFor( num_threads, parallel_puts<T>(b) ); in test_parallel()
209 T *next_value = new T[num_threads]; in test_parallel()
210 for (int tid = 0; tid < num_threads; ++tid) next_value[tid] = T(0); in test_parallel()
218 CHECK_MESSAGE( next_value[tid] == T((N*(N-1))/2), "" ); in test_parallel()
226 NativeParallelFor( num_threads, parallel_puts<T>(b) ); in test_parallel()
229 touches< T > t( num_threads ); in test_parallel()
230 NativeParallelFor( num_threads, parallel_gets<T>(b, t) ); in test_parallel()
240 touches< T > t( num_threads ); in test_parallel()
241 NativeParallelFor( num_threads, parallel_put_get<T>(b, t) ); in test_parallel()
252 NativeParallelFor( num_threads, parallel_puts<T>(b) ); in test_parallel()
254 touches< T > t( num_threads ); in test_parallel()
255 NativeParallelFor( num_threads, parallel_gets<T>(b3, t) ); in test_parallel()
271 NativeParallelFor( num_threads, parallel_puts<T>(b) ); in test_parallel()
273 tbb::flow::buffer_node<T> b_copy(b); in test_parallel()
284 touches< T > t( num_threads ); in test_parallel()
285 NativeParallelFor( num_threads, parallel_gets<T>(b_copy, t) ); in test_parallel()
314 template< typename T >
317 T bogus_value(-1); in test_serial()
319 tbb::flow::buffer_node<T> b(g); in test_serial()
320 tbb::flow::buffer_node<T> b2(g); in test_serial()
321 T j = bogus_value; in test_serial()
327 CHECK_MESSAGE( register_predecessor<T>( b, b2 ) == false, "" ); in test_serial()
328 CHECK_MESSAGE( remove_predecessor<T>( b, b2 ) == false, "" ); in test_serial()
337 bool msg = b.try_put( T(i) ); in test_serial()
341 T vsum = T(0); in test_serial()
355 vsum = T(0); in test_serial()
357 bool msg = b.try_put( T(i) ); in test_serial()
383 tbb::flow::buffer_node<T> b3(g); in test_serial()
387 vsum = T(0); in test_serial()
389 bool msg = b.try_put( T(i) ); in test_serial()