| /oneTBB/examples/graph/cholesky/ |
| H A D | init.cpp | 26 double *L = (double *)calloc(sizeof(double), n * n); in posdef_gen() 29 double *LT = (double *)calloc(sizeof(double), n * n); in posdef_gen() 32 memset(A, 0, sizeof(double) * n * n); in posdef_gen() 38 L[k * n + j] = in posdef_gen() 42 L[j * n + j] = 1; in posdef_gen() 48 LT[j * n + i] = L[i * n + j]; in posdef_gen() 51 cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, n, n, n, 1, L, n, LT, n, 0, A, n); in posdef_gen() 73 A = (double *)calloc(sizeof(double), n * n); in matrix_init() 81 A[j * n + i] = A[i * n + j]; in matrix_init() 88 A = (double *)calloc(sizeof(double), n * n); in matrix_init() [all …]
|
| H A D | cholesky.cpp | 71 const int p = n / b; in create_tile_array() 95 const int p = n / b; in collapse_tile_array() 135 dgemm(&transa, &transb, &n, &n, &n, &alpha, A0, &n, A0, &n, &beta, C, &n); in check_if_valid() 141 if (std::abs(C[j * n + i] - A[j * n + i]) > epsilon) { in check_if_valid() 168 double *A0 = (double *)calloc(sizeof(double), n * n); in operator ()() 169 double *C = (double *)calloc(sizeof(double), n * n); in operator ()() 181 memcpy(A0, A, sizeof(double) * n * n); in operator ()() 212 n, in operator ()() 271 const int p = n / b; in func() 294 int lda = n; in func() [all …]
|
| /oneTBB/src/tbb/ |
| H A D | concurrent_monitor.h | 40 constexpr base_node(base_node* n, base_node* p) : next(n), prev(p) {} in base_node() 62 head.prev = n; in add() 69 n.prev->next = n.next; in remove() 70 n.next->prev = n.prev; in remove() 332 for (base_node* n = temp.front(); n != end; n = n->next) { in notify_all_relaxed() local 338 for (base_node* n = temp.front(); n != end; n=nxt) { in notify_all_relaxed() local 368 for (base_node* n = my_waitset.last(); n != end; n = nxt) { in notify_relaxed() local 380 for (base_node* n=temp.front(); n != end; n = nxt) { in notify_relaxed() local 403 for (base_node* n = my_waitset.last(); n != end; n = next) { in notify_one_relaxed() local 439 for (base_node* n = temp.front(); n != end; n = n->next) { in abort_all_relaxed() local [all …]
|
| /oneTBB/examples/migration/recursive_fibonacci/ |
| H A D | fibonacci_two_tasks.h | 29 long serial_fib(int n) { in serial_fib() argument 30 return n < 2 ? n : serial_fib(n - 1) + serial_fib(n - 2); in serial_fib() 46 fib_computation(int n, int* x) : n(n), x(x) {} in fib_computation() 50 if (n < cutoff) { in execute() 51 *x = serial_fib(n); in execute() 56 task_emulation::run_task(c.create_child<fib_computation>(n - 1, &c.x)); in execute() 60 n = n - 2; in execute() 67 int n; member 71 int fibonacci_two_tasks(int n) { in fibonacci_two_tasks() argument 75 task_emulation::create_root_task<fib_computation>(/* for root task = */ tg, n, &sum)); in fibonacci_two_tasks()
|
| H A D | fibonacci_single_task.h | 29 long serial_fib_1(int n) { in serial_fib_1() argument 30 return n < 2 ? n : serial_fib_1(n - 1) + serial_fib_1(n - 2); in serial_fib_1() 39 single_fib_task(int n, int* x) : n(n), x(x), s(state::compute) in single_fib_task() 53 if (n == cutoff && num_recycles > 0) { in execute() 67 if (n < cutoff) { in compute_impl() 68 *x = serial_fib_1(n); in compute_impl() 71 bypass = this->allocate_child_and_increment<single_fib_task>(n - 2, &x_r); in compute_impl() 72 … task_emulation::run_task(this->allocate_child_and_increment<single_fib_task>(n - 1, &x_l)); in compute_impl() 82 int n; member 90 int fibonacci_single_task(int n) { in fibonacci_single_task() argument [all …]
|
| /oneTBB/test/common/ |
| H A D | test_comparisons.h | 111 return lhs.n == rhs.n; 116 return lhs.n != rhs.n; 121 return lhs.n < rhs.n; 126 return lhs.n > rhs.n; 131 return lhs.n <= rhs.n; 136 return lhs.n >= rhs.n; 196 return lhs.n <=> rhs.n; 222 return lhs.n <=> rhs.n; 225 return lhs.n == rhs.n; 238 return lhs.n < rhs.n; [all …]
|
| H A D | vector_types.h | 44 static constexpr int n = 16; variable 46 Mvec field[n]; 50 ClassWithVectorType() { init(-n); } in ClassWithVectorType() 53 for (int i = 0; i < n; ++i) { in ClassWithVectorType() 59 Mvec stack[n]; 60 for (int i = 0; i < n; ++i) { 63 for (int i = 0; i < n; ++i) { 72 for( int i = 0; i < F*n; ++i ) { 86 Mvec stack[n]; in init() 87 for( int i = 0; i < n; ++i ) { in init() [all …]
|
| H A D | iterator.h | 168 RandomIterator operator+ (difference_type n) const {return RandomIterator(my_ptr + n);} 175 my_ptr += n; 179 my_ptr -= n; 184 return RandomIterator(it.my_ptr + n); 187 return RandomIterator(my_ptr - n); 190 return my_ptr[n]; 226 … ConstRandomIterator operator+ (difference_type n) const {return ConstRandomIterator(my_ptr + n);} 234 my_ptr += n; 238 my_ptr -= n; 246 return ConstRandomIterator(my_ptr - n); [all …]
|
| /oneTBB/test/tbb/ |
| H A D | test_openmp.cpp | 38 for (int i = 0; i < m + n - 1; ++i) { in SerialConvolve() 39 int start = i < n ? 0 : i - n + 1; in SerialConvolve() 84 for (int i = 0; i < m + n - 1; ++i) { in OpenMP_TBB_Convolve() 85 int start = i < n ? 0 : i - n + 1; in OpenMP_TBB_Convolve() 99 const int n; member in OuterBody 114 int start = i < n ? 0 : i - n + 1; in operator ()() 127 tbb::parallel_for(tbb::blocked_range<int>(0, m + n - 1, 10), OuterBody(c, a, m, b, n, p)); in TBB_OpenMP_Convolve() 150 void RunTest( Func F, int m, int n, int p) { in RunTest() argument 152 memset(actual, -1, (m + n) * sizeof(data_type)); in RunTest() 153 F(actual, A, m, B, n, p); in RunTest() [all …]
|
| H A D | test_overwrite_node.cpp | 39 tbb::flow::overwrite_node<R> n(g); in simple_read_write_tests() local 48 CHECK_MESSAGE( n.is_valid() == false, "" ); in simple_read_write_tests() 49 CHECK_MESSAGE( n.try_get( v0 ) == false, "" ); in simple_read_write_tests() 58 tbb::flow::make_edge( n, *r[i] ); in simple_read_write_tests() 63 CHECK_MESSAGE( n.try_put( v1 ), "" ); in simple_read_write_tests() 76 tbb::flow::remove_edge( n, *r[i] ); in simple_read_write_tests() 78 CHECK_MESSAGE( n.try_put( R(0) ), "" ); in simple_read_write_tests() 83 n.clear(); in simple_read_write_tests() 84 CHECK_MESSAGE( n.is_valid() == false, "" ); in simple_read_write_tests() 95 native_body( tbb::flow::overwrite_node<R> &n ) : my_node(n) {} in native_body() argument [all …]
|
| H A D | test_write_once_node.cpp | 40 tbb::flow::write_once_node<R> n(g); in simple_read_write_tests() local 50 CHECK_MESSAGE( n.is_valid() == false, "" ); in simple_read_write_tests() 51 CHECK_MESSAGE( n.try_get( v0 ) == false, "" ); in simple_read_write_tests() 55 CHECK_MESSAGE( n.is_valid() == true, "" ); in simple_read_write_tests() 61 tbb::flow::make_edge( n, *r[i] ); in simple_read_write_tests() 74 bool result = n.try_put( v1 ); in simple_read_write_tests() 96 tbb::flow::remove_edge( n, *r[i] ); in simple_read_write_tests() 103 n.clear(); in simple_read_write_tests() 104 CHECK_MESSAGE( n.is_valid() == false, "" ); in simple_read_write_tests() 115 native_body( tbb::flow::write_once_node<R> &n ) : my_node(n) {} in native_body() argument [all …]
|
| H A D | test_broadcast_node.cpp | 96 for (int n = 0; n < N; ++n ) { in test_serial_broadcasts() local 97 CHECK_MESSAGE( b.try_put( (T)n ), "" ); in test_serial_broadcasts() 101 for (int n = 0; n < N; ++n ) { in test_serial_broadcasts() local 102 CHECK_MESSAGE( (*receivers[r])[n] == 1, "" ); in test_serial_broadcasts() 123 for (int n = 0; n < N; ++n ) { in operator ()() local 124 CHECK_MESSAGE( my_b.try_put( (T)n ), "" ); in operator ()() 144 for (int n = 0; n < N; ++n ) { in run_parallel_broadcasts() local 145 CHECK_MESSAGE( (int)(*receivers[r])[n] == p, "" ); in run_parallel_broadcasts()
|
| H A D | test_parallel_for_each.cpp | 73 cpp20_iterator& operator+=(difference_type n) in operator +=() 76 my_ptr += n; in operator +=() 80 cpp20_iterator& operator-=(difference_type n) in operator -=() 83 my_ptr -= n; in operator -=() 87 T& operator[](difference_type n) const in operator []() 90 return my_ptr[n]; in operator []() 101 return cpp20_iterator(i.my_ptr + n); in operator +() 107 return i + n; in operator +() 113 return cpp20_iterator(i.my_ptr - n); in operator -() 291 constexpr std::size_t n = 1'000'000; in test_with_cpp20_iterator() local [all …]
|
| /oneTBB/examples/parallel_for_each/parallel_preorder/ |
| H A D | Matrix.hpp | 21 static const int n = 20; member in Matrix 22 float array[n][n]; 27 for (int i = 0; i < n; ++i) in Matrix() 28 for (int j = 0; j < n; ++j) in Matrix() 33 for (int i = 0; i < n; ++i) in operator -() 34 for (int j = 0; j < n; ++j) in operator -() 40 for (int i = 0; i < n; ++i) in operator +() 41 for (int j = 0; j < n; ++j) in operator +() 47 for (int i = 0; i < n; ++i) in operator -() 48 for (int j = 0; j < n; ++j) in operator -() [all …]
|
| /oneTBB/examples/test_all/fibonacci/ |
| H A D | fibonacci.cpp | 80 if (n < 2) in SerialFib() 81 return n; in SerialFib() 106 if (n < 2) in SerialRecursiveFib() 107 result = n; in SerialRecursiveFib() 109 result = SerialRecursiveFib(n - 1) + SerialRecursiveFib(n - 2); in SerialRecursiveFib() 149 return A[n]; in SerialVectorFib() 201 SharedN = n; in SharedSerialFib() 280 int n = --N; in operator ()() local 308 N = n - 1; in ParallelPipeFib() 312 n, in ParallelPipeFib() [all …]
|
| /oneTBB/src/tbb/tools_api/legacy/ |
| H A D | ittnotify.h | 166 #define ITT_JOIN_AUX(p,n) p##n argument 167 #define ITT_JOIN(p,n) ITT_JOIN_AUX(p,n) argument 192 #define ITTNOTIFY_NAME_AUX(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n) argument 195 #define ITTNOTIFY_VOID(n) (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n) argument 196 #define ITTNOTIFY_DATA(n) (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n) argument 198 …ne ITTNOTIFY_VOID_D0(n,d) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME… argument 199 …ne ITTNOTIFY_VOID_D1(n,d,x) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME… argument 205 …efine ITTNOTIFY_DATA_D0(n,d) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)… argument 206 …efine ITTNOTIFY_DATA_D1(n,d,x) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)… argument 207 …efine ITTNOTIFY_DATA_D2(n,d,x,y) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)… argument [all …]
|
| /oneTBB/examples/parallel_for/tachyon/src/ |
| H A D | apigeom.cpp | 92 for (yy = 0; yy < (n - 1); yy++) { in rt_heightfield() 96 v0.z = wy * (yy) / (n * 1.0) + yoff; in rt_heightfield() 100 v1.z = wy * (yy) / (n * 1.0) + yoff; in rt_heightfield() 141 yinc = wy / ((apiflt)n); in rt_sheightfield() 144 for (y = 0; y < n; y++) { in rt_sheightfield() 156 for (y = 1; y < n; y++) { in rt_sheightfield() 159 for (y = 1; y < (n - 1); y++) { in rt_sheightfield() 172 for (y = 0; y < (n - 1); y++) { in rt_sheightfield() 256 totalsize = m * n; in rt_landscape() 262 for (y = 0; y < n; y++) { in rt_landscape() [all …]
|
| H A D | cylinder.cpp | 91 vector rc, n, D, O; in cylinder_intersect() local 98 VCross(&ry->d, &cyl->axis, &n); in cylinder_intersect() 100 VDOT(ln, n, n); in cylinder_intersect() 115 VNorm(&n); in cylinder_intersect() 116 VDOT(d, rc, n); in cylinder_intersect() 121 VDOT(t, O, n); in cylinder_intersect() 123 VCross(&n, &cyl->axis, &O); in cylinder_intersect() 213 VDOT(ln, n, n); in fcylinder_intersect() 220 VNorm(&n); in fcylinder_intersect() 221 VDOT(d, rc, n); in fcylinder_intersect() [all …]
|
| /oneTBB/doc/main/tbb_userguide/ |
| H A D | Edges.rst | 20 function_node< int, int > n( g, unlimited, []( int v ) -> int { 33 make_edge( n, m ); 34 n.try_put( 1 ); 35 n.try_put( 2 ); 36 n.try_put( 3 ); 40 Now there are two ``function_node`` ``s``, ``n`` and ``m``. The call to ``make_edge`` creates 41 an edge from ``n`` to ``m``. The node ``n`` is created with unlimited concurrency, 42 while ``m`` has a concurrency limit of 1. The invocations of ``n`` can all 44 Because there is an edge from ``n`` to ``m``, each value ``v``, returned by ``n``, will
|
| H A D | Mutual_Exclusion.rst | 29 Node* n; 32 n = FreeList; 33 if( n ) 36 if( !n ) 38 return n; 45 FreeList = n; 76 Node* n; 79 n = FreeList; 80 if( n ) 83 if( !n ) [all …]
|
| H A D | use_nested_flow_graphs.rst | 20 node_t n1( h, [=]( msg_t ) { cout << "n1: " << i << "\n"; } ); 21 node_t n2( h, [=]( msg_t ) { cout << "n2: " << i << "\n"; } ); 22 node_t n3( h, [=]( msg_t ) { cout << "n3: " << i << "\n"; } ); 35 cout << "m1: " << j << "\n"; 39 cout << "m2: " << j << "\n"; 43 cout << "m3: " << j << "\n"; 47 cout << "m4: " << j << "\n"; 77 cout << "m1: " << j << "\n"; 81 cout << "m2: " << j << "\n"; 85 cout << "m3: " << j << "\n"; [all …]
|
| /oneTBB/examples/parallel_reduce/convex_hull/ |
| H A D | README.md | 23 convex_hull_sample [n-of-threads=value] [n-of-points=value] [silent] [verbose] [-h] [n-of-threads [… 24 convex_hull_bench [n-of-threads=value] [n-of-points=value] [silent] [verbose] [-h] [n-of-threads [n… 27 * `n-of-threads` - the number of threads to use; a range of the form low\[:high\], where low and op… 28 * `n-of-points` - number of points.
|
| /oneTBB/examples/parallel_reduce/primes/ |
| H A D | primes.cpp | 64 Multiples(NumberType n) { in Multiples() argument 65 m = NumberType(sqrt(double(n))); in Multiples() 156 NumberType count = n >= 2; in SerialCountPrimes() 157 if (n >= 3) { in SerialCountPrimes() 158 Multiples multiples(n); in SerialCountPrimes() 164 if (j + window_size > n + 1) in SerialCountPrimes() 165 window_size = n + 1 - j; in SerialCountPrimes() 246 Sieve(NumberType n) : multiples(n), count(0) {} in Sieve() argument 292 NumberType count = n >= 2; in ParallelCountPrimes() 293 if (n >= 3) { in ParallelCountPrimes() [all …]
|
| H A D | main.cpp | 38 NumberType n; member 51 n(n_), in RunOptions() 94 NumberType n = options.n; 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/doc/main/tbb_userguide/design_patterns/ |
| H A D | Lazy_Initialization.rst | 80 std::uint64_t LazyFibHelper(int n, FibBuffer& buffer) { 82 if (n <= 1) { 83 return n; 88 oneapi::tbb::collaborative_call_once(buffer[n].first, [&]() { 90 oneapi::tbb::parallel_invoke([&] { a = LazyFibHelper(n - 2, buffer); }, 91 [&] { b = LazyFibHelper(n - 1, buffer); }); 92 buffer[n].second = a + b; 95 return buffer[n].second; 98 std::uint64_t Fib(int n) { 99 FibBuffer buffer(n+1); [all …]
|