168 |
#pragma omp for private(i,j) schedule(static) |
#pragma omp for private(i,j) schedule(static) |
169 |
for (i=0;i<numSamples;i++) { |
for (i=0;i<numSamples;i++) { |
170 |
for (j=0;j<numDPPSample;j++) { |
for (j=0;j<numDPPSample;j++) { |
171 |
resultLocal=data.getPointDataView().algorithm(data.getPointOffset(i,j), operation); |
resultLocal=data.getPointDataView().reductionOp(data.getPointOffset(i,j), operation); |
172 |
#pragma omp critical (algorithm) |
#pragma omp critical (algorithm) |
173 |
operation(resultLocal); |
operation(resultLocal); |
174 |
} |
} |
190 |
DataTagged::DataMapType::const_iterator lookupEnd=lookup.end(); |
DataTagged::DataMapType::const_iterator lookupEnd=lookup.end(); |
191 |
DataArrayView& dataView=data.getPointDataView(); |
DataArrayView& dataView=data.getPointDataView(); |
192 |
for (i=lookup.begin();i!=lookupEnd;i++) { |
for (i=lookup.begin();i!=lookupEnd;i++) { |
193 |
operation(dataView.algorithm(i->second,operation)); |
operation(dataView.reductionOp(i->second,operation)); |
194 |
} |
} |
195 |
// |
// |
196 |
// finally perform the operation on the default value |
// finally perform the operation on the default value |
197 |
operation(data.getDefaultValue().algorithm(operation)); |
operation(data.getDefaultValue().reductionOp(operation)); |
198 |
return operation.getResult(); |
return operation.getResult(); |
199 |
} |
} |
200 |
|
|
204 |
algorithm(DataConstant& data, |
algorithm(DataConstant& data, |
205 |
UnaryFunction operation) |
UnaryFunction operation) |
206 |
{ |
{ |
207 |
return data.getPointDataView().algorithm(operation); |
return data.getPointDataView().reductionOp(operation); |
208 |
} |
} |
209 |
|
|
210 |
/** |
/** |
237 |
for (j=0;j<numDPPSample;j++) { |
for (j=0;j<numDPPSample;j++) { |
238 |
#pragma omp critical (dp_algorithm) |
#pragma omp critical (dp_algorithm) |
239 |
result.getPointDataView().getData(data.getPointOffset(i,j)) = |
result.getPointDataView().getData(data.getPointOffset(i,j)) = |
240 |
data.getPointDataView().dp_algorithm(data.getPointOffset(i,j),operation); |
data.getPointDataView().dp_reductionOp(data.getPointOffset(i,j),operation); |
241 |
} |
} |
242 |
} |
} |
243 |
} |
} |
258 |
DataTagged::DataMapType::const_iterator lookupEnd=lookup.end(); |
DataTagged::DataMapType::const_iterator lookupEnd=lookup.end(); |
259 |
for (i=lookup.begin();i!=lookupEnd;i++) { |
for (i=lookup.begin();i!=lookupEnd;i++) { |
260 |
result.getPointDataView().getData(i->second) = |
result.getPointDataView().getData(i->second) = |
261 |
data.getPointDataView().dp_algorithm(i->second,operation); |
data.getPointDataView().dp_reductionOp(i->second,operation); |
262 |
} |
} |
263 |
// |
// |
264 |
// finally perform the operation on the default data value |
// finally perform the operation on the default data value |
265 |
// and assign this to the default element in result |
// and assign this to the default element in result |
266 |
result.getPointDataView().getData(0) = |
result.getPointDataView().getData(0) = |
267 |
data.getDefaultValue().dp_algorithm(operation); |
data.getDefaultValue().dp_reductionOp(operation); |
268 |
} |
} |
269 |
|
|
270 |
template <class UnaryFunction> |
template <class UnaryFunction> |
278 |
// perform the operation on the default data value |
// perform the operation on the default data value |
279 |
// and assign this to the default element in result |
// and assign this to the default element in result |
280 |
result.getPointDataView().getData(0) = |
result.getPointDataView().getData(0) = |
281 |
data.getPointDataView().dp_algorithm(operation); |
data.getPointDataView().dp_reductionOp(operation); |
282 |
} |
} |
283 |
|
|
284 |
} // end of namespace |
} // end of namespace |