Home
last modified time | relevance | path

Searched refs:count (Results 1 – 25 of 61) sorted by relevance

123

/oneTBB/examples/parallel_reduce/primes/
H A Dprimes.cpp90 NumberType count = 0; in find_primes_in_window() local
95 ++count; in find_primes_in_window()
98 return count; in find_primes_in_window()
156 NumberType count = n >= 2; in SerialCountPrimes() local
169 return count; in SerialCountPrimes()
243 NumberType count; member in Sieve
272 count += other.count; in join()
279 count(0) {} in Sieve()
292 NumberType count = n >= 2; in ParallelCountPrimes() local
304 count += s.count; in ParallelCountPrimes()
[all …]
H A Dmain.cpp93 NumberType count = 0; in main() local
96 count = SerialCountPrimes(n); in main()
100 count = ParallelCountPrimes(n, p, grainSize); in main()
104 std::cout << "#primes from [2.." << options.n << "] = " << count << " (" in main()
/oneTBB/test/common/
H A Dspin_barrier.h40 int count = 0; in SpinWaitWhile() local
42 if (count < 100) { in SpinWaitWhile()
44 ++count; in SpinWaitWhile()
45 } else if (count < 200) { in SpinWaitWhile()
47 ++count; in SpinWaitWhile()
49 std::this_thread::sleep_for(std::chrono::microseconds(count/100)); in SpinWaitWhile()
50 if (count < 10000) { in SpinWaitWhile()
51 count += 100; in SpinWaitWhile()
H A Dnode_handling_support.h256 auto count = table_for_extract.count(key); in test_extract() local
261 …REQUIRE_MESSAGE(table_for_extract.count(key) == count -1, "Extract: more than one elements were ex… in test_extract()
266 auto count2 = table_for_extract.count(key2); in test_extract()
271 …REQUIRE_MESSAGE(table_for_extract.count(key2) == count2 -1, "Extract: more than one elements were … in test_extract()
362 REQUIRE_MESSAGE(dst_table.count(Value<DstTableType>::key(it)) == in check_concurrent_merge()
363 start_data.count(Value<SrcTableType>::key(it)) * src_tables.size(), in check_concurrent_merge()
H A Dconcurrent_associative_common.h508 unsigned int count = 0;
511 count++;
603 unsigned int count = 0;
605 count++;
611 count = 0;
613 count++;
771 int c = (int)table.count(i);
1342 REQUIRE_MESSAGE(c.count(k) == c.count(key), "Incorrect heterogeneous count return value");
1380 auto count_before_erase = c.count(i);
1411 REQUIRE_MESSAGE(c.count(k) == c.count(key), "Incorrect heterogeneous count return value");
[all …]
/oneTBB/test/tbb/
H A Dtest_flow_graph.cpp96 int count = 0; in test_iterator() local
98 count++; in test_iterator()
104 count = 0; in test_iterator()
106 count++; in test_iterator()
112 count = 0; in test_iterator()
114 count++; in test_iterator()
116 CHECK_MESSAGE( (count==4), "error in iterator count"); in test_iterator()
133 int count = 0; in operator ()() local
135 count++; in operator ()()
142 int count = 0; in operator ()() local
[all …]
H A Dtest_continue_node.cpp218 int count=0; in test_two_graphs() local
223 continue_node<continue_msg> first_g(g, add_to_counter(count)); in test_two_graphs()
237 CHECK_MESSAGE( (count==1), "Not all continue messages received"); in test_two_graphs()
240 count=0; in test_two_graphs()
244 CHECK_MESSAGE( (count==1), "Not all continue messages received -1"); in test_two_graphs()
247 count=0; in test_two_graphs()
250 CHECK_MESSAGE( (count==0), "Node executed without waiting for all predecessors"); in test_two_graphs()
257 lightweight_policy_body( std::atomic<size_t>& count ) in lightweight_policy_body()
258 : my_thread_id(std::this_thread::get_id()), my_count(count) in lightweight_policy_body()
H A Dtest_task_group.cpp450 atomic_t count; in LaunchChildrenWithFunctor() local
451 count = 0; in LaunchChildrenWithFunctor()
455 g.run(g.defer(ThrowingTask(count))); in LaunchChildrenWithFunctor()
458 g.run(ThrowingTask(count)); in LaunchChildrenWithFunctor()
1025 std::atomic<unsigned>& count; member
1027 unsigned previous_count = count.fetch_sub(1); in operator ()()
1037 std::atomic<unsigned> count{num}; variable
1039 SelfRunner uf{tg, count};
1043 count == 0,
1054 std::atomic<unsigned> count{13}; in run_cancellation_use_case() local
[all …]
H A Dtest_parallel_reduce.cpp56 m_array = new ValueType[unsigned(count)]; in ParallelSumTester()
57 for ( ValueType i = 0; i < count; ++i ) in ParallelSumTester()
59 m_range = tbb::blocked_range<ValueType*>( m_array, m_array + count ); in ParallelSumTester()
82 static const ValueType count, expected; member in ParallelSumTester
85 const ValueType ParallelSumTester::count = 1000000; member in ParallelSumTester
86 const ValueType ParallelSumTester::expected = count * (count + 1) / 2;
H A Dtest_queue_node.cpp43 int count = 0; in spin_try_get() local
45 if (count < 1000000) { in spin_try_get()
46 ++count; in spin_try_get()
48 if (count == 1000000) { in spin_try_get()
52 ++count; in spin_try_get()
/oneTBB/test/conformance/
H A Dconformance_input_node.cpp197 static int count; member
202 ++count; in operator ()()
203 if(count > N){ in operator ()()
212 static int count; member
215 ++count; in operator ()()
217 …CHECK_MESSAGE((input_node_counter::count <= function_node_counter::count + 1), "input_node `try_ge… in operator ()()
222 int input_node_counter::count = 0; member in input_node_counter
223 int function_node_counter::count = 0; member in function_node_counter
H A Dconformance_task_group.cpp198 std::atomic<unsigned>& count; member
200 unsigned previous_count = count.fetch_sub(1); in operator ()()
209 std::atomic<unsigned> count{13}; in run_cancellation_use_case() local
218 inner_tg.run( SelfRunner{inner_tg, count} ); in run_cancellation_use_case()
242 CHECK_MESSAGE(0 == count, "Some of the inner group tasks were not executed."); in run_cancellation_use_case()
H A Dconformance_concurrent_hash_map.cpp243 int count = 0; in CheckTable() local
246 ++count; in CheckTable()
249 CHECK(count==n); in CheckTable()
292 w.count( (it++)->first ); in TestRehash()
598 if (c.count( (*it).first) == 0){ in equal()
741 size_t count = 0; in TraverseTable() local
754 ++count; in TraverseTable()
770 if (count != expected_size) { in TraverseTable()
791 CHECK_FAST(table.count(MyKey::make(i)) == 0); in apply()
1351 regular_count = chmap.count(key); in test_heterogeneous_count()
[all …]
H A Dconformance_enumerable_thread_specific.cpp612 size_t count; member
615 parallel_vector_reduce_body ( ) : count(0) { test_helper<T>::init(sum); } in parallel_vector_reduce_body()
621 ++count; in operator ()()
630 count += b.count; in join()
666 REQUIRE( vs.size() == pvrb.count ); in run_parallel_vector_tests()
667 REQUIRE( vs2.size() == pvrb.count ); in run_parallel_vector_tests()
668 REQUIRE( vs3.size() == pvrb.count ); in run_parallel_vector_tests()
707 REQUIRE( pvrb2.count == vvs.size() ); in run_parallel_vector_tests()
708 REQUIRE( test_helper<T>::get(pvrb2.sum) == N*p-pvrb2.count*25 ); in run_parallel_vector_tests()
712 REQUIRE( ccount == N*p+pvrb2.count*25 ); in run_parallel_vector_tests()
[all …]
/oneTBB/include/oneapi/tbb/detail/
H A D_utils.h50 std::int32_t count; variable
56 atomic_backoff() : count(1) {} in atomic_backoff()
58 atomic_backoff(bool) : count(1) { pause(); } in atomic_backoff()
66 if (count <= LOOPS_BEFORE_YIELD) { in pause()
67 machine_pause(count); in pause()
69 count *= 2; in pause()
78 machine_pause(count); in bounded_pause()
79 if (count < LOOPS_BEFORE_YIELD) { in bounded_pause()
81 count *= 2; in bounded_pause()
89 count = 1; in reset()
H A D_machine.h153 uint64_t count; in machine_log2()
162 __asm__ ("popc %1, %0" : "=r"(count) : "r"(x) ); in machine_log2()
163 return count - 1; in machine_log2()
/oneTBB/doc/main/tbb_userguide/design_patterns/
H A DReference_Counting.rst48 decrement and test "count is zero?" must act as a single atomic
75 It is incorrect to use a separate read for testing if the count is
95 reference count, because there will be a timing hole between the
96 copying and the increment where the reference count is too low, and
97 thus another thread might decrement the count to zero and delete the
116 *weight* with each pointer. The reference count is the sum of the
118 updating the reference count by splitting the original weight between
120 constant W to the reference count and weight of ``x``.
H A DLocal_Serializer.rst54 ``concurrent_queue`` for the FIFO and ``atomic<int>`` to count the
203 std::atomic<int> count; // Count of queued items and in-flight item
212 if( ++count==1 )
216 if( --count!=0 )
228 - A count of queued or in-flight work.
233 transitions of count are the key understanding how class
237 - If method ``add`` increments ``count`` from 0 to 1, this indicates
242 - If method ``noteCompletion`` decrements count and it is *not* from
/oneTBB/src/tbb/
H A Dconcurrent_monitor.h45 constexpr circular_doubly_linked_list_with_sentinel() : count(0), head(&head, &head) {} in circular_doubly_linked_list_with_sentinel()
50 inline std::size_t size() const { return count.load(std::memory_order_relaxed); } in size()
58 count.store(count.load(std::memory_order_relaxed) + 1, std::memory_order_relaxed); in add()
67 …__TBB_ASSERT(count.load(std::memory_order_relaxed) > 0, "attempt to remove an item from an empty l… in remove()
68 count.store(count.load( std::memory_order_relaxed ) - 1, std::memory_order_relaxed); in remove()
77 lst.count.store(l_count, std::memory_order_relaxed); in flush_to()
89 count.store(0, std::memory_order_relaxed); in clear()
92 std::atomic<std::size_t> count;
H A Dmain.cpp58 std::atomic<int> __TBB_InitOnce::count{};
95 if (++count == 1) { in add_ref()
102 int k = --count; in remove_ref()
/oneTBB/doc/main/tbb_userguide/
H A Duse_limiter_node.rst23 A limiter_node maintains an internal count of the messages that it has
26 decrement the count, allowing additional messages to pass through. In
77 therefore start rejecting incoming messages after its internal count
82 the ``limiter_node`` internal count is decremented. When the internal count
H A Duse_input_node.rst76 int count = 0;
80 if ( count < limit ) {
81 return ++count;
/oneTBB/examples/parallel_reduce/convex_hull/
H A Dconvex_hull.hpp102 point<T> GenerateRNDPoint(std::size_t& count, rng_functor_type random, std::size_t rand_max) { in GenerateRNDPoint() argument
110 count++; in GenerateRNDPoint()
111 if (count > 10) { in GenerateRNDPoint()
116 count = 0; in GenerateRNDPoint()
H A Dconvex_hull_bench.cpp245 std::size_t count = 0; in operator ()() local
253 points[i] = util::GenerateRNDPoint<double>(count, the_rng, util::rng::max_rand); in operator ()()
272 std::size_t count = 0, j = 0; in operator ()() local
276 tmp_vec[j++] = util::GenerateRNDPoint<double>(count, the_rng, util::rng::max_rand); in operator ()()
658 for (std::size_t i = 0, count = 0; long(i) < cfg::numberOfPoints; ++i) { in serial_initialize() local
659 points.push_back(util::GenerateRNDPoint<double>(count, &std::rand, RAND_MAX)); in serial_initialize()
/oneTBB/examples/parallel_for/game_of_life/
H A DGame_of_life.cpp122 int* count = nullptr; in main() local
127 m_board1 = new Board(boardWidth, boardHeight, BOARD_SQUARE_SIZE, count); in main()
128 m_board2 = new Board(boardWidth, boardHeight, BOARD_SQUARE_SIZE, count); in main()

123