Bolt  1.3
C++ template library with support for OpenCL
Namespaces | Functions
reduce.h File Reference

Returns the result of combining all the elements in the specified range using the specified. More...

#include "bolt/cl/device_vector.h"
#include "bolt/cl/functional.h"
#include <bolt/cl/detail/reduce.inl>

Go to the source code of this file.

Namespaces

namespace  bolt
 Defining namespace for the Bolt project.
 
namespace  bolt::cl
 Namespace containing OpenCL related data types and functions.
 

Functions

template<typename InputIterator >
std::iterator_traits
< InputIterator >::value_type 
bolt::cl::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 
bolt::cl::reduce (InputIterator first, InputIterator last, const std::string &cl_code="")
 
template<typename InputIterator , typename T >
bolt::cl::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 >
bolt::cl::reduce (InputIterator first, InputIterator last, T init, const std::string &cl_code="")
 
template<typename InputIterator , typename T , typename BinaryFunction >
bolt::cl::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 >
bolt::cl::reduce (InputIterator first, InputIterator last, T init, BinaryFunction binary_op, const std::string &cl_code="")
 

Detailed Description

Returns the result of combining all the elements in the specified range using the specified.