Lines Matching refs:T
41 template< typename T >
42 void spin_try_get( tbb::flow::priority_queue_node<T> &q, T &value ) { in spin_try_get()
46 template< typename T >
47 void check_item( T* next_value, T &value ) { in check_item()
50 CHECK_MESSAGE( next_value[tid] == T(offset), "" ); in check_item()
54 template< typename T >
56 tbb::flow::priority_queue_node<T> &my_q;
57 parallel_puts( tbb::flow::priority_queue_node<T> &q ) : my_q(q) {} in parallel_puts()
60 bool msg = my_q.try_put( T(N*i + j) ); in operator ()()
66 template< typename T >
68 tbb::flow::priority_queue_node<T> &my_q;
69 parallel_gets( tbb::flow::priority_queue_node<T> &q) : my_q(q) {} in parallel_gets()
71 T prev; in operator ()()
74 T v; in operator ()()
81 template< typename T >
83 tbb::flow::priority_queue_node<T> &my_q;
84 parallel_put_get( tbb::flow::priority_queue_node<T> &q ) : my_q(q) {} in parallel_put_get()
90 CHECK_MESSAGE( my_q.try_put( T (N*tid + j ) ) == true, "" ); in operator ()()
94 T v; in operator ()()
106 template< typename T >
111 tbb::flow::priority_queue_node<T> q(g); in test_reservation()
115 T bogus_value(-1); in test_reservation()
117 q.try_put(T(1)); in test_reservation()
118 q.try_put(T(2)); in test_reservation()
119 q.try_put(T(3)); in test_reservation()
122 T v=bogus_value, w=bogus_value; in test_reservation()
124 CHECK_MESSAGE( v == T(3), "" ); in test_reservation()
129 CHECK_MESSAGE( v == T(3), "" ); in test_reservation()
135 CHECK_MESSAGE( v == T(2), "" ); in test_reservation()
140 CHECK_MESSAGE( v == T(1), "" ); in test_reservation()
149 CHECK_MESSAGE( v == T(1), "" ); in test_reservation()
166 template< typename T >
169 tbb::flow::priority_queue_node<T> q(g); in test_parallel()
170 tbb::flow::priority_queue_node<T> q2(g); in test_parallel()
171 tbb::flow::priority_queue_node<T> q3(g); in test_parallel()
172 T bogus_value(-1); in test_parallel()
173 T j = bogus_value; in test_parallel()
175 NativeParallelFor( num_threads, parallel_puts<T>(q) ); in test_parallel()
185 NativeParallelFor( num_threads, parallel_puts<T>(q) ); in test_parallel()
187 NativeParallelFor( num_threads, parallel_gets<T>(q) ); in test_parallel()
193 NativeParallelFor( num_threads, parallel_put_get<T>(q) ); in test_parallel()
201 NativeParallelFor( num_threads, parallel_puts<T>(q) ); in test_parallel()
203 NativeParallelFor( num_threads, parallel_gets<T>(q3) ); in test_parallel()
215 NativeParallelFor( num_threads, parallel_puts<T>(q) ); in test_parallel()
216 tbb::flow::priority_queue_node<T> q_copy(q); in test_parallel()
244 template< typename T >
247 T bogus_value(-1); in test_serial()
249 tbb::flow::priority_queue_node<T> q(g); in test_serial()
250 tbb::flow::priority_queue_node<T> q2(g); in test_serial()
251 T j = bogus_value; in test_serial()
267 CHECK_MESSAGE( q.try_put( T(i) ), "" ); in test_serial()
281 CHECK_MESSAGE( q.try_put( T(i) ), "" ); in test_serial()
304 tbb::flow::priority_queue_node<T> q3(g); in test_serial()
309 CHECK_MESSAGE( q.try_put( T(i) ), "" ); in test_serial()