Bolt
1.3
C++ template library with support for OpenCL
|
Defining namespace for the Bolt project. More...
Namespaces | |
namespace | amp |
Namespace containing AMP related data types and functions. | |
namespace | cl |
Namespace containing OpenCL related data types and functions. | |
Classes | |
class | ArrayPool |
class | synchronized_view |
Functions | |
template<typename IterType , typename Function > | |
void | parallel_iteration (concurrency::extent< 1 > ext, IterType Init, Function f) |
template<typename IterType , typename Function > | |
void | parallel_iteration_1 (concurrency::extent< 1 > ext, IterType Init, Function f) |
Defining namespace for the Bolt project.
transform iterator adapts an iterator by modifying the operator* to apply a function object to the result of dereferencing the iterator and returning the result..
The following example demonstrates how to use a transform_iterator
.
void bolt::parallel_iteration | ( | concurrency::extent< 1 > | ext, |
IterType | Init, | ||
Function | f | ||
) |
parallel_iteration1 : Slow implementation - just use a parallel_for for all devices.
Init is the initial state for the Iteration type for every index.
The user provides a functor that accepts two arguments: index<> - location in the extent to be processed. IterType : User-supplied type that tracks the state of each iteration. The functor is responsible for : Updating the state so that it points to the next 'iteration'. The next "iteration" could be the next cascade stage in a face-detection algorithm, or the next iteration of a loop. It is very important to update to the next state to avoid an infinite loop. Returns true if the Bolt runtime is to schedule the next iteration, or false if the runtime is to exit.