Bolt  1.1
C++ template library with support for OpenCL
Classes | Typedefs | Functions | Variables
bolt::cl Namespace Reference

Namespace containing OpenCL related data types and functions. More...

Classes

class  KernelTemplateSpecializer
 
struct  ProgramMapKey
 This structure ensures that a kernel is compiled only once for specified devices. More...
 
struct  ProgramMapValue
 
struct  ProgramMapKeyComp
 
class  control
 
struct  device_vector_tag
 
class  device_vector
 This defines the OpenCL version of a device_vector. More...
 
struct  pair
 
struct  tuple_element< 0, pair< T1, T2 > >
 
struct  tuple_element< 1, pair< T1, T2 > >
 
struct  tuple_size< pair< T1, T2 > >
 
struct  constant_iterator_tag
 
class  constant_iterator
 
struct  counting_iterator_tag
 
class  counting_iterator
 
struct  input_iterator_tag
 
struct  output_iterator_tag
 
struct  forward_iterator_tag
 
struct  bidirectional_iterator_tag
 
struct  random_access_iterator_tag
 
struct  fancy_iterator_tag
 
struct  iterator_traits
 
struct  iterator_traits< T * >
 
struct  iterator_traits< const T * >
 

Typedefs

typedef ::std::map
< ProgramMapKey,
ProgramMapValue,
ProgramMapKeyComp
ProgramMap
 

Functions

template<typename ForwardIterator , typename T >
bool binary_search (bolt::cl::control &ctl, ForwardIterator first, ForwardIterator last, const T &value, const std::string &cl_code="")
 This version of binary search returns true if the search value is present within the given input range and false otherwise. The routine requires the elements to be arranged in ascending/descending order. It returns true iff there exists an iterator i in [first, last) such that *i < value and value < *i are both false.
 
template<typename ForwardIterator , typename T >
bool binary_search (ForwardIterator first, ForwardIterator last, const T &value, const std::string &cl_code="")
 
template<typename ForwardIterator , typename T , typename StrictWeakOrdering >
bool binary_search (bolt::cl::control &ctl, ForwardIterator first, ForwardIterator last, const T &value, StrictWeakOrdering comp, const std::string &cl_code="")
 This version of binary search returns true if the search value is present within the given input range and false otherwise. The routine requires the elements to be arranged in ascending/descending order. It returns true iff there exists an iterator i in [first, last) such that comp(*i, value) and comp(value, *i) are both false.
 
template<typename ForwardIterator , typename T , typename StrictWeakOrdering >
bool binary_search (ForwardIterator first, ForwardIterator last, const T &value, StrictWeakOrdering comp, const std::string &cl_code="")
 
std::string fileToString (const std::string &fileName)
 
::std::vector< ::cl::Kernel > getKernels (const control &ctl, const ::std::vector< ::std::string > &typeNames, const KernelTemplateSpecializer *const kts, const ::std::vector< ::std::string > &typeDefinitions, const std::string &baseKernelString, const std::string &compileOptions="")
 
void getVersion (cl_uint &major, cl_uint &minor, cl_uint &patch)
 Query the Bolt library for version information.
 
std::string clErrorStringA (const cl_int &status)
 Translates an integer OpenCL error code to a std::string at runtime.
 
std::wstring clErrorStringW (const cl_int &status)
 Translates an integer OpenCL error code to a std::wstring at runtime.
 
cl_int V_OpenCL (cl_int res, const std::string &msg, size_t lineno)
 Helper print function to stringify OpenCL error codes.
 
void wait (const bolt::cl::control &ctl,::cl::Event &e)
 
template<typename InputIterator , typename OutputIterator >
OutputIterator copy (const bolt::cl::control &ctl, InputIterator first, InputIterator last, OutputIterator result, const std::string &user_code="")
 
template<typename InputIterator , typename OutputIterator >
OutputIterator copy (InputIterator first, InputIterator last, OutputIterator result, const std::string &user_code="")
 
template<typename InputIterator , typename Size , typename OutputIterator >
OutputIterator copy_n (const bolt::cl::control &ctl, InputIterator first, Size n, OutputIterator result, const std::string &user_code="")
 
template<typename InputIterator , typename Size , typename OutputIterator >
OutputIterator copy_n (InputIterator first, Size n, OutputIterator result, const std::string &user_code="")
 
template<typename InputIterator , typename Predicate >
bolt::cl::iterator_traits
< InputIterator >
::difference_type 
count_if (control &ctl, InputIterator first, InputIterator last, Predicate predicate=bolt::cl::detail::CountIfEqual< int >(), const std::string &cl_code="")
 count_if counts the number of elements in the specified range for which the specified predicate is true.
 
template<typename InputIterator , typename Predicate >
bolt::cl::iterator_traits
< InputIterator >
::difference_type 
count_if (InputIterator first, InputIterator last, Predicate predicate, const std::string &cl_code="")
 
template<typename InputIterator , typename EqualityComparable >
bolt::cl::iterator_traits
< InputIterator >
::difference_type 
count (control &ctl, InputIterator first, InputIterator last, const EqualityComparable &value, const std::string &cl_code="")
 count counts the number of elements in the specified range which compare equal to the specified value.
 
template<typename InputIterator , typename EqualityComparable >
bolt::cl::iterator_traits
< InputIterator >
::difference_type 
count (InputIterator first, InputIterator last, const EqualityComparable &value, const std::string &cl_code="")
 
template<typename ForwardIterator , typename T >
void fill (const bolt::cl::control &ctl, ForwardIterator first, ForwardIterator last, const T &value, const std::string &cl_code="")
 Fill assigns the value of value to each element in the range [first,last].
 
template<typename ForwardIterator , typename T >
void fill (ForwardIterator first, ForwardIterator last, const T &value, const std::string &cl_code="")
 
template<typename OutputIterator , typename Size , typename T >
OutputIterator fill_n (const bolt::cl::control &ctl, OutputIterator first, Size n, const T &value, const std::string &cl_code="")
 fill_n assigns the value value to every element in the range [first,first+n]. The return value is first + n.
 
template<typename OutputIterator , typename Size , typename T >
OutputIterator fill_n (OutputIterator first, Size n, const T &value, const std::string &cl_code="")
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator >
void gather (::bolt::cl::control &ctl, InputIterator1 map_first, InputIterator1 map_last, InputIterator2 input_first, OutputIterator result, const std::string &user_code="")
 This version of gather copies elements from a source array to a destination range according to a specified map. For each i in InputIterator1 in the range [map_first, map_last), gather copies the corresponding input_first[ map [ i ] ] to result[ i - map_first ].
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator >
void gather (InputIterator1 map_first, InputIterator1 map_last, InputIterator2 input_first, OutputIterator result, const std::string &user_code="")
 
template<typename InputIterator1 , typename InputIterator2 , typename InputIterator3 , typename OutputIterator >
void gather_if (bolt::cl::control &ctl, InputIterator1 map_first, InputIterator1 map_last, InputIterator2 stencil, InputIterator3 input_first, OutputIterator result, const std::string &user_code="")
 This version of gather copies elements from a source array to a destination range according to a specified map. For each i in InputIterator1 in the range [map_first, map_last), gather copies the corresponding input_first[ map [ i ] ] to result[ i - map_first ] if stencil[ i - map_first ] is true.
 
template<typename InputIterator1 , typename InputIterator2 , typename InputIterator3 , typename OutputIterator >
void gather_if (InputIterator1 map_first, InputIterator1 map_last, InputIterator2 stencil, InputIterator3 input_first, OutputIterator result, const std::string &user_code="")
 
template<typename InputIterator1 , typename InputIterator2 , typename InputIterator3 , typename OutputIterator , typename Predicate >
void gather_if (bolt::cl::control &ctl, InputIterator1 map_first, InputIterator1 map_last, InputIterator2 stencil, InputIterator3 input, OutputIterator result, Predicate pred, const std::string &user_code="")
 This version of gather copies elements from a source array to a destination range according to a specified map. For each i in InputIterator1 in the range [map_first, map_last), gather copies the corresponding input_first[ map [ i ] ] to result[ i - map_first ] if pred (stencil[ i - map_first ]) is true.
 
template<typename InputIterator1 , typename InputIterator2 , typename InputIterator3 , typename OutputIterator , typename Predicate >
void gather_if (InputIterator1 map_first, InputIterator1 map_last, InputIterator2 stencil, InputIterator3 input, OutputIterator result, Predicate pred, const std::string &user_code="")
 
template<typename ForwardIterator , typename Generator >
void generate (bolt::cl::control &ctl, ForwardIterator first, ForwardIterator last, Generator gen, const std::string &cl_code="")
 generate assigns to each element of a sequence [first,last] the value returned by gen.
 
template<typename ForwardIterator , typename Generator >
void generate (ForwardIterator first, ForwardIterator last, Generator gen, const std::string &cl_code="")
 
template<typename OutputIterator , typename Size , typename Generator >
OutputIterator generate_n (bolt::cl::control &ctl, OutputIterator first, Size n, Generator gen, const std::string &cl_code="")
 generate_n assigns to each element of a sequence [first,first+n] the value returned by gen.
 
template<typename OutputIterator , typename Size , typename Generator >
OutputIterator generate_n (OutputIterator first, Size n, Generator gen, const std::string &cl_code="")
 
template<typename InputIterator , typename OutputType >
OutputType inner_product (bolt::cl::control &ctl, InputIterator first1, InputIterator last1, InputIterator first2, OutputType init, const std::string &cl_code="")
 Inner Product returns the inner product of two iterators. This is similar to calculating binary transform and then reducing the result. The inner_product operation is similar the std::inner_product function. This function can take optional control structure to control command-queue.
 
template<typename InputIterator , typename OutputType >
OutputType inner_product (InputIterator first1, InputIterator last1, InputIterator first2, OutputType init, const std::string &cl_code="")
 
template<typename InputIterator , typename OutputType , typename BinaryFunction1 , typename BinaryFunction2 >
OutputType inner_product (bolt::cl::control &ctl, InputIterator first1, InputIterator last1, InputIterator first2, OutputType init, BinaryFunction1 f1, BinaryFunction2 f2, const std::string &cl_code="")
 Inner Product returns the inner product of two iterators using user specified binary functors f1 and f2. This is similar to calculating transform and then reducing the result. The functor f1 should be commutative. This function can take optional control structure to control command-queue. The inner_product operation is similar the std::inner_product function.
 
template<typename InputIterator , typename OutputType , typename BinaryFunction1 , typename BinaryFunction2 >
OutputType inner_product (InputIterator first1, InputIterator last1, InputIterator first2, OutputType init, BinaryFunction1 f1, BinaryFunction2 f2, const std::string &cl_code="")
 
template<typename ForwardIterator >
ForwardIterator max_element (bolt::cl::control &ctl, ForwardIterator first, ForwardIterator last, const std::string &cl_code="")
 The max_element returns the location of the first maximum element in the specified range.
 
template<typename ForwardIterator >
ForwardIterator max_element (ForwardIterator first, ForwardIterator last, const std::string &cl_code="")
 
template<typename ForwardIterator , typename BinaryPredicate >
ForwardIterator max_element (bolt::cl::control &ctl, ForwardIterator first, ForwardIterator last, BinaryPredicate binary_op, const std::string &cl_code="")
 The max_element returns the location of the first maximum element in the specified range using the specified binary_op.
 
template<typename ForwardIterator , typename BinaryPredicate >
ForwardIterator max_element (ForwardIterator first, ForwardIterator last, BinaryPredicate binary_op, const std::string &cl_code="")
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator >
OutputIterator merge (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, const std::string &cl_code="")
 merge returns the result of combining the two sorted range [first1, last1] and [first2, last2] in to a single sorted range [result , result + (last1-first1) + ( last2-first2)]
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator >
OutputIterator merge (bolt::cl::control &ctl, InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, const std::string &cl_code="")
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename StrictWeakCompare >
OutputIterator merge (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, StrictWeakCompare comp, const std::string &cl_code="")
 merge returns the result of combining the two sorted range [first1, last1] and [first2, last2] in to a single sorted range [result , result + (last1-first1) + ( last2-first2)]
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename StrictWeakCompare >
OutputIterator merge (bolt::cl::control &ctl, InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, StrictWeakCompare comp, const std::string &cl_code="")
 
template<typename ForwardIterator >
ForwardIterator min_element (bolt::cl::control &ctl, ForwardIterator first, ForwardIterator last, const std::string &cl_code="")
 The min_element returns the location of the first minimum element in the specified range.
 
template<typename ForwardIterator >
ForwardIterator min_element (ForwardIterator first, ForwardIterator last, const std::string &cl_code="")
 
template<typename ForwardIterator , typename BinaryPredicate >
ForwardIterator min_element (bolt::cl::control &ctl, ForwardIterator first, ForwardIterator last, BinaryPredicate binary_op, const std::string &cl_code="")
 The min_element returns the location of the first minimum element in the specified range using the specified binary_op.
 
template<typename ForwardIterator , typename BinaryPredicate >
ForwardIterator min_element (ForwardIterator first, ForwardIterator last, BinaryPredicate binary_op, const std::string &cl_code="")
 
template<typename T1 , typename T2 >
bool operator== (const pair< T1, T2 > &x, const pair< T1, T2 > &y)
 
template<typename T1 , typename T2 >
bool operator< (const pair< T1, T2 > &x, const pair< T1, T2 > &y)
 
template<typename T1 , typename T2 >
bool operator!= (const pair< T1, T2 > &x, const pair< T1, T2 > &y)
 
template<typename T1 , typename T2 >
bool operator> (const pair< T1, T2 > &x, const pair< T1, T2 > &y)
 
template<typename T1 , typename T2 >
bool operator<= (const pair< T1, T2 > &x, const pair< T1, T2 > &y)
 
template<typename T1 , typename T2 >
bool operator>= (const pair< T1, T2 > &x, const pair< T1, T2 > &y)
 
template<typename T1 , typename T2 >
pair< T1, T2 > make_pair (T1 x, T2 y)
 
template<typename InputIterator >
std::iterator_traits
< InputIterator >::value_type 
reduce (bolt::cl::control &ctl, InputIterator first, InputIterator last, const std::string &cl_code="")
 reduce returns the result of combining all the elements in the specified range using the specified binary_op. The classic example is a summation, where the binary_op is the plus operator. By default, the initial value is "0" and the binary operator is "plus<>()".
 
template<typename InputIterator >
std::iterator_traits
< InputIterator >::value_type 
reduce (InputIterator first, InputIterator last, const std::string &cl_code="")
 
template<typename InputIterator , typename T >
reduce (bolt::cl::control &ctl, InputIterator first, InputIterator last, T init, const std::string &cl_code="")
 reduce returns the result of combining all the elements in the specified range using the specified binary_op. The classic example is a summation, where the binary_op is the plus operator. By default, the initial value is "0" and the binary operator is "plus<>()".
 
template<typename InputIterator , typename T >
reduce (InputIterator first, InputIterator last, T init, const std::string &cl_code="")
 
template<typename InputIterator , typename T , typename BinaryFunction >
reduce (bolt::cl::control &ctl, InputIterator first, InputIterator last, T init, BinaryFunction binary_op=bolt::cl::plus< T >(), const std::string &cl_code="")
 reduce returns the result of combining all the elements in the specified range using the specified binary_op. The classic example is a summation, where the binary_op is the plus operator. By default, the binary operator is "plus<>()". The version takes a bolt::cl::control structure as a first argument.
 
template<typename InputIterator , typename T , typename BinaryFunction >
reduce (InputIterator first, InputIterator last, T init, BinaryFunction binary_op, const std::string &cl_code="")
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator1 , typename OutputIterator2 >
pair< OutputIterator1,
OutputIterator2 > 
reduce_by_key (control &ctl, InputIterator1 keys_first, InputIterator1 keys_last, InputIterator2 values_first, OutputIterator1 keys_output, OutputIterator2 values_output, const std::string &user_code="")
 reduce_by_key performs, on a sequence, a reduction of each sub-sequence as defined by equivalent keys; the BinaryFunction in this version is plus(), and the BinaryPredicate is equal_to().
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator1 , typename OutputIterator2 >
pair< OutputIterator1,
OutputIterator2 > 
reduce_by_key (InputIterator1 keys_first, InputIterator1 keys_last, InputIterator2 values_first, OutputIterator1 keys_output, OutputIterator2 values_output, const std::string &user_code="")
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator1 , typename OutputIterator2 , typename BinaryPredicate >
pair< OutputIterator1,
OutputIterator2 > 
reduce_by_key (control &ctl, InputIterator1 keys_first, InputIterator1 keys_last, InputIterator2 values_first, OutputIterator1 keys_output, OutputIterator2 values_output, BinaryPredicate binary_pred, const std::string &user_code="")
 reduce_by_key performs, on a sequence, a reduction of each sub-sequence as defined by equivalent keys; the BinaryFunction in this version is plus().
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator1 , typename OutputIterator2 , typename BinaryPredicate >
pair< OutputIterator1,
OutputIterator2 > 
reduce_by_key (InputIterator1 keys_first, InputIterator1 keys_last, InputIterator2 values_first, OutputIterator1 keys_output, OutputIterator2 values_output, BinaryPredicate binary_pred, const std::string &user_code="")
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator1 , typename OutputIterator2 , typename BinaryPredicate , typename BinaryFunction >
pair< OutputIterator1,
OutputIterator2 > 
reduce_by_key (control &ctl, InputIterator1 keys_first, InputIterator1 keys_last, InputIterator2 values_first, OutputIterator1 keys_output, OutputIterator2 values_output, BinaryPredicate binary_pred, BinaryFunction binary_op, const std::string &user_code="")
 reduce_by_key performs, on a sequence, a reduction of each sub-sequence as defined by equivalent keys;
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator1 , typename OutputIterator2 , typename BinaryPredicate , typename BinaryFunction >
pair< OutputIterator1,
OutputIterator2 > 
reduce_by_key (InputIterator1 keys_first, InputIterator1 keys_last, InputIterator2 values_first, OutputIterator1 keys_output, OutputIterator2 values_output, BinaryPredicate binary_pred, BinaryFunction binary_op, const std::string &user_code="")
 
template<typename InputIterator , typename OutputIterator >
OutputIterator inclusive_scan (control &ctl, InputIterator first, InputIterator last, OutputIterator result, const std::string &user_code="")
 inclusive_scan calculates a running sum over a range of values, inclusive of the current value. The result value at iterator position i is the running sum of all values less than i in the input range. inclusive_scan requires associativity of the binary operation to parallelize the prefix sum.
 
template<typename InputIterator , typename OutputIterator >
OutputIterator inclusive_scan (InputIterator first, InputIterator last, OutputIterator result, const std::string &user_code="")
 
template<typename InputIterator , typename OutputIterator , typename BinaryFunction >
OutputIterator inclusive_scan (control &ctl, InputIterator first, InputIterator last, OutputIterator result, BinaryFunction binary_op, const std::string &user_code="")
 inclusive_scan calculates a running sum over a range of values, inclusive of the current value. The result value at iterator position i is the running sum of all values less than i in the input range. inclusive_scan requires associativity of the binary operation to parallelize the prefix sum.
 
template<typename InputIterator , typename OutputIterator , typename BinaryFunction >
OutputIterator inclusive_scan (InputIterator first, InputIterator last, OutputIterator result, BinaryFunction binary_op, const std::string &user_code="")
 
template<typename InputIterator , typename OutputIterator >
OutputIterator exclusive_scan (control &ctl, InputIterator first, InputIterator last, OutputIterator result, const std::string &user_code="")
 exclusive_scan calculates a running sum over a range of values, exclusive of the current value. The result value at iterator position i is the running sum of all values less than i in the input range. exclusive_scan requires associativity of the binary operation to parallelize it.
 
template<typename InputIterator , typename OutputIterator >
OutputIterator exclusive_scan (InputIterator first, InputIterator last, OutputIterator result, const std::string &user_code="")
 
template<typename InputIterator , typename OutputIterator , typename T >
OutputIterator exclusive_scan (control &ctl, InputIterator first, InputIterator last, OutputIterator result, T init, const std::string &user_code="")
 exclusive_scan calculates a running sum over a range of values, exclusive of the current value. The result value at iterator position i is the running sum of all values less than i in the input range. exclusive_scan requires associativity of the binary operation to parallelize it.
 
template<typename InputIterator , typename OutputIterator , typename T >
OutputIterator exclusive_scan (InputIterator first, InputIterator last, OutputIterator result, T init, const std::string &user_code="")
 
template<typename InputIterator , typename OutputIterator , typename T , typename BinaryFunction >
OutputIterator exclusive_scan (control &ctl, InputIterator first, InputIterator last, OutputIterator result, T init, BinaryFunction binary_op, const std::string &user_code="")
 exclusive_scan calculates a running sum over a range of values, exclusive of the current value. The result value at iterator position i is the running sum of all values less than i in the input range. exclusive_scan requires associativity of the binary operation to parallelize it.
 
template<typename InputIterator , typename OutputIterator , typename T , typename BinaryFunction >
OutputIterator exclusive_scan (InputIterator first, InputIterator last, OutputIterator result, T init, BinaryFunction binary_op, const std::string &user_code="")
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator >
OutputIterator inclusive_scan_by_key (control &ctl, InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, OutputIterator result, const std::string &user_code="")
 inclusive_scan_by_key performs, on a sequence, an inclusive scan of each sub-sequence as defined by equivalent keys; the BinaryFunction in this version is plus(), and the BinaryPredicate is equal_to(). inclusive_scan_by_key uses the associative operator binary_op to perform the parallel segmented prefix sum.
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator >
OutputIterator inclusive_scan_by_key (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, OutputIterator result, const std::string &user_code="")
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename BinaryPredicate >
OutputIterator inclusive_scan_by_key (control &ctl, InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, OutputIterator result, BinaryPredicate binary_pred, const std::string &user_code="")
 inclusive_scan_by_key performs, on a sequence, an inclusive scan of each sub-sequence as defined by equivalent keys; the BinaryFunction in this version is plus(). inclusive_scan_by_key uses the associative operator binary_op to perform the parallel segmented prefix sum.
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename BinaryPredicate >
OutputIterator inclusive_scan_by_key (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, OutputIterator result, BinaryPredicate binary_pred, const std::string &user_code="")
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename BinaryPredicate , typename BinaryFunction >
OutputIterator inclusive_scan_by_key (control &ctl, InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, OutputIterator result, BinaryPredicate binary_pred, BinaryFunction binary_funct, const std::string &user_code="")
 inclusive_scan_by_key performs, on a sequence, an inclusive scan of each sub-sequence as defined by equivalent keys. inclusive_scan_by_key uses the associative operator binary_op to perform the parallel segmented prefix sum.
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename BinaryPredicate , typename BinaryFunction >
OutputIterator inclusive_scan_by_key (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, OutputIterator result, BinaryPredicate binary_pred, BinaryFunction binary_funct, const std::string &user_code="")
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator >
OutputIterator exclusive_scan_by_key (control &ctl, InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, OutputIterator result, const std::string &user_code="")
 exclusive_scan_by_key performs, on a sequence, an exclusive scan of each sub-sequence as defined by equivalent keys; the BinaryFunction in this version is plus(), the BinaryPredicate is equal_to(), and init is 0. exclusive_scan_by_key uses the associative operator binary_op to perform the parallel segmented prefix sum.
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator >
OutputIterator exclusive_scan_by_key (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, OutputIterator result, const std::string &user_code="")
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename T >
OutputIterator exclusive_scan_by_key (control &ctl, InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, OutputIterator result, T init, const std::string &user_code="")
 exclusive_scan_by_key performs, on a sequence, an exclusive scan of each sub-sequence as defined by equivalent keys; the BinaryFunction in this version is plus(), and the BinaryPredicate is equal_to(). exclusive_scan_by_key uses the associative operator binary_op to perform the parallel segmented prefix sum.
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename T >
OutputIterator exclusive_scan_by_key (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, OutputIterator result, T init, const std::string &user_code="")
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename T , typename BinaryPredicate >
OutputIterator exclusive_scan_by_key (control &ctl, InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, OutputIterator result, T init, BinaryPredicate binary_pred, const std::string &user_code="")
 exclusive_scan_by_key performs, on a sequence, an exclusive scan of each sub-sequence as defined by equivalent keys; the BinaryFunction in this version is plus(). exclusive_scan_by_key uses the associative operator binary_op to perform the parallel segmented prefix sum.
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename T , typename BinaryPredicate >
OutputIterator exclusive_scan_by_key (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, OutputIterator result, T init, BinaryPredicate binary_pred, const std::string &user_code="")
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename T , typename BinaryPredicate , typename BinaryFunction >
OutputIterator exclusive_scan_by_key (control &ctl, InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, OutputIterator result, T init, BinaryPredicate binary_pred, BinaryFunction binary_funct, const std::string &user_code="")
 exclusive_scan_by_key performs, on a sequence, an exclusive scan of each sub-sequence as defined by equivalent keys. exclusive_scan_by_key uses the associative operator binary_op to perform the parallel segmented prefix sum.
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename T , typename BinaryPredicate , typename BinaryFunction >
OutputIterator exclusive_scan_by_key (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, OutputIterator result, T init, BinaryPredicate binary_pred, BinaryFunction binary_funct, const std::string &user_code="")
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator >
void scatter (::bolt::cl::control &ctl, InputIterator1 first, InputIterator1 last, InputIterator2 map, OutputIterator result, const std::string &user_code="")
 This version of scatter copies elements from a source range to a destination array according to a specified map. For each i in InputIterator1 in the range [first, last), scatter copies the corresponding input_first to result[ map [ i ] ].
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator >
void scatter (InputIterator1 first, InputIterator1 last1, InputIterator2 map, OutputIterator result, const std::string &user_code="")
 
template<typename InputIterator1 , typename InputIterator2 , typename InputIterator3 , typename OutputIterator >
void scatter_if (bolt::cl::control &ctl, InputIterator1 first1, InputIterator1 last1, InputIterator2 map, InputIterator3 stencil, OutputIterator result, const std::string &user_code="")
 This version of scatter copies elements from a source range to a destination array according to a specified map. For each i in InputIterator1 in the range [first, last), scatter copies the corresponding input_first to result[ map [ i ] ] if stencil[ i - first ] is true.
 
template<typename InputIterator1 , typename InputIterator2 , typename InputIterator3 , typename OutputIterator >
void scatter_if (InputIterator1 first1, InputIterator1 last1, InputIterator2 map, InputIterator3 stencil, OutputIterator result, const std::string &user_code="")
 
template<typename InputIterator1 , typename InputIterator2 , typename InputIterator3 , typename OutputIterator , typename BinaryPredicate >
void scatter_if (bolt::cl::control &ctl, InputIterator1 first1, InputIterator1 last1, InputIterator2 map, InputIterator3 stencil, OutputIterator result, BinaryPredicate pred, const std::string &user_code="")
 This version of scatter copies elements from a source range to a destination array according to a specified map. For each i in InputIterator1 in the range [first, last), scatter copies the corresponding input_first to result[ map [ i ] ] if pred (stencil[ i - first ]) is true.
 
template<typename InputIterator1 , typename InputIterator2 , typename InputIterator3 , typename OutputIterator , typename BinaryPredicate >
void scatter_if (InputIterator1 first1, InputIterator1 last1, InputIterator2 map, InputIterator3 stencil, OutputIterator result, BinaryPredicate pred, const std::string &user_code="")
 
template<typename RandomAccessIterator >
void sort (bolt::cl::control &ctl, RandomAccessIterator first, RandomAccessIterator last, const std::string &cl_code="")
 This version of sort returns the sorted result of all the elements in the RandomAccessIterator between the the first and last elements. The routine arranges the elements in an ascending order. RandomAccessIterator's value_type must provide operator < overload.
 
template<typename RandomAccessIterator >
void sort (RandomAccessIterator first, RandomAccessIterator last, const std::string &cl_code="")
 
template<typename RandomAccessIterator , typename StrictWeakOrdering >
void sort (bolt::cl::control &ctl, RandomAccessIterator first, RandomAccessIterator last, StrictWeakOrdering comp, const std::string &cl_code="")
 sort returns the sorted result of all the elements in the inputIterator between the the first and last elements using the specified binary_op. You can arrange the elements in an ascending order, where the binary_op is the less<>() operator. This version of sort takes a bolt::cl::control structure as a first argument and compares objects using functor object defined by StrictWeakOrdering.
 
template<typename RandomAccessIterator , typename StrictWeakOrdering >
void sort (RandomAccessIterator first, RandomAccessIterator last, StrictWeakOrdering comp, const std::string &cl_code="")
 
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 >
void sort_by_key (bolt::cl::control &ctl, RandomAccessIterator1 keys_first, RandomAccessIterator1 keys_last, RandomAccessIterator2 values_first, const std::string &cl_code="")
 This version of sort_by_key returns the sorted result of all the elements in the RandomAccessIterator between the the first and last elements key elements and corresponding values. The routine arranges the elements in an ascending order.
 
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 >
void sort_by_key (RandomAccessIterator1 keys_first, RandomAccessIterator1 keys_last, RandomAccessIterator2 values_first, const std::string &cl_code="")
 
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 , typename StrictWeakOrdering >
void sort_by_key (bolt::cl::control &ctl, RandomAccessIterator1 keys_first, RandomAccessIterator1 keys_last, RandomAccessIterator2 values_first, StrictWeakOrdering comp, const std::string &cl_code="")
 This version of sort_by_key returns the sorted result of all the elements in the RandomAccessIterator between the the first and last elements key elements and corresponding values. The routine arranges the elements in an ascending order.
 
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 , typename StrictWeakOrdering >
void sort_by_key (RandomAccessIterator1 keys_first, RandomAccessIterator1 keys_last, RandomAccessIterator2 values_first, StrictWeakOrdering comp, const std::string &cl_code="")
 
template<typename RandomAccessIterator >
void stable_sort (RandomAccessIterator first, RandomAccessIterator last, const std::string &cl_code="")
 
template<typename RandomAccessIterator , typename StrictWeakOrdering >
void stable_sort (RandomAccessIterator first, RandomAccessIterator last, StrictWeakOrdering comp, const std::string &cl_code="")
 
template<typename RandomAccessIterator >
void stable_sort (bolt::cl::control &ctl, RandomAccessIterator first, RandomAccessIterator last, const std::string &cl_code="")
 
template<typename RandomAccessIterator , typename StrictWeakOrdering >
void stable_sort (bolt::cl::control &ctl, RandomAccessIterator first, RandomAccessIterator last, StrictWeakOrdering comp, const std::string &cl_code="")
 
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 >
void stable_sort_by_key (RandomAccessIterator1 keys_first, RandomAccessIterator1 keys_last, RandomAccessIterator2 values_first, const std::string &cl_code="")
 
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 , typename StrictWeakOrdering >
void stable_sort_by_key (RandomAccessIterator1 keys_first, RandomAccessIterator1 keys_last, RandomAccessIterator2 values_first, StrictWeakOrdering comp, const std::string &cl_code="")
 
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 >
void stable_sort_by_key (bolt::cl::control &ctl, RandomAccessIterator1 keys_first, RandomAccessIterator1 keys_last, RandomAccessIterator2 values_first, const std::string &cl_code="")
 
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 , typename StrictWeakOrdering >
void stable_sort_by_key (bolt::cl::control &ctl, RandomAccessIterator1 keys_first, RandomAccessIterator1 keys_last, RandomAccessIterator2 values_first, StrictWeakOrdering comp, const std::string &cl_code="")
 
template<typename InputIterator , typename OutputIterator , typename UnaryFunction >
void transform (::bolt::cl::control &ctl, InputIterator first, InputIterator last, OutputIterator result, UnaryFunction op, const std::string &user_code="")
 This version of transform applies a unary operation on input sequences and stores the result in the corresponding position in an output sequence.The input and output sequences can coincide, resulting in an in-place transformation.
 
template<typename InputIterator , typename OutputIterator , typename UnaryFunction >
void transform (InputIterator first, InputIterator last, OutputIterator result, UnaryFunction op, const std::string &user_code="")
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename BinaryFunction >
void transform (bolt::cl::control &ctl, InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, OutputIterator result, BinaryFunction op, const std::string &user_code="")
 This version of transform applies a binary function to each pair of elements from two input sequences and stores the result in the corresponding position in an output sequence. The input and output sequences can coincide, resulting in an in-place transformation.
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename BinaryFunction >
void transform (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, OutputIterator result, BinaryFunction op, const std::string &user_code="")
 
template<typename InputIterator , typename UnaryFunction , typename T , typename BinaryFunction >
transform_reduce (control &ctl, InputIterator first, InputIterator last, UnaryFunction transform_op, T init, BinaryFunction reduce_op, const std::string &user_code="")
 transform_reduce fuses transform and reduce operations together, increasing performance by reducing memory passes.
 
template<typename InputIterator , typename UnaryFunction , typename T , typename BinaryFunction >
transform_reduce (InputIterator first, InputIterator last, UnaryFunction transform_op, T init, BinaryFunction reduce_op, const std::string &user_code="")
 
template<typename InputIterator , typename OutputIterator , typename UnaryFunction , typename BinaryFunction >
OutputIterator transform_inclusive_scan (bolt::cl::control &ctl, InputIterator first, InputIterator last, OutputIterator result, UnaryFunction unary_op, BinaryFunction binary_op, const std::string &user_code="")
 transform_inclusive_scan performs, on a sequence, the transformation defined by a unary operator, then the inclusive scan defined by a binary operator.
 
template<typename InputIterator , typename OutputIterator , typename UnaryFunction , typename BinaryFunction >
OutputIterator transform_inclusive_scan (InputIterator first, InputIterator last, OutputIterator result, UnaryFunction unary_op, BinaryFunction binary_op, const std::string &user_code="")
 
template<typename InputIterator , typename OutputIterator , typename UnaryFunction , typename T , typename BinaryFunction >
OutputIterator transform_exclusive_scan (bolt::cl::control &ctl, InputIterator first, InputIterator last, OutputIterator result, UnaryFunction unary_op, T init, BinaryFunction binary_op, const std::string &user_code="")
 transform_exclusive_scan performs, on a sequence, the transformation defined by a unary operator, then the exclusive scan defined by a binary operator.
 
template<typename InputIterator , typename OutputIterator , typename UnaryFunction , typename T , typename BinaryFunction >
OutputIterator transform_exclusive_scan (InputIterator first, InputIterator last, OutputIterator result, UnaryFunction unary_op, T init, BinaryFunction binary_op, const std::string &user_code="")
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator >
void gather (bolt::cl::control &ctl, InputIterator1 map_first, InputIterator1 map_last, InputIterator2 input, OutputIterator result, const std::string &user_code)
 
template<typename InputIterator1 , typename InputIterator2 , typename InputIterator3 , typename OutputIterator , typename BinaryPredicate >
void gather_if (bolt::cl::control &ctl, InputIterator1 map_first, InputIterator1 map_last, InputIterator2 stencil, InputIterator3 input, OutputIterator result, BinaryPredicate pred, const std::string &user_code)
 
template<typename InputIterator1 , typename InputIterator2 , typename InputIterator3 , typename OutputIterator , typename BinaryPredicate >
void gather_if (InputIterator1 map_first, InputIterator1 map_last, InputIterator2 stencil, InputIterator3 input, OutputIterator result, BinaryPredicate pred, const std::string &user_code)
 
template<unsigned int N, typename T1 , typename T2 >
tuple_element< N, pair< T1, T2 >
>::type & 
get (pair< T1, T2 > &p)
 
template<unsigned int N, typename T1 , typename T2 >
const tuple_element< N, pair
< T1, T2 > >::type & 
get (const pair< T1, T2 > &p)
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator >
void scatter (bolt::cl::control &ctl, InputIterator1 first1, InputIterator1 last1, InputIterator2 map, OutputIterator result, const std::string &user_code)
 
template<typename InputIterator1 , typename InputIterator2 , typename InputIterator3 , typename OutputIterator , typename Predicate >
void scatter_if (bolt::cl::control &ctl, InputIterator1 first1, InputIterator1 last1, InputIterator2 map, InputIterator3 stencil, OutputIterator result, Predicate pred, const std::string &user_code)
 
template<typename InputIterator1 , typename InputIterator2 , typename InputIterator3 , typename OutputIterator , typename Predicate >
void scatter_if (InputIterator1 first1, InputIterator1 last1, InputIterator2 map, InputIterator3 stencil, OutputIterator result, Predicate pred, const std::string &user_code)
 
template<typename Type >
constant_iterator< Type > make_constant_iterator (Type constValue)
 
template<typename Type >
counting_iterator< Type > make_counting_iterator (Type constValue)
 

Variables

const std::string binary_search_kernels
 
const std::string copy_kernels
 
const std::string count_kernels
 
const std::string fill_kernels
 
const std::string gather_kernels
 
const std::string generate_kernels
 
const std::string merge_kernels
 
const std::string min_element_kernels
 
const std::string reduce_kernels
 
const std::string reduce_by_key_kernels
 
const std::string scan_kernels
 
const std::string scan_by_key_kernels
 
const std::string scatter_kernels
 
const std::string sort_kernels
 
const std::string stablesort_kernels
 
const std::string stablesort_by_key_kernels
 
const std::string sort_uint_kernels
 
const std::string sort_int_kernels
 
const std::string sort_common_kernels
 
const std::string sort_by_key_kernels
 
const std::string sort_by_key_int_kernels
 
const std::string sort_by_key_uint_kernels
 
const std::string transform_kernels
 
const std::string transform_reduce_kernels
 
const std::string transform_scan_kernels
 
boost::mutex programMapMutex
 
ProgramMap programMap
 

Detailed Description

Namespace containing OpenCL related data types and functions.

Function Documentation

std::string bolt::cl::clErrorStringA ( const cl_int &  status)

Translates an integer OpenCL error code to a std::string at runtime.

Parameters
statusThe OpenCL error code
Returns
The error code stringized
std::wstring bolt::cl::clErrorStringW ( const cl_int &  status)

Translates an integer OpenCL error code to a std::wstring at runtime.

Parameters
statusThe OpenCL error code
Returns
The error code stringized
void bolt::cl::getVersion ( cl_uint &  major,
cl_uint &  minor,
cl_uint &  patch 
)

Query the Bolt library for version information.

Return the major, minor and patch version numbers associated with the Bolt library

Parameters
[out]majorMajor functionality change
[out]minorMinor functionality change
[out]patchBug fixes, documentation changes, no new features introduced
cl_int bolt::cl::V_OpenCL ( cl_int  res,
const std::string &  msg,
size_t  lineno 
)
inline

Helper print function to stringify OpenCL error codes.

Parameters
resThe OpenCL error code
msgA relevant message to be printed out supplied by user
linenoSource line number; not currently used
Note
std::exception is built to only use narrow text