Public Member Functions

skepu::MapReduce< MapFunc, ReduceFunc > Class Template Reference
[Skeletons]

A class representing the MapReduce skeleton. More...

#include <mapreduce.h>

Collaboration diagram for skepu::MapReduce< MapFunc, ReduceFunc >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 MapReduce (MapFunc *mapFunc, ReduceFunc *reduceFunc)
 ~MapReduce ()
template<typename T >
operator() (Vector< T > &input)
template<typename InputIterator >
InputIterator::value_type operator() (InputIterator inputBegin, InputIterator inputEnd)
template<typename T >
operator() (Vector< T > &input1, Vector< T > &input2)
template<typename Input1Iterator , typename Input2Iterator >
Input1Iterator::value_type operator() (Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End)
template<typename T >
operator() (Vector< T > &input1, Vector< T > &input2, Vector< T > &input3)
template<typename Input1Iterator , typename Input2Iterator , typename Input3Iterator >
Input1Iterator::value_type operator() (Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, Input3Iterator input3Begin, Input3Iterator input3End)
template<typename T >
CPU (Vector< T > &input)
template<typename InputIterator >
InputIterator::value_type CPU (InputIterator inputBegin, InputIterator inputEnd)
template<typename T >
CPU (Vector< T > &input1, Vector< T > &input2)
template<typename Input1Iterator , typename Input2Iterator >
Input1Iterator::value_type CPU (Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End)
template<typename T >
CPU (Vector< T > &input1, Vector< T > &input2, Vector< T > &input3)
template<typename Input1Iterator , typename Input2Iterator , typename Input3Iterator >
Input1Iterator::value_type CPU (Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, Input3Iterator input3Begin, Input3Iterator input3End)
template<typename T >
OMP (Vector< T > &input)
template<typename InputIterator >
InputIterator::value_type OMP (InputIterator inputBegin, InputIterator inputEnd)
template<typename T >
OMP (Vector< T > &input1, Vector< T > &input2)
template<typename Input1Iterator , typename Input2Iterator >
Input1Iterator::value_type OMP (Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End)
template<typename T >
OMP (Vector< T > &input1, Vector< T > &input2, Vector< T > &input3)
template<typename Input1Iterator , typename Input2Iterator , typename Input3Iterator >
Input1Iterator::value_type OMP (Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, Input3Iterator input3Begin, Input3Iterator input3End)
template<typename T >
CU (Vector< T > &input, int useNumGPU=1)
template<typename InputIterator >
InputIterator::value_type CU (InputIterator inputBegin, InputIterator inputEnd, int useNumGPU=1)
template<typename T >
CU (Vector< T > &input1, Vector< T > &input2, int useNumGPU=1)
template<typename Input1Iterator , typename Input2Iterator >
Input1Iterator::value_type CU (Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, int useNumGPU=1)
template<typename T >
CU (Vector< T > &input1, Vector< T > &input2, Vector< T > &input3, int useNumGPU=1)
template<typename Input1Iterator , typename Input2Iterator , typename Input3Iterator >
Input1Iterator::value_type CU (Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, Input3Iterator input3Begin, Input3Iterator input3End, int useNumGPU=1)
template<typename T >
CL (Vector< T > &input, int useNumGPU=1)
template<typename InputIterator >
InputIterator::value_type CL (InputIterator inputBegin, InputIterator inputEnd, int useNumGPU=1)
template<typename T >
CL (Vector< T > &input1, Vector< T > &input2, int useNumGPU=1)
template<typename Input1Iterator , typename Input2Iterator >
Input1Iterator::value_type CL (Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, int useNumGPU=1)
template<typename T >
CL (Vector< T > &input1, Vector< T > &input2, Vector< T > &input3, int useNumGPU=1)
template<typename Input1Iterator , typename Input2Iterator , typename Input3Iterator >
Input1Iterator::value_type CL (Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, Input3Iterator input3Begin, Input3Iterator input3End, int useNumGPU=1)

Detailed Description

template<typename MapFunc, typename ReduceFunc>
class skepu::MapReduce< MapFunc, ReduceFunc >

A class representing the MapReduce skeleton.

Author:
Johan Enmyren
Version:
0.6

This class defines the MapReduce skeleton which is a combination of the Map and Reduce operations. It produces the same result as if one would first Map one or more vectors to a result vector, then do a reduction on that result. It is provided since it combines the mapping and reduction in the same computation kernel and therefore avoids some synchronization, which speeds up the calculation. Once instantiated, it is meant to be used as a function and therefore overloading operator(). There are several overloaded versions of this operator that can be used depending on how many elements the mapping function uses (one, two or three). There are also variants which takes iterators as inputs and those that takes whole vectors. The vector variants are merely wrappers for the functions which takes iterators as parameters.

If a certain backend is to be used, functions with the same interface as operator() but by the names CPU, CU, CL, OMP exists for CPU, CUDA, OpenCL and OpenMP respectively.

The MapReduce skeleton also includes a pointer to an Environment which includes the devices available to execute on.


Constructor & Destructor Documentation

template<typename MapFunc , typename ReduceFunc >
skepu::MapReduce< MapFunc, ReduceFunc >::MapReduce ( MapFunc *  mapFunc,
ReduceFunc *  reduceFunc 
)

When creating an instance of the MapReduce skeleton, two pointers need to be provided. One for a unary, binary or trinary mapping function and one for a binary reduce function. Also the Environment is set and if SKEPU_OPENCL is defined, the appropriate OpenCL program and kernel are created. Also creates a default execution plan which the skeleton will use if no other is specified.

Parameters:
mapFunc A pointer to a valid unary, binary or trinary user function. Will be deleted in the destructor.
reduceFunc A pointer to a valid binary user function. Will be deleted in the destructor.
template<typename MapFunc , typename ReduceFunc >
skepu::MapReduce< MapFunc, ReduceFunc >::~MapReduce (  ) 

When the MapReduce skeleton is destroyed, it deletes the user functions it was created with.


Member Function Documentation

template<typename MapFunc , typename ReduceFunc >
template<typename T >
T skepu::MapReduce< MapFunc, ReduceFunc >::CL ( Vector< T > &  input,
int  useNumGPU = 1 
)

Performs the Map on one Vector and Reduce on the result. Returns a scalar result. A wrapper for CL(InputIterator inputBegin, InputIterator inputEnd, int useNumGPU). Using OpenCL as backend.

Parameters:
input A vector which the map and reduce will be performed on.
useNumGPU Integer specifying how many devices to use. 0 = implementation decides.
Returns:
The scalar result of the map-reduce combination performed.

References skepu::Vector< T >::begin(), and skepu::Vector< T >::end().

Here is the call graph for this function:

template<typename MapFunc , typename ReduceFunc >
template<typename T >
T skepu::MapReduce< MapFunc, ReduceFunc >::CL ( Vector< T > &  input1,
Vector< T > &  input2,
Vector< T > &  input3,
int  useNumGPU = 1 
)

Performs the Map on three Vectors and Reduce on the result. Returns a scalar result. A wrapper for CL(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, Input3Iterator input3Begin, Input3Iterator input3End, int useNumGPU). Using OpenCL as backend.

Parameters:
input1 A vector which the mapping will be performed on.
input2 A vector which the mapping will be performed on.
input3 A vector which the mapping will be performed on.
useNumGPU Integer specifying how many devices to use. 0 = implementation decides.
Returns:
The scalar result of the map-reduce combination performed.

References skepu::Vector< T >::begin(), skepu::MapReduce< MapFunc, ReduceFunc >::CL(), and skepu::Vector< T >::end().

Here is the call graph for this function:

template<typename MapFunc , typename ReduceFunc >
template<typename Input1Iterator , typename Input2Iterator , typename Input3Iterator >
Input1Iterator::value_type skepu::MapReduce< MapFunc, ReduceFunc >::CL ( Input1Iterator  input1Begin,
Input1Iterator  input1End,
Input2Iterator  input2Begin,
Input2Iterator  input2End,
Input3Iterator  input3Begin,
Input3Iterator  input3End,
int  useNumGPU = 1 
)

Performs the Map on three ranges of elements and Reduce on the result. Returns a scalar result. The function decides whether to perform the map and reduce on one device, calling mapReduceSingle_CL(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, Input3Iterator input3Begin, Input3Iterator input3End, int deviceID) or on multiple devices, calling mapReduceNumDevices_CL(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, Input3Iterator input3Begin, Input3Iterator input3End, int numDevices). Using OpenCL as backend.

Parameters:
input1Begin A Vector::iterator to the first element in the first range.
input1End A Vector::iterator to the last element of the first range.
input2Begin A Vector::iterator to the first element in the second range.
input2End A Vector::iterator to the last element of the second range.
input3Begin A Vector::iterator to the first element in the third range.
input3End A Vector::iterator to the last element of the third range.
useNumGPU Integer specifying how many devices to use. 0 = implementation decides.
Returns:
The scalar result of the map-reduce combination performed.
template<typename MapFunc , typename ReduceFunc >
template<typename InputIterator >
InputIterator::value_type skepu::MapReduce< MapFunc, ReduceFunc >::CL ( InputIterator  inputBegin,
InputIterator  inputEnd,
int  useNumGPU = 1 
)

Performs the Map on one range of elements and Reduce on the result. Returns a scalar result. The function decides whether to perform the map and reduce on one device, calling mapReduceSingle_CL(InputIterator inputBegin, InputIterator inputEnd, int deviceID) or on multiple devices, calling mapReduceNumDevices_CL(InputIterator inputBegin, InputIterator inputEnd, int numDevices). Using OpenCL as backend.

Parameters:
inputBegin A Vector::iterator to the first element in the range.
inputEnd A Vector::iterator to the last element of the range.
useNumGPU Integer specifying how many devices to use. 0 = implementation decides.
Returns:
The scalar result of the map-reduce combination performed.
template<typename MapFunc , typename ReduceFunc >
template<typename T >
T skepu::MapReduce< MapFunc, ReduceFunc >::CL ( Vector< T > &  input1,
Vector< T > &  input2,
int  useNumGPU = 1 
)

Performs the Map on two Vectors and Reduce on the result. Returns a scalar result. A wrapper for CL(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, int useNumGPU). Using OpenCL as backend.

Parameters:
input1 A Vector which the map and reduce will be performed on.
input2 A Vector which the map and reduce will be performed on.
useNumGPU Integer specifying how many devices to use. 0 = implementation decides.
Returns:
The scalar result of the map-reduce combination performed.

References skepu::Vector< T >::begin(), skepu::MapReduce< MapFunc, ReduceFunc >::CL(), and skepu::Vector< T >::end().

Here is the call graph for this function:

template<typename MapFunc , typename ReduceFunc >
template<typename Input1Iterator , typename Input2Iterator >
Input1Iterator::value_type skepu::MapReduce< MapFunc, ReduceFunc >::CL ( Input1Iterator  input1Begin,
Input1Iterator  input1End,
Input2Iterator  input2Begin,
Input2Iterator  input2End,
int  useNumGPU = 1 
)

Performs the Map on two ranges of elements and Reduce on the result. Returns a scalar result. The function decides whether to perform the map and reduce on one device, calling mapReduceSingle_CL(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, int deviceID) or on multiple devices, calling mapReduceNumDevices_CL(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, int numDevices). Using OpenCL as backend.

Parameters:
input1Begin A Vector::iterator to the first element in the first range.
input1End A Vector::iterator to the last element of the first range.
input2Begin A Vector::iterator to the first element in the second range.
input2End A Vector::iterator to the last element of the second range.
useNumGPU Integer specifying how many devices to use. 0 = implementation decides.
Returns:
The scalar result of the map-reduce combination performed.
template<typename MapFunc , typename ReduceFunc >
template<typename InputIterator >
InputIterator::value_type skepu::MapReduce< MapFunc, ReduceFunc >::CPU ( InputIterator  inputBegin,
InputIterator  inputEnd 
)

Performs the Map on one range of elements and Reduce on the result. Returns a scalar result. Does the reduction on the CPU by iterating over all elements in the range.

Parameters:
inputBegin A Vector::iterator to the first element in the range.
inputEnd A Vector::iterator to the last element of the range.
Returns:
The scalar result of the reduction performed.
template<typename MapFunc , typename ReduceFunc >
template<typename T >
T skepu::MapReduce< MapFunc, ReduceFunc >::CPU ( Vector< T > &  input1,
Vector< T > &  input2,
Vector< T > &  input3 
)

Performs the Map on three Vectors and Reduce on the result. Returns a scalar result. A wrapper for CPU(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, Input3Iterator input3Begin, Input3Iterator input3End). Using the CPU as backend.

Parameters:
input1 A vector which the mapping will be performed on.
input2 A vector which the mapping will be performed on.
input3 A vector which the mapping will be performed on.
Returns:
The scalar result of the reduction performed.

References skepu::Vector< T >::begin(), skepu::MapReduce< MapFunc, ReduceFunc >::CPU(), and skepu::Vector< T >::end().

Here is the call graph for this function:

template<typename MapFunc , typename ReduceFunc >
template<typename Input1Iterator , typename Input2Iterator >
Input1Iterator::value_type skepu::MapReduce< MapFunc, ReduceFunc >::CPU ( Input1Iterator  input1Begin,
Input1Iterator  input1End,
Input2Iterator  input2Begin,
Input2Iterator  input2End 
)

Performs the Map on two ranges of elements and Reduce on the result. Returns a scalar result. Does the reduction on the CPU by iterating over all elements in the range.

Parameters:
input1Begin A Vector::iterator to the first element in the first range.
input1End A Vector::iterator to the last element of the first range.
input2Begin A Vector::iterator to the first element in the second range.
input2End A Vector::iterator to the last element of the second range.
Returns:
The scalar result of the reduction performed.
template<typename MapFunc , typename ReduceFunc >
template<typename Input1Iterator , typename Input2Iterator , typename Input3Iterator >
Input1Iterator::value_type skepu::MapReduce< MapFunc, ReduceFunc >::CPU ( Input1Iterator  input1Begin,
Input1Iterator  input1End,
Input2Iterator  input2Begin,
Input2Iterator  input2End,
Input3Iterator  input3Begin,
Input3Iterator  input3End 
)

Performs the Map on three ranges of elements and Reduce on the result. Returns a scalar result. Does the reduction on the CPU by iterating over all elements in the ranges.

Parameters:
input1Begin A Vector::iterator to the first element in the first range.
input1End A Vector::iterator to the last element of the first range.
input2Begin A Vector::iterator to the first element in the second range.
input2End A Vector::iterator to the last element of the second range.
input3Begin A Vector::iterator to the first element in the third range.
input3End A Vector::iterator to the last element of the third range.
Returns:
The scalar result of the reduction performed.
template<typename MapFunc , typename ReduceFunc >
template<typename T >
T skepu::MapReduce< MapFunc, ReduceFunc >::CPU ( Vector< T > &  input1,
Vector< T > &  input2 
)

Performs the Map on two Vectors and Reduce on the result. Returns a scalar result. A wrapper for CPU(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End). Using the CPU as backend.

Parameters:
input1 A Vector which the map and reduce will be performed on.
input2 A Vector which the map and reduce will be performed on.
Returns:
The scalar result of the reduction performed.

References skepu::Vector< T >::begin(), skepu::MapReduce< MapFunc, ReduceFunc >::CPU(), and skepu::Vector< T >::end().

Here is the call graph for this function:

template<typename MapFunc , typename ReduceFunc >
template<typename T >
T skepu::MapReduce< MapFunc, ReduceFunc >::CPU ( Vector< T > &  input  ) 

Performs the Map on one Vector and Reduce on the result. Returns a scalar result. A wrapper for CPU(InputIterator inputBegin, InputIterator inputEnd). Using the CPU as backend.

Parameters:
input A vector which the reduction will be performed on.
Returns:
The scalar result of the reduction performed.

References skepu::Vector< T >::begin(), and skepu::Vector< T >::end().

Here is the call graph for this function:

template<typename MapFunc , typename ReduceFunc >
template<typename T >
T skepu::MapReduce< MapFunc, ReduceFunc >::CU ( Vector< T > &  input,
int  useNumGPU = 1 
)

Performs the Map on one Vector and Reduce on the result. Returns a scalar result. A wrapper for CU(InputIterator inputBegin, InputIterator inputEnd, int useNumGPU). Using CUDA as backend.

Parameters:
input A vector which the map and reduce will be performed on.
useNumGPU Integer specifying how many devices to use. 0 = implementation decides.
Returns:
The scalar result of the map-reduce combination performed.

References skepu::Vector< T >::begin(), and skepu::Vector< T >::end().

Here is the call graph for this function:

template<typename MapFunc , typename ReduceFunc >
template<typename InputIterator >
InputIterator::value_type skepu::MapReduce< MapFunc, ReduceFunc >::CU ( InputIterator  inputBegin,
InputIterator  inputEnd,
int  useNumGPU = 1 
)

Performs the Map on one range of elements and Reduce on the result. Returns a scalar result. The function decides whether to perform the map and reduce on one device, calling mapReduceSingleThread_CU(InputIterator inputBegin, InputIterator inputEnd, int deviceID) or on multiple devices, starting one thread per device where each thread runs mapReduceThreadFunc1_CU(void* _args). Using CUDA as backend.

Parameters:
inputBegin A Vector::iterator to the first element in the range.
inputEnd A Vector::iterator to the last element of the range.
useNumGPU Integer specifying how many devices to use. 0 = implementation decides.
Returns:
The scalar result of the map-reduce combination performed.

References skepu::Threads::fork(), and skepu::Threads::join().

Here is the call graph for this function:

template<typename MapFunc , typename ReduceFunc >
template<typename Input1Iterator , typename Input2Iterator , typename Input3Iterator >
Input1Iterator::value_type skepu::MapReduce< MapFunc, ReduceFunc >::CU ( Input1Iterator  input1Begin,
Input1Iterator  input1End,
Input2Iterator  input2Begin,
Input2Iterator  input2End,
Input3Iterator  input3Begin,
Input3Iterator  input3End,
int  useNumGPU = 1 
)

Performs the Map on three ranges of elements and Reduce on the result. Returns a scalar result. The function decides whether to perform the map and reduce on one device, calling mapReduceSingleThread_CU(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, Input3Iterator input3Begin, Input3Iterator input3End, int deviceID) or on multiple devices, starting one thread per device where each thread runs mapReduceThreadFunc3_CU(void* _args). Using CUDA as backend.

Parameters:
input1Begin A Vector::iterator to the first element in the first range.
input1End A Vector::iterator to the last element of the first range.
input2Begin A Vector::iterator to the first element in the second range.
input2End A Vector::iterator to the last element of the second range.
input3Begin A Vector::iterator to the first element in the third range.
input3End A Vector::iterator to the last element of the third range.
useNumGPU Integer specifying how many devices to use. 0 = implementation decides.
Returns:
The scalar result of the map-reduce combination performed.

References skepu::Threads::fork(), and skepu::Threads::join().

Here is the call graph for this function:

template<typename MapFunc , typename ReduceFunc >
template<typename T >
T skepu::MapReduce< MapFunc, ReduceFunc >::CU ( Vector< T > &  input1,
Vector< T > &  input2,
int  useNumGPU = 1 
)

Performs the Map on two Vectors and Reduce on the result. Returns a scalar result. A wrapper for CU(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, int useNumGPU). Using CUDA as backend.

Parameters:
input1 A Vector which the map and reduce will be performed on.
input2 A Vector which the map and reduce will be performed on.
useNumGPU Integer specifying how many devices to use. 0 = implementation decides.
Returns:
The scalar result of the map-reduce combination performed.

References skepu::Vector< T >::begin(), skepu::MapReduce< MapFunc, ReduceFunc >::CU(), and skepu::Vector< T >::end().

Here is the call graph for this function:

template<typename MapFunc , typename ReduceFunc >
template<typename T >
T skepu::MapReduce< MapFunc, ReduceFunc >::CU ( Vector< T > &  input1,
Vector< T > &  input2,
Vector< T > &  input3,
int  useNumGPU = 1 
)

Performs the Map on three Vectors and Reduce on the result. Returns a scalar result. A wrapper for CU(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, Input3Iterator input3Begin, Input3Iterator input3End, int useNumGPU). Using CUDA as backend.

Parameters:
input1 A vector which the mapping will be performed on.
input2 A vector which the mapping will be performed on.
input3 A vector which the mapping will be performed on.
useNumGPU Integer specifying how many devices to use. 0 = implementation decides.
Returns:
The scalar result of the map-reduce combination performed.

References skepu::Vector< T >::begin(), skepu::MapReduce< MapFunc, ReduceFunc >::CU(), and skepu::Vector< T >::end().

Here is the call graph for this function:

template<typename MapFunc , typename ReduceFunc >
template<typename Input1Iterator , typename Input2Iterator >
Input1Iterator::value_type skepu::MapReduce< MapFunc, ReduceFunc >::CU ( Input1Iterator  input1Begin,
Input1Iterator  input1End,
Input2Iterator  input2Begin,
Input2Iterator  input2End,
int  useNumGPU = 1 
)

Performs the Map on two ranges of elements and Reduce on the result. Returns a scalar result. The function decides whether to perform the map and reduce on one device, calling mapReduceSingleThread_CU(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, int deviceID) or on multiple devices, starting one thread per device where each thread runs mapReduceThreadFunc2_CU(void* _args). Using CUDA as backend.

Parameters:
input1Begin A Vector::iterator to the first element in the first range.
input1End A Vector::iterator to the last element of the first range.
input2Begin A Vector::iterator to the first element in the second range.
input2End A Vector::iterator to the last element of the second range.
useNumGPU Integer specifying how many devices to use. 0 = implementation decides.
Returns:
The scalar result of the map-reduce combination performed.

References skepu::Threads::fork(), and skepu::Threads::join().

Here is the call graph for this function:

template<typename MapFunc , typename ReduceFunc >
template<typename InputIterator >
InputIterator::value_type skepu::MapReduce< MapFunc, ReduceFunc >::OMP ( InputIterator  inputBegin,
InputIterator  inputEnd 
)

Performs the Map on one range of elements and Reduce on the result. Returns a scalar result. Divides the elements among all OpenMP threads and does mapping and reduction of the parts in parallel. The results from each thread are then reduced on the CPU.

Parameters:
inputBegin A Vector::iterator to the first element in the range.
inputEnd A Vector::iterator to the last element of the range.
Returns:
The scalar result of the reduction performed.
template<typename MapFunc , typename ReduceFunc >
template<typename T >
T skepu::MapReduce< MapFunc, ReduceFunc >::OMP ( Vector< T > &  input  ) 

Performs the Map on one Vector and Reduce on the result. Returns a scalar result. A wrapper for OMP(InputIterator inputBegin, InputIterator inputEnd). Using the OpenMP as backend.

Parameters:
input A vector which the reduction will be performed on.
Returns:
The scalar result of the reduction performed.

References skepu::Vector< T >::begin(), and skepu::Vector< T >::end().

Here is the call graph for this function:

template<typename MapFunc , typename ReduceFunc >
template<typename T >
T skepu::MapReduce< MapFunc, ReduceFunc >::OMP ( Vector< T > &  input1,
Vector< T > &  input2 
)

Performs the Map on two Vectors and Reduce on the result. Returns a scalar result. A wrapper for OMP(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End). Using the OpenMP as backend.

Parameters:
input1 A Vector which the map and reduce will be performed on.
input2 A Vector which the map and reduce will be performed on.
Returns:
The scalar result of the reduction performed.

References skepu::Vector< T >::begin(), skepu::Vector< T >::end(), and skepu::MapReduce< MapFunc, ReduceFunc >::OMP().

Here is the call graph for this function:

template<typename MapFunc , typename ReduceFunc >
template<typename Input1Iterator , typename Input2Iterator , typename Input3Iterator >
Input1Iterator::value_type skepu::MapReduce< MapFunc, ReduceFunc >::OMP ( Input1Iterator  input1Begin,
Input1Iterator  input1End,
Input2Iterator  input2Begin,
Input2Iterator  input2End,
Input3Iterator  input3Begin,
Input3Iterator  input3End 
)

Performs the Map on three ranges of elements and Reduce on the result. Returns a scalar result. Divides the elements among all OpenMP threads and does mapping and reduction of the parts in parallel. The results from each thread are then reduced on the CPU.

Parameters:
input1Begin A Vector::iterator to the first element in the first range.
input1End A Vector::iterator to the last element of the first range.
input2Begin A Vector::iterator to the first element in the second range.
input2End A Vector::iterator to the last element of the second range.
input3Begin A Vector::iterator to the first element in the third range.
input3End A Vector::iterator to the last element of the third range.
Returns:
The scalar result of the reduction performed.
template<typename MapFunc , typename ReduceFunc >
template<typename T >
T skepu::MapReduce< MapFunc, ReduceFunc >::OMP ( Vector< T > &  input1,
Vector< T > &  input2,
Vector< T > &  input3 
)

Performs the Map on three Vectors and Reduce on the result. Returns a scalar result. A wrapper for OMP(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, Input3Iterator input3Begin, Input3Iterator input3End). Using the OpenMP as backend.

Parameters:
input1 A vector which the mapping will be performed on.
input2 A vector which the mapping will be performed on.
input3 A vector which the mapping will be performed on.
Returns:
The scalar result of the reduction performed.

References skepu::Vector< T >::begin(), skepu::Vector< T >::end(), and skepu::MapReduce< MapFunc, ReduceFunc >::OMP().

Here is the call graph for this function:

template<typename MapFunc , typename ReduceFunc >
template<typename Input1Iterator , typename Input2Iterator >
Input1Iterator::value_type skepu::MapReduce< MapFunc, ReduceFunc >::OMP ( Input1Iterator  input1Begin,
Input1Iterator  input1End,
Input2Iterator  input2Begin,
Input2Iterator  input2End 
)

Performs the Map on two ranges of elements and Reduce on the result. Returns a scalar result. Divides the elements among all OpenMP threads and does mapping and reduction of the parts in parallel. The results from each thread are then reduced on the CPU.

Parameters:
input1Begin A Vector::iterator to the first element in the first range.
input1End A Vector::iterator to the last element of the first range.
input2Begin A Vector::iterator to the first element in the second range.
input2End A Vector::iterator to the last element of the second range.
Returns:
The scalar result of the reduction performed.
template<typename MapFunc , typename ReduceFunc >
template<typename T >
T skepu::MapReduce< MapFunc, ReduceFunc >::operator() ( Vector< T > &  input  ) 

Performs the Map on one Vector and Reduce on the result. Returns a scalar result.

Depending on which backend was used, different versions of the skeleton is called. If SKEPU_CUDA is defined, the CUDA backend is used, similarly if SKEPU_OPENCL or SKEPU_OPENMP are defined then the OpenCL or OpenMP backend is used. As a fallback there is always a CPU version.

Parameters:
input A vector which the map and reduce will be performed on.
Returns:
The scalar result of the map-reduce combination performed.

References skepu::MapReduce< MapFunc, ReduceFunc >::CL(), skepu::MapReduce< MapFunc, ReduceFunc >::CPU(), skepu::MapReduce< MapFunc, ReduceFunc >::CU(), skepu::MapReduce< MapFunc, ReduceFunc >::OMP(), and skepu::Vector< T >::size().

Here is the call graph for this function:

template<typename MapFunc , typename ReduceFunc >
template<typename T >
T skepu::MapReduce< MapFunc, ReduceFunc >::operator() ( Vector< T > &  input1,
Vector< T > &  input2 
)

Performs the Map on two Vectors and Reduce on the result. Returns a scalar result.

Depending on which backend was used, different versions of the skeleton is called. If SKEPU_CUDA is defined, the CUDA backend is used, similarly if SKEPU_OPENCL or SKEPU_OPENMP are defined then the OpenCL or OpenMP backend is used. As a fallback there is always a CPU version.

Parameters:
input1 A Vector which the map and reduce will be performed on.
input2 A Vector which the map and reduce will be performed on.
Returns:
The scalar result of the map-reduce combination performed.

References skepu::MapReduce< MapFunc, ReduceFunc >::CL(), skepu::MapReduce< MapFunc, ReduceFunc >::CPU(), skepu::MapReduce< MapFunc, ReduceFunc >::CU(), skepu::MapReduce< MapFunc, ReduceFunc >::OMP(), and skepu::Vector< T >::size().

Here is the call graph for this function:

template<typename MapFunc , typename ReduceFunc >
template<typename Input1Iterator , typename Input2Iterator , typename Input3Iterator >
Input1Iterator::value_type skepu::MapReduce< MapFunc, ReduceFunc >::operator() ( Input1Iterator  input1Begin,
Input1Iterator  input1End,
Input2Iterator  input2Begin,
Input2Iterator  input2End,
Input3Iterator  input3Begin,
Input3Iterator  input3End 
)

Performs the Map on three ranges of elements and Reduce on the result. Returns a scalar result.

Depending on which backend was used, different versions of the skeleton is called. If SKEPU_CUDA is defined, the CUDA backend is used, similarly if SKEPU_OPENCL or SKEPU_OPENMP are defined then the OpenCL or OpenMP backend is used. As a fallback there is always a CPU version.

Parameters:
input1Begin A Vector::iterator to the first element in the first range.
input1End A Vector::iterator to the last element of the first range.
input2Begin A Vector::iterator to the first element in the second range.
input2End A Vector::iterator to the last element of the second range.
input3Begin A Vector::iterator to the first element in the third range.
input3End A Vector::iterator to the last element of the third range.
Returns:
The scalar result of the map-reduce combination performed.

References skepu::MapReduce< MapFunc, ReduceFunc >::CL(), skepu::MapReduce< MapFunc, ReduceFunc >::CPU(), skepu::MapReduce< MapFunc, ReduceFunc >::CU(), and skepu::MapReduce< MapFunc, ReduceFunc >::OMP().

Here is the call graph for this function:

template<typename MapFunc , typename ReduceFunc >
template<typename T >
T skepu::MapReduce< MapFunc, ReduceFunc >::operator() ( Vector< T > &  input1,
Vector< T > &  input2,
Vector< T > &  input3 
)

Performs the Map on three Vectors and Reduce on the result. Returns a scalar result.

Depending on which backend was used, different versions of the skeleton is called. If SKEPU_CUDA is defined, the CUDA backend is used, similarly if SKEPU_OPENCL or SKEPU_OPENMP are defined then the OpenCL or OpenMP backend is used. As a fallback there is always a CPU version.

Parameters:
input1 A vector which the mapping will be performed on.
input2 A vector which the mapping will be performed on.
input3 A vector which the mapping will be performed on.
Returns:
The scalar result of the map-reduce combination performed.

References skepu::MapReduce< MapFunc, ReduceFunc >::CL(), skepu::MapReduce< MapFunc, ReduceFunc >::CPU(), skepu::MapReduce< MapFunc, ReduceFunc >::CU(), skepu::MapReduce< MapFunc, ReduceFunc >::OMP(), and skepu::Vector< T >::size().

Here is the call graph for this function:

template<typename MapFunc , typename ReduceFunc >
template<typename Input1Iterator , typename Input2Iterator >
Input1Iterator::value_type skepu::MapReduce< MapFunc, ReduceFunc >::operator() ( Input1Iterator  input1Begin,
Input1Iterator  input1End,
Input2Iterator  input2Begin,
Input2Iterator  input2End 
)

Performs the Map on two ranges of elements and Reduce on the result. Returns a scalar result.

Depending on which backend was used, different versions of the skeleton is called. If SKEPU_CUDA is defined, the CUDA backend is used, similarly if SKEPU_OPENCL or SKEPU_OPENMP are defined then the OpenCL or OpenMP backend is used. As a fallback there is always a CPU version.

Parameters:
input1Begin A Vector::iterator to the first element in the first range.
input1End A Vector::iterator to the last element of the first range.
input2Begin A Vector::iterator to the first element in the second range.
input2End A Vector::iterator to the last element of the second range.
Returns:
The scalar result of the map-reduce combination performed.

References skepu::MapReduce< MapFunc, ReduceFunc >::CL(), skepu::MapReduce< MapFunc, ReduceFunc >::CPU(), skepu::MapReduce< MapFunc, ReduceFunc >::CU(), and skepu::MapReduce< MapFunc, ReduceFunc >::OMP().

Here is the call graph for this function:

template<typename MapFunc , typename ReduceFunc >
template<typename InputIterator >
InputIterator::value_type skepu::MapReduce< MapFunc, ReduceFunc >::operator() ( InputIterator  inputBegin,
InputIterator  inputEnd 
)

Performs the Map on one range of elements and Reduce on the result. Returns a scalar result.

Depending on which backend was used, different versions of the skeleton is called. If SKEPU_CUDA is defined, the CUDA backend is used, similarly if SKEPU_OPENCL or SKEPU_OPENMP are defined then the OpenCL or OpenMP backend is used. As a fallback there is always a CPU version.

Parameters:
inputBegin A Vector::iterator to the first element in the range.
inputEnd A Vector::iterator to the last element of the range.
Returns:
The scalar result of the map-reduce combination performed.

References skepu::MapReduce< MapFunc, ReduceFunc >::CL(), skepu::MapReduce< MapFunc, ReduceFunc >::CPU(), skepu::MapReduce< MapFunc, ReduceFunc >::CU(), and skepu::MapReduce< MapFunc, ReduceFunc >::OMP().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Enumerations Friends Defines