22 #if !defined( BOLT_AMP_PARALLEL_ITER_H )
23 #define BOLT_AMP_PARALLEL_ITER_H
50 template<
typename IterType,
typename Function>
53 using namespace concurrency;
55 parallel_for_each(extent<1>(ext), [=] (index<1> idx)
mutable restrict(amp) {
58 bool keepGoing =
true;
61 keepGoing = f(idx, iter);
69 template<
typename IterType,
typename Function>
70 void parallel_iteration_1(concurrency::extent<1> ext, IterType Init, Function f) {
72 using namespace concurrency;
75 static const int maxQSz=1024;
76 array<pair<index<1>, IterType> outQueue(maxQSz);
79 parallel_for_each(extent<1>(ext), [=] (index<1> idx)
mutable restrict(amp) {
81 int iterations = splitPoint;
83 bool keepGoing =
true;
84 while (keepGoing && --iterations) {
85 keepGoing = f(idx, iter);
90 int lPtr = atomic_fetch_add(&qPtr[0], 1);
93 outQueue[lPtr].first = idx;
94 outQueue[lPtr].second = iter;