Lines Matching refs:a
7 A loop can do a reduction, as in this summation:
13 float SerialSumFoo( float a[], size_t n ) {
16 sum += Foo(a[i]);
28 float ParallelSumFoo( const float a[], size_t n ) {
29 SumFoo sf(a);
48 float *a = my_a;
52 sum += Foo(a[i]);
63 SumFoo(float a[] ) :
64 my_a(a), my_sum(0)
71 SumFoo::my_sum. Second, ``SumFoo`` has a *splitting constructor* and a
73 The splitting constructor takes as arguments a reference to the original
74 object, and a dummy argument of type ``split``, which is defined by the
76 a copy constructor.
81 variables (``a``, ``sum``, ``end``) for scalar values accessed inside
85 their address taken in a way the compiler cannot track, the technique
86 might not help. With a typical optimizing compiler, using local
93 When a worker thread is available, as decided by the task scheduler,
94 ``parallel_reduce`` invokes the splitting constructor to create a
98 happens when a worker is available:
113 So if the splitting constructor needs to increment a reference count
117 If a worker is not available, the second half of the iteration is
147 sum += Foo(a[i]);
154 With the mistake, the body returns a partial sum for the last subrange
175 a single ``parallel_reduce``.