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 binary_op. More...

#include <iostream>
#include <vector>
#include <array>
#include <amp.h>
#include <numeric>
#include "bolt/amp/bolt.h"
#include "bolt/amp/functional.h"
#include <bolt/amp/detail/reduce.inl>

Go to the source code of this file.

Namespaces

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

Functions

template<typename InputIterator >
std::iterator_traits
< InputIterator >::value_type 
bolt::amp::reduce (bolt::amp::control &ctl, InputIterator first, InputIterator last)
 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::amp::reduce (InputIterator first, InputIterator last)
 
template<typename InputIterator , typename T >
bolt::amp::reduce (bolt::amp::control &ctl, InputIterator first, InputIterator last, T init)
 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::amp::reduce (InputIterator first, InputIterator last, T init)
 
template<typename InputIterator , typename T , typename BinaryFunction >
bolt::amp::reduce (bolt::amp::control &ctl, InputIterator first, InputIterator last, T init, BinaryFunction binary_op=bolt::amp::plus< T >())
 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::amp::control structure as a first argument.
 
template<typename InputIterator , typename T , typename BinaryFunction >
bolt::amp::reduce (InputIterator first, InputIterator last, T init, BinaryFunction binary_op)
 

Detailed Description

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