SkePU  1.2
 All Classes Namespaces Files Functions Variables Enumerations Friends Macros Groups Pages
Public Member Functions | List of all members
skepu::MapReduce< MapFunc, ReduceFunc > Class Template Reference

A class representing the MapReduce skeleton. More...

#include <mapreduce.h>

Public Member Functions

 MapReduce (MapFunc *mapFunc, ReduceFunc *reduceFunc)
 
 ~MapReduce ()
 
template<typename T >
operator() (Vector< T > &input)
 
template<typename T >
operator() (Matrix< 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 T >
operator() (Matrix< T > &input1, Matrix< 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 T >
operator() (Matrix< T > &input1, Matrix< T > &input2, Matrix< 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 T >
CPU (Matrix< 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 T >
CPU (Matrix< T > &input1, Matrix< 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 T >
CPU (Matrix< T > &input1, Matrix< T > &input2, Matrix< 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 T >
OMP (Matrix< 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 T >
OMP (Matrix< T > &input1, Matrix< 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 T >
OMP (Matrix< T > &input1, Matrix< T > &input2, Matrix< 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 T >
CU (Matrix< 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 T >
CU (Matrix< T > &input1, Matrix< 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 T >
CU (Matrix< T > &input1, Matrix< T > &input2, Matrix< 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 T >
CL (Matrix< 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 T >
CL (Matrix< T > &input1, Matrix< 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 T >
CL (Matrix< T > &input1, Matrix< T > &input2, Matrix< 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.

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 (matrices) to a result vector (matrix), 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 containers (vectors, matrices).

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
mapFuncA pointer to a valid unary, binary or trinary user function. Will be deleted in the destructor.
reduceFuncA pointer to a valid binary user function. Will be deleted in the destructor.

References skepu::Environment< T >::getInstance().

Here is the call graph for this function:

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
inputA vector which the map and reduce will be performed on.
useNumGPUInteger 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 ( Matrix< T > &  input,
int  useNumGPU = 1 
)

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

Parameters
inputA matrix which the map and reduce will be performed on.
useNumGPUInteger 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, unsigned int deviceID) or on multiple devices, calling mapReduceNumDevices_CL(InputIterator inputBegin, InputIterator inputEnd, size_t numDevices). Using OpenCL as backend.

Parameters
inputBeginAn iterator to the first element in the range.
inputEndAn iterator to the last element of the range.
useNumGPUInteger 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
input1A Vector which the map and reduce will be performed on.
input2A Vector which the map and reduce will be performed on.
useNumGPUInteger 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 ( Matrix< T > &  input1,
Matrix< T > &  input2,
int  useNumGPU = 1 
)

Performs the Map on two matrices 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
input1A matrix which the map and reduce will be performed on.
input2A matrix which the map and reduce will be performed on.
useNumGPUInteger 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 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, unsigned int deviceID) or on multiple devices, calling mapReduceNumDevices_CL(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, size_t numDevices). Using OpenCL as backend.

Parameters
input1BeginAn iterator to the first element in the first range.
input1EndAn iterator to the last element of the first range.
input2BeginAn iterator to the first element in the second range.
input2EndAn iterator to the last element of the second range.
useNumGPUInteger 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,
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
input1A vector which the mapping will be performed on.
input2A vector which the mapping will be performed on.
input3A vector which the mapping will be performed on.
useNumGPUInteger 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 ( Matrix< T > &  input1,
Matrix< T > &  input2,
Matrix< T > &  input3,
int  useNumGPU = 1 
)

Performs the Map on three matrices 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
input1A matrix which the mapping will be performed on.
input2A matrix which the mapping will be performed on.
input3A matrix which the mapping will be performed on.
useNumGPUInteger 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 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, unsigned int deviceID) or on multiple devices, calling mapReduceNumDevices_CL(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, Input3Iterator input3Begin, Input3Iterator input3End, size_t numDevices). Using OpenCL as backend.

Parameters
input1BeginAn iterator to the first element in the first range.
input1EndAn iterator to the last element of the first range.
input2BeginAn iterator to the first element in the second range.
input2EndAn iterator to the last element of the second range.
input3BeginAn iterator to the first element in the third range.
input3EndAn iterator to the last element of the third range.
useNumGPUInteger 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 >::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
inputA 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().

Referenced by skepu::cpu_tune_wrapper_mapreduce().

Here is the call graph for this function:

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

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

Parameters
inputA matrix which the reduction will be performed on.
Returns
The scalar result of the reduction 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
inputBeginAn iterator to the first element in the range.
inputEndAn 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 
)

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
input1A Vector which the map and reduce will be performed on.
input2A Vector which the map and reduce 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 >::CPU ( Matrix< T > &  input1,
Matrix< T > &  input2 
)

Performs the Map on two matrices 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
input1A matrix which the map and reduce will be performed on.
input2A matrix which the map and reduce will be performed on.
Returns
The scalar result of the reduction performed.
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
input1BeginAn iterator to the first element in the first range.
input1EndAn iterator to the last element of the first range.
input2BeginAn iterator to the first element in the second range.
input2EndAn 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 >::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
input1A vector which the mapping will be performed on.
input2A vector which the mapping will be performed on.
input3A vector which the mapping 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 >::CPU ( Matrix< T > &  input1,
Matrix< T > &  input2,
Matrix< T > &  input3 
)

Performs the Map on three matrices 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
input1A matrix which the mapping will be performed on.
input2A matrix which the mapping will be performed on.
input3A matrix which the mapping will be performed on.
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
input1BeginAn iterator to the first element in the first range.
input1EndAn iterator to the last element of the first range.
input2BeginAn iterator to the first element in the second range.
input2EndAn iterator to the last element of the second range.
input3BeginAn iterator to the first element in the third range.
input3EndAn 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 >::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
inputA vector which the map and reduce will be performed on.
useNumGPUInteger 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().

Referenced by skepu::cuda_tune_wrapper_mapreduce().

Here is the call graph for this function:

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

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

Parameters
inputA matrix which the map and reduce will be performed on.
useNumGPUInteger 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 >::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, unsigned int deviceID) or on multiple devices, starting one thread per device where each thread runs mapReduceThreadFunc1_CU(void* _args). Using CUDA as backend.

Parameters
inputBeginAn iterator to the first element in the range.
inputEndAn iterator to the last element of the range.
useNumGPUInteger specifying how many devices to use. 0 = implementation decides.
Returns
The scalar result of the map-reduce combination performed.

References skepu::getNumBlocksAndThreads(), skepu::MapReduceKernel1_CU(), and MAX_GPU_DEVICES.

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
input1A Vector which the map and reduce will be performed on.
input2A Vector which the map and reduce will be performed on.
useNumGPUInteger 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 >::CU ( Matrix< T > &  input1,
Matrix< T > &  input2,
int  useNumGPU = 1 
)

Performs the Map on two Matrices 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
input1A matrix which the map and reduce will be performed on.
input2A matrix which the map and reduce will be performed on.
useNumGPUInteger 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 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, unsigned int deviceID) or on multiple devices, starting one thread per device where each thread runs mapReduceThreadFunc2_CU(void* _args). Using CUDA as backend.

Parameters
input1BeginAn iterator to the first element in the first range.
input1EndAn iterator to the last element of the first range.
input2BeginAn iterator to the first element in the second range.
input2EndAn iterator to the last element of the second range.
useNumGPUInteger specifying how many devices to use. 0 = implementation decides.
Returns
The scalar result of the map-reduce combination performed.

References skepu::getNumBlocksAndThreads(), skepu::MapReduceKernel2_CU(), and MAX_GPU_DEVICES.

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
input1A vector which the mapping will be performed on.
input2A vector which the mapping will be performed on.
input3A vector which the mapping will be performed on.
useNumGPUInteger 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 >::CU ( Matrix< T > &  input1,
Matrix< T > &  input2,
Matrix< T > &  input3,
int  useNumGPU = 1 
)

Performs the Map on three matrices 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
input1A matrix which the mapping will be performed on.
input2A matrix which the mapping will be performed on.
input3A matrix which the mapping will be performed on.
useNumGPUInteger 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 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, unsigned int deviceID) or on multiple devices, starting one thread per device where each thread runs mapReduceThreadFunc3_CU(void* _args). Using CUDA as backend.

Parameters
input1BeginAn iterator to the first element in the first range.
input1EndAn iterator to the last element of the first range.
input2BeginAn iterator to the first element in the second range.
input2EndAn iterator to the last element of the second range.
input3BeginAn iterator to the first element in the third range.
input3EndAn iterator to the last element of the third range.
useNumGPUInteger specifying how many devices to use. 0 = implementation decides.
Returns
The scalar result of the map-reduce combination performed.

References skepu::getNumBlocksAndThreads(), skepu::MapReduceKernel3_CU(), and MAX_GPU_DEVICES.

Here is the call graph for this function:

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
inputA 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().

Referenced by skepu::omp_tune_wrapper_mapreduce().

Here is the call graph for this function:

template<typename MapFunc , typename ReduceFunc >
template<typename T >
T skepu::MapReduce< MapFunc, ReduceFunc >::OMP ( Matrix< T > &  input)

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

Parameters
inputA matrix which the reduction will be performed on.
Returns
The scalar result of the reduction performed.
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
inputBeginAn iterator to the first element in the range.
inputEndAn 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 > &  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
input1A Vector which the map and reduce will be performed on.
input2A Vector which the map and reduce 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 ( Matrix< T > &  input1,
Matrix< T > &  input2 
)

Performs the Map on two Matrices 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
input1A Matrix which the map and reduce will be performed on.
input2A Matrix which the map and reduce will be performed on.
Returns
The scalar result of the reduction performed.
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
input1BeginAn iterator to the first element in the first range.
input1EndAn iterator to the last element of the first range.
input2BeginAn iterator to the first element in the second range.
input2EndAn 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 >::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
input1A vector which the mapping will be performed on.
input2A vector which the mapping will be performed on.
input3A vector which the mapping 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 ( Matrix< T > &  input1,
Matrix< T > &  input2,
Matrix< T > &  input3 
)

Performs the Map on three Matrices 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
input1A matrix which the mapping will be performed on.
input2A matrix which the mapping will be performed on.
input3A matrix which the mapping will be performed on.
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 >::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
input1BeginAn iterator to the first element in the first range.
input1EndAn iterator to the last element of the first range.
input2BeginAn iterator to the first element in the second range.
input2EndAn iterator to the last element of the second range.
input3BeginAn iterator to the first element in the third range.
input3EndAn 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 >::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
inputA vector which the map and reduce will be performed on.
Returns
The scalar result of the map-reduce combination performed.

References skepu::Vector< T >::isModified_CU(), skepu::Vector< T >::isVectorOnDevice_CU(), 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() ( Matrix< T > &  input)

Performs the Map on one Matrix 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
inputA matrix which the map and reduce will be performed on.
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 >::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
inputBeginAn iterator to the first element in the range.
inputEndAn iterator to the last element of the range.
Returns
The scalar result of the map-reduce combination performed.
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
input1A Vector which the map and reduce will be performed on.
input2A Vector which the map and reduce will be performed on.
Returns
The scalar result of the map-reduce combination performed.

both are on GPU...

one of them is on GPU...

nothing is on GPU...

References skepu::Vector< T >::isModified_CU(), skepu::Vector< T >::isVectorOnDevice_CU(), 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() ( Matrix< T > &  input1,
Matrix< T > &  input2 
)

Performs the Map on two matrices 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
input1A matrix which the map and reduce will be performed on.
input2A matrix which the map and reduce will be performed on.
Returns
The scalar result of the map-reduce combination performed.

both are on GPU...

one of them is on GPU...

nothing is on GPU...

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
input1BeginAn iterator to the first element in the first range.
input1EndAn iterator to the last element of the first range.
input2BeginAn iterator to the first element in the second range.
input2EndAn iterator to the last element of the second range.
Returns
The scalar result of the map-reduce combination performed.
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
input1A vector which the mapping will be performed on.
input2A vector which the mapping will be performed on.
input3A vector which the mapping will be performed on.
Returns
The scalar result of the map-reduce combination performed.

all three are on GPU...

two of them are present on GPU...

one of them is present on GPU...

nothing is present on GPU...

References skepu::Vector< T >::isModified_CU(), skepu::Vector< T >::isVectorOnDevice_CU(), 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() ( Matrix< T > &  input1,
Matrix< T > &  input2,
Matrix< T > &  input3 
)

Performs the Map on three matrices 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
input1A matrix which the mapping will be performed on.
input2A matrix which the mapping will be performed on.
input3A matrix which the mapping will be performed on.
Returns
The scalar result of the map-reduce combination performed.

all three are on GPU...

two of them are present on GPU...

one of them is present on GPU...

nothing is present on GPU...

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
input1BeginAn iterator to the first element in the first range.
input1EndAn iterator to the last element of the first range.
input2BeginAn iterator to the first element in the second range.
input2EndAn iterator to the last element of the second range.
input3BeginAn iterator to the first element in the third range.
input3EndAn iterator to the last element of the third range.
Returns
The scalar result of the map-reduce combination performed.

The documentation for this class was generated from the following files: