A class representing the MapReduce skeleton. More...
#include <mapreduce.h>
Public Member Functions | |
MapReduce (MapFunc *mapFunc, ReduceFunc *reduceFunc) | |
~MapReduce () | |
template<typename T > | |
T | operator() (Vector< T > &input) |
template<typename T > | |
T | operator() (Matrix< T > &input) |
template<typename InputIterator > | |
InputIterator::value_type | operator() (InputIterator inputBegin, InputIterator inputEnd) |
template<typename T > | |
T | operator() (Vector< T > &input1, Vector< T > &input2) |
template<typename T > | |
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 > | |
T | operator() (Vector< T > &input1, Vector< T > &input2, Vector< T > &input3) |
template<typename T > | |
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 > | |
T | CPU (Vector< T > &input) |
template<typename T > | |
T | CPU (Matrix< T > &input) |
template<typename InputIterator > | |
InputIterator::value_type | CPU (InputIterator inputBegin, InputIterator inputEnd) |
template<typename T > | |
T | CPU (Vector< T > &input1, Vector< T > &input2) |
template<typename T > | |
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 > | |
T | CPU (Vector< T > &input1, Vector< T > &input2, Vector< T > &input3) |
template<typename T > | |
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 > | |
T | OMP (Vector< T > &input) |
template<typename T > | |
T | OMP (Matrix< T > &input) |
template<typename InputIterator > | |
InputIterator::value_type | OMP (InputIterator inputBegin, InputIterator inputEnd) |
template<typename T > | |
T | OMP (Vector< T > &input1, Vector< T > &input2) |
template<typename T > | |
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 > | |
T | OMP (Vector< T > &input1, Vector< T > &input2, Vector< T > &input3) |
template<typename T > | |
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 > | |
T | CU (Vector< T > &input, int useNumGPU=1) |
template<typename T > | |
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 > | |
T | CU (Vector< T > &input1, Vector< T > &input2, int useNumGPU=1) |
template<typename T > | |
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 > | |
T | CU (Vector< T > &input1, Vector< T > &input2, Vector< T > &input3, int useNumGPU=1) |
template<typename T > | |
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 > | |
T | CL (Vector< T > &input, int useNumGPU=1) |
template<typename T > | |
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 > | |
T | CL (Vector< T > &input1, Vector< T > &input2, int useNumGPU=1) |
template<typename T > | |
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 > | |
T | CL (Vector< T > &input1, Vector< T > &input2, Vector< T > &input3, int useNumGPU=1) |
template<typename T > | |
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) |
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.
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.
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. |
References skepu::Environment< T >::getInstance().
skepu::MapReduce< MapFunc, ReduceFunc >::~MapReduce | ( | ) |
When the MapReduce skeleton is destroyed, it deletes the user functions it was created with.
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.
input | A vector which the map and reduce will be performed on. |
useNumGPU | Integer specifying how many devices to use. 0 = implementation decides. |
References skepu::Vector< T >::begin(), and skepu::Vector< T >::end().
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.
input | A matrix which the map and reduce will be performed on. |
useNumGPU | Integer specifying how many devices to use. 0 = implementation decides. |
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.
inputBegin | An iterator to the first element in the range. |
inputEnd | An iterator to the last element of the range. |
useNumGPU | Integer specifying how many devices to use. 0 = implementation decides. |
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.
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. |
References skepu::Vector< T >::begin(), and skepu::Vector< T >::end().
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.
input1 | A matrix which the map and reduce will be performed on. |
input2 | A matrix which the map and reduce will be performed on. |
useNumGPU | Integer specifying how many devices to use. 0 = implementation decides. |
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.
input1Begin | An iterator to the first element in the first range. |
input1End | An iterator to the last element of the first range. |
input2Begin | An iterator to the first element in the second range. |
input2End | An iterator to the last element of the second range. |
useNumGPU | Integer specifying how many devices to use. 0 = implementation decides. |
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.
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. |
References skepu::Vector< T >::begin(), and skepu::Vector< T >::end().
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.
input1 | A matrix which the mapping will be performed on. |
input2 | A matrix which the mapping will be performed on. |
input3 | A matrix which the mapping will be performed on. |
useNumGPU | Integer specifying how many devices to use. 0 = implementation decides. |
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.
input1Begin | An iterator to the first element in the first range. |
input1End | An iterator to the last element of the first range. |
input2Begin | An iterator to the first element in the second range. |
input2End | An iterator to the last element of the second range. |
input3Begin | An iterator to the first element in the third range. |
input3End | An iterator to the last element of the third range. |
useNumGPU | Integer specifying how many devices to use. 0 = implementation decides. |
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.
input | A vector which the reduction will be performed on. |
References skepu::Vector< T >::begin(), and skepu::Vector< T >::end().
Referenced by skepu::cpu_tune_wrapper_mapreduce().
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.
input | A matrix which the reduction will be performed on. |
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.
inputBegin | An iterator to the first element in the range. |
inputEnd | An iterator to the last element of the range. |
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.
input1 | A Vector which the map and reduce will be performed on. |
input2 | A Vector which the map and reduce will be performed on. |
References skepu::Vector< T >::begin(), and skepu::Vector< T >::end().
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.
input1 | A matrix which the map and reduce will be performed on. |
input2 | A matrix which the map and reduce will be performed on. |
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.
input1Begin | An iterator to the first element in the first range. |
input1End | An iterator to the last element of the first range. |
input2Begin | An iterator to the first element in the second range. |
input2End | An iterator to the last element of the second range. |
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.
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. |
References skepu::Vector< T >::begin(), and skepu::Vector< T >::end().
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.
input1 | A matrix which the mapping will be performed on. |
input2 | A matrix which the mapping will be performed on. |
input3 | A matrix which the mapping will be performed on. |
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.
input1Begin | An iterator to the first element in the first range. |
input1End | An iterator to the last element of the first range. |
input2Begin | An iterator to the first element in the second range. |
input2End | An iterator to the last element of the second range. |
input3Begin | An iterator to the first element in the third range. |
input3End | An iterator to the last element of the third range. |
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.
input | A vector which the map and reduce will be performed on. |
useNumGPU | Integer specifying how many devices to use. 0 = implementation decides. |
References skepu::Vector< T >::begin(), and skepu::Vector< T >::end().
Referenced by skepu::cuda_tune_wrapper_mapreduce().
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.
input | A matrix which the map and reduce will be performed on. |
useNumGPU | Integer specifying how many devices to use. 0 = implementation decides. |
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.
inputBegin | An iterator to the first element in the range. |
inputEnd | An iterator to the last element of the range. |
useNumGPU | Integer specifying how many devices to use. 0 = implementation decides. |
References skepu::getNumBlocksAndThreads(), skepu::MapReduceKernel1_CU(), and MAX_GPU_DEVICES.
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.
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. |
References skepu::Vector< T >::begin(), and skepu::Vector< T >::end().
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.
input1 | A matrix which the map and reduce will be performed on. |
input2 | A matrix which the map and reduce will be performed on. |
useNumGPU | Integer specifying how many devices to use. 0 = implementation decides. |
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.
input1Begin | An iterator to the first element in the first range. |
input1End | An iterator to the last element of the first range. |
input2Begin | An iterator to the first element in the second range. |
input2End | An iterator to the last element of the second range. |
useNumGPU | Integer specifying how many devices to use. 0 = implementation decides. |
References skepu::getNumBlocksAndThreads(), skepu::MapReduceKernel2_CU(), and MAX_GPU_DEVICES.
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.
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. |
References skepu::Vector< T >::begin(), and skepu::Vector< T >::end().
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.
input1 | A matrix which the mapping will be performed on. |
input2 | A matrix which the mapping will be performed on. |
input3 | A matrix which the mapping will be performed on. |
useNumGPU | Integer specifying how many devices to use. 0 = implementation decides. |
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.
input1Begin | An iterator to the first element in the first range. |
input1End | An iterator to the last element of the first range. |
input2Begin | An iterator to the first element in the second range. |
input2End | An iterator to the last element of the second range. |
input3Begin | An iterator to the first element in the third range. |
input3End | An iterator to the last element of the third range. |
useNumGPU | Integer specifying how many devices to use. 0 = implementation decides. |
References skepu::getNumBlocksAndThreads(), skepu::MapReduceKernel3_CU(), and MAX_GPU_DEVICES.
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.
input | A vector which the reduction will be performed on. |
References skepu::Vector< T >::begin(), and skepu::Vector< T >::end().
Referenced by skepu::omp_tune_wrapper_mapreduce().
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.
input | A matrix which the reduction will be performed on. |
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.
inputBegin | An iterator to the first element in the range. |
inputEnd | An iterator to the last element of the range. |
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.
input1 | A Vector which the map and reduce will be performed on. |
input2 | A Vector which the map and reduce will be performed on. |
References skepu::Vector< T >::begin(), and skepu::Vector< T >::end().
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.
input1 | A Matrix which the map and reduce will be performed on. |
input2 | A Matrix which the map and reduce will be performed on. |
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.
input1Begin | An iterator to the first element in the first range. |
input1End | An iterator to the last element of the first range. |
input2Begin | An iterator to the first element in the second range. |
input2End | An iterator to the last element of the second range. |
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.
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. |
References skepu::Vector< T >::begin(), and skepu::Vector< T >::end().
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.
input1 | A matrix which the mapping will be performed on. |
input2 | A matrix which the mapping will be performed on. |
input3 | A matrix which the mapping will be performed on. |
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.
input1Begin | An iterator to the first element in the first range. |
input1End | An iterator to the last element of the first range. |
input2Begin | An iterator to the first element in the second range. |
input2End | An iterator to the last element of the second range. |
input3Begin | An iterator to the first element in the third range. |
input3End | An iterator to the last element of the third range. |
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.
input | A vector which the map and reduce will be performed on. |
References skepu::Vector< T >::isModified_CU(), skepu::Vector< T >::isVectorOnDevice_CU(), and skepu::Vector< T >::size().
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.
input | A matrix which the map and reduce will be performed on. |
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.
inputBegin | An iterator to the first element in the range. |
inputEnd | An iterator to the last element of the range. |
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.
input1 | A Vector which the map and reduce will be performed on. |
input2 | A Vector which the map and reduce will be performed on. |
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().
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.
input1 | A matrix which the map and reduce will be performed on. |
input2 | A matrix which the map and reduce will be performed on. |
both are on GPU...
one of them is on GPU...
nothing is on GPU...
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.
input1Begin | An iterator to the first element in the first range. |
input1End | An iterator to the last element of the first range. |
input2Begin | An iterator to the first element in the second range. |
input2End | An iterator to the last element of the second range. |
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.
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. |
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().
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.
input1 | A matrix which the mapping will be performed on. |
input2 | A matrix which the mapping will be performed on. |
input3 | A matrix which the mapping will be performed on. |
all three are on GPU...
two of them are present on GPU...
one of them is present on GPU...
nothing is present on GPU...
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.
input1Begin | An iterator to the first element in the first range. |
input1End | An iterator to the last element of the first range. |
input2Begin | An iterator to the first element in the second range. |
input2End | An iterator to the last element of the second range. |
input3Begin | An iterator to the first element in the third range. |
input3End | An iterator to the last element of the third range. |