Public Member Functions

skepu::Map< MapFunc > Class Template Reference
[Skeletons]

A class representing the Map skeleton. More...

#include <map.h>

Collaboration diagram for skepu::Map< MapFunc >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Map (MapFunc *mapFunc)
 ~Map ()
template<typename T >
void setConstant (T constant1)
void finishAll ()
template<typename T >
void operator() (Vector< T > &input)
template<typename T >
void operator() (Vector< T > &input, Vector< T > &output)
template<typename InputIterator >
void operator() (InputIterator inputBegin, InputIterator inputEnd)
template<typename InputIterator , typename OutputIterator >
void operator() (InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin)
template<typename T >
void operator() (Vector< T > &input1, Vector< T > &input2, Vector< T > &output)
template<typename Input1Iterator , typename Input2Iterator , typename OutputIterator >
void operator() (Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, OutputIterator outputBegin)
template<typename T >
void operator() (Vector< T > &input1, Vector< T > &input2, Vector< T > &input3, Vector< T > &output)
template<typename Input1Iterator , typename Input2Iterator , typename Input3Iterator , typename OutputIterator >
void operator() (Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, Input3Iterator input3Begin, Input3Iterator input3End, OutputIterator outputBegin)
template<typename T >
void CPU (Vector< T > &input)
template<typename T >
void CPU (Vector< T > &input, Vector< T > &output)
template<typename InputIterator >
void CPU (InputIterator inputBegin, InputIterator inputEnd)
template<typename InputIterator , typename OutputIterator >
void CPU (InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin)
template<typename T >
void CPU (Vector< T > &input1, Vector< T > &input2, Vector< T > &output)
template<typename Input1Iterator , typename Input2Iterator , typename OutputIterator >
void CPU (Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, OutputIterator outputBegin)
template<typename T >
void CPU (Vector< T > &input1, Vector< T > &input2, Vector< T > &input3, Vector< T > &output)
template<typename Input1Iterator , typename Input2Iterator , typename Input3Iterator , typename OutputIterator >
void CPU (Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, Input3Iterator input3Begin, Input3Iterator input3End, OutputIterator outputBegin)
template<typename T >
void OMP (Vector< T > &input)
template<typename T >
void OMP (Vector< T > &input, Vector< T > &output)
template<typename InputIterator >
void OMP (InputIterator inputBegin, InputIterator inputEnd)
template<typename InputIterator , typename OutputIterator >
void OMP (InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin)
template<typename T >
void OMP (Vector< T > &input1, Vector< T > &input2, Vector< T > &output)
template<typename Input1Iterator , typename Input2Iterator , typename OutputIterator >
void OMP (Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, OutputIterator outputBegin)
template<typename T >
void OMP (Vector< T > &input1, Vector< T > &input2, Vector< T > &input3, Vector< T > &output)
template<typename Input1Iterator , typename Input2Iterator , typename Input3Iterator , typename OutputIterator >
void OMP (Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, Input3Iterator input3Begin, Input3Iterator input3End, OutputIterator outputBegin)
template<typename T >
void CU (Vector< T > &input, int useNumGPU=1)
template<typename T >
void CU (Vector< T > &input, Vector< T > &output, int useNumGPU=1)
template<typename InputIterator >
void CU (InputIterator inputBegin, InputIterator inputEnd, int useNumGPU=1)
template<typename InputIterator , typename OutputIterator >
void CU (InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin, int useNumGPU=1)
template<typename T >
void CU (Vector< T > &input1, Vector< T > &input2, Vector< T > &output, int useNumGPU=1)
template<typename Input1Iterator , typename Input2Iterator , typename OutputIterator >
void CU (Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, OutputIterator outputBegin, int useNumGPU=1)
template<typename T >
void CU (Vector< T > &input1, Vector< T > &input2, Vector< T > &input3, Vector< T > &output, int useNumGPU=1)
template<typename Input1Iterator , typename Input2Iterator , typename Input3Iterator , typename OutputIterator >
void CU (Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, Input3Iterator input3Begin, Input3Iterator input3End, OutputIterator outputBegin, int useNumGPU=1)
template<typename T >
void CL (Vector< T > &input, int useNumGPU=1)
template<typename T >
void CL (Vector< T > &input, Vector< T > &output, int useNumGPU=1)
template<typename InputIterator >
void CL (InputIterator inputBegin, InputIterator inputEnd, int useNumGPU=1)
template<typename InputIterator , typename OutputIterator >
void CL (InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin, int useNumGPU=1)
template<typename T >
void CL (Vector< T > &input1, Vector< T > &input2, Vector< T > &output, int useNumGPU=1)
template<typename Input1Iterator , typename Input2Iterator , typename OutputIterator >
void CL (Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, OutputIterator outputBegin, int useNumGPU=1)
template<typename T >
void CL (Vector< T > &input1, Vector< T > &input2, Vector< T > &input3, Vector< T > &output, int useNumGPU=1)
template<typename Input1Iterator , typename Input2Iterator , typename Input3Iterator , typename OutputIterator >
void CL (Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, Input3Iterator input3Begin, Input3Iterator input3End, OutputIterator outputBegin, int useNumGPU=1)

Detailed Description

template<typename MapFunc>
class skepu::Map< MapFunc >

A class representing the Map skeleton.

Author:
Johan Enmyren
Version:
0.6

This class defines the Map skeleton, a calculation pattern where a user function is applied to each element of an input range. Once the Map object is 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 Map skeleton also includes a pointer to an Environment which includes the devices available to execute on.


Constructor & Destructor Documentation

template<typename MapFunc >
skepu::Map< MapFunc >::Map ( MapFunc *  mapFunc  ) 

When creating an instance of the Map skeleton, a pointer to a unary, binary or trinary user function must be provided. 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 user function. Will be deleted in the destructor.
template<typename MapFunc >
skepu::Map< MapFunc >::~Map (  ) 

When the Map skeleton is destroyed, it deletes the user function it was created with.


Member Function Documentation

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

Performs mapping on one vector with OpenCL backend. Input is used as output. The Map skeleton needs to be created with a unary user function. The function is a wrapper for CL(InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin, int useNumGPU).

Parameters:
input A vector which the mapping will be performed on. It will be overwritten with the result.
useNumGPU Integer specifying how many devices to use. 0 = Implementation decides.

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

Here is the call graph for this function:

template<typename MapFunc >
template<typename Input1Iterator , typename Input2Iterator , typename Input3Iterator , typename OutputIterator >
void skepu::Map< MapFunc >::CL ( Input1Iterator  input1Begin,
Input1Iterator  input1End,
Input2Iterator  input2Begin,
Input2Iterator  input2End,
Input3Iterator  input3Begin,
Input3Iterator  input3End,
OutputIterator  outputBegin,
int  useNumGPU = 1 
)

Performs the Map on three element ranges with OpenCL as backend. Seperate output range. The Map skeleton needs to be created with a trinary user function. Calls mapNumDevices_CL(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, Input3Iterator input3Begin, Input3Iterator input3End, OutputIterator outputBegin, int numDevices).

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.
outputBegin A Vector::iterator to the first element of the output range.
useNumGPU Integer specifying how many devices to use. 0 = Implementation decides.
template<typename MapFunc >
template<typename T >
void skepu::Map< MapFunc >::CL ( Vector< T > &  input,
Vector< T > &  output,
int  useNumGPU = 1 
)

Performs the Map on one vector with OpenCL as backend. Seperate output vector is used. The Map skeleton needs to be created with a unary user function. The function is a wrapper for CL(InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin, int useNumGPU).

Parameters:
input A vector which the mapping will be performed on. It will be overwritten with the result.
output The result vector, will be overwritten with the result and resized if needed.
useNumGPU Integer specifying how many devices to use. 0 = Implementation decides.

References skepu::Vector< T >::begin(), skepu::Map< MapFunc >::CL(), skepu::Vector< T >::clear(), skepu::Vector< T >::end(), skepu::Vector< T >::resize(), and skepu::Vector< T >::size().

Here is the call graph for this function:

template<typename MapFunc >
template<typename InputIterator >
void skepu::Map< MapFunc >::CL ( InputIterator  inputBegin,
InputIterator  inputEnd,
int  useNumGPU = 1 
)

Performs the Map on one element range with OpenCL as backend. Input is used as output. The Map skeleton needs to be created with a unary user function. The function is a wrapper for CL(InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin, int useNumGPU).

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.

References skepu::Map< MapFunc >::CL().

Here is the call graph for this function:

template<typename MapFunc >
template<typename InputIterator , typename OutputIterator >
void skepu::Map< MapFunc >::CL ( InputIterator  inputBegin,
InputIterator  inputEnd,
OutputIterator  outputBegin,
int  useNumGPU = 1 
)

Performs the Map on one element range with OpenCL as backend. Seperate output range. The Map skeleton needs to be created with a unary user function. Calls mapNumDevices_CL(InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin, int numDevices).

Parameters:
inputBegin A Vector::iterator to the first element in the range.
inputEnd A Vector::iterator to the last element of the range.
outputBegin A Vector::iterator to the first element of the output range.
useNumGPU Integer specifying how many devices to use. 0 = Implementation decides.
template<typename MapFunc >
template<typename T >
void skepu::Map< MapFunc >::CL ( Vector< T > &  input1,
Vector< T > &  input2,
Vector< T > &  output,
int  useNumGPU = 1 
)

Performs the Map on two vectors with OpenCL as backend. Seperate output vector. The Map skeleton needs to be created with a binary user function. The function is a wrapper for CL(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, OutputIterator outputBegin, int useNumGPU).

Parameters:
input1 A vector which the mapping will be performed on.
input2 A vector which the mapping will be performed on.
output The result vector, will be overwritten with the result and resized if needed.
useNumGPU Integer specifying how many devices to use. 0 = Implementation decides.

References skepu::Vector< T >::begin(), skepu::Map< MapFunc >::CL(), skepu::Vector< T >::clear(), skepu::Vector< T >::end(), skepu::Vector< T >::resize(), and skepu::Vector< T >::size().

Here is the call graph for this function:

template<typename MapFunc >
template<typename Input1Iterator , typename Input2Iterator , typename OutputIterator >
void skepu::Map< MapFunc >::CL ( Input1Iterator  input1Begin,
Input1Iterator  input1End,
Input2Iterator  input2Begin,
Input2Iterator  input2End,
OutputIterator  outputBegin,
int  useNumGPU = 1 
)

Performs the Map on two element ranges with OpenCL as backend. Seperate output range. The Map skeleton needs to be created with a binary user function. Calls mapNumDevices_CL(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, OutputIterator outputBegin, int numDevices).

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.
outputBegin A Vector::iterator to the first element of the output range.
useNumGPU Integer specifying how many devices to use. 0 = Implementation decides.
template<typename MapFunc >
template<typename T >
void skepu::Map< MapFunc >::CL ( Vector< T > &  input1,
Vector< T > &  input2,
Vector< T > &  input3,
Vector< T > &  output,
int  useNumGPU = 1 
)

Performs the Map on three vectors with OpenCL as backend. Seperate output vector. The Map skeleton needs to be created with a trinary user function. The function is a wrapper for CL(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, Input3Iterator input3Begin, Input3Iterator input3End, OutputIterator outputBegin, int useNumGPU).

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.
output The result vector, will be overwritten with the result and resized if needed.
useNumGPU Integer specifying how many devices to use. 0 = Implementation decides.

References skepu::Vector< T >::begin(), skepu::Map< MapFunc >::CL(), skepu::Vector< T >::clear(), skepu::Vector< T >::end(), skepu::Vector< T >::resize(), and skepu::Vector< T >::size().

Here is the call graph for this function:

template<typename MapFunc >
template<typename Input1Iterator , typename Input2Iterator , typename OutputIterator >
void skepu::Map< MapFunc >::CPU ( Input1Iterator  input1Begin,
Input1Iterator  input1End,
Input2Iterator  input2Begin,
Input2Iterator  input2End,
OutputIterator  outputBegin 
)

Performs the Map with two element ranges on the CPU. Seperate output range is used. The Map skeleton needs to be created with a binary user function. The computation is done by iterating over all the elements in the ranges and applying the user function on each of them.

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.
outputBegin A Vector::iterator to the first element of the output range.
template<typename MapFunc >
template<typename T >
void skepu::Map< MapFunc >::CPU ( Vector< T > &  input1,
Vector< T > &  input2,
Vector< T > &  input3,
Vector< T > &  output 
)

Performs mapping with three vectors on the CPU. Seperate output is used. The function is a wrapper for CPU(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, Input3Iterator input3Begin, Input3Iterator input3End, OutputIterator outputBegin).

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.
output The result vector, will be overwritten with the result and resized if needed.

References skepu::Vector< T >::begin(), skepu::Vector< T >::clear(), skepu::Map< MapFunc >::CPU(), skepu::Vector< T >::end(), skepu::Vector< T >::resize(), and skepu::Vector< T >::size().

Here is the call graph for this function:

template<typename MapFunc >
template<typename T >
void skepu::Map< MapFunc >::CPU ( Vector< T > &  input  ) 

Performs mapping on one vector on the CPU. Input is used as output. The function is a wrapper for CPU(InputIterator inputBegin, InputIterator inputEnd).

Parameters:
input A vector which the mapping will be performed on. It will be overwritten with the result.

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

Here is the call graph for this function:

template<typename MapFunc >
template<typename Input1Iterator , typename Input2Iterator , typename Input3Iterator , typename OutputIterator >
void skepu::Map< MapFunc >::CPU ( Input1Iterator  input1Begin,
Input1Iterator  input1End,
Input2Iterator  input2Begin,
Input2Iterator  input2End,
Input3Iterator  input3Begin,
Input3Iterator  input3End,
OutputIterator  outputBegin 
)

Performs the Map with three element ranges on the CPU. Seperate output range is used. The Map skeleton needs to be created with a trinary user function. The computation is done by iterating over all the elements in the ranges and applying the user function on each of them.

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.
outputBegin A Vector::iterator to the first element of the output range.
template<typename MapFunc >
template<typename T >
void skepu::Map< MapFunc >::CPU ( Vector< T > &  input1,
Vector< T > &  input2,
Vector< T > &  output 
)

Performs mapping with two vectors on the CPU. Seperate output is used. The function is a wrapper for CPU(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, OutputIterator outputBegin).

Parameters:
input1 A vector which the mapping will be performed on.
input2 A vector which the mapping will be performed on.
output The result vector, will be overwritten with the result and resized if needed.

References skepu::Vector< T >::begin(), skepu::Vector< T >::clear(), skepu::Map< MapFunc >::CPU(), skepu::Vector< T >::end(), skepu::Vector< T >::resize(), and skepu::Vector< T >::size().

Here is the call graph for this function:

template<typename MapFunc >
template<typename T >
void skepu::Map< MapFunc >::CPU ( Vector< T > &  input,
Vector< T > &  output 
)

Performs mapping with one vector on the CPU. Seperate output is used. The function is a wrapper for CPU(InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin).

Parameters:
input A vector which the mapping will be performed on. It will be overwritten with the result.
output The result vector, will be overwritten with the result and resized if needed.

References skepu::Vector< T >::begin(), skepu::Vector< T >::clear(), skepu::Map< MapFunc >::CPU(), skepu::Vector< T >::end(), skepu::Vector< T >::resize(), and skepu::Vector< T >::size().

Here is the call graph for this function:

template<typename MapFunc >
template<typename InputIterator >
void skepu::Map< MapFunc >::CPU ( InputIterator  inputBegin,
InputIterator  inputEnd 
)

Performs the Map with one element range on the CPU. Input is used as output. The Map skeleton needs to be created with a unary user function. The computation is done by iterating over all the elements in the range and applying the user function on each of them.

Parameters:
inputBegin A Vector::iterator to the first element in the range.
inputEnd A Vector::iterator to the last element of the range.
template<typename MapFunc >
template<typename InputIterator , typename OutputIterator >
void skepu::Map< MapFunc >::CPU ( InputIterator  inputBegin,
InputIterator  inputEnd,
OutputIterator  outputBegin 
)

Performs the Map with one element range on the CPU. Seperate output range is used. The Map skeleton needs to be created with a unary user function. The computation is done by iterating over all the elements in the range and applying the user function on each of them.

Parameters:
inputBegin A Vector::iterator to the first element in the range.
inputEnd A Vector::iterator to the last element of the range.
outputBegin A Vector::iterator to the first element of the output range.
template<typename MapFunc >
template<typename Input1Iterator , typename Input2Iterator , typename Input3Iterator , typename OutputIterator >
void skepu::Map< MapFunc >::CU ( Input1Iterator  input1Begin,
Input1Iterator  input1End,
Input2Iterator  input2Begin,
Input2Iterator  input2End,
Input3Iterator  input3Begin,
Input3Iterator  input3End,
OutputIterator  outputBegin,
int  useNumGPU = 1 
)

Performs the Map on three element ranges with CUDA as backend. Seperate output range. The Map skeleton needs to be created with a trinary user function. Decides whether to use one device and mapSingleThread_CU or multiple devices and create new threads which calls mapThreadFunc3_CU. In the case of several devices the input ranges is divided evenly among the threads created.

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.
outputBegin A Vector::iterator to the first element of the output range.
useNumGPU Integer specifying how many devices to use. 0 = Implementation decides.

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

Here is the call graph for this function:

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

Performs mapping on two vectors with CUDA as backend. Seperate output vector. The function is a wrapper for CU(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, OutputIterator outputBegin, int useNumGPU).

Parameters:
input1 A vector which the mapping will be performed on.
input2 A vector which the mapping will be performed on.
output The result vector, will be overwritten with the result and resized if needed.
useNumGPU Integer specifying how many devices to use. 0 = Implementation decides.

References skepu::Vector< T >::begin(), skepu::Vector< T >::clear(), skepu::Map< MapFunc >::CU(), skepu::Vector< T >::end(), skepu::Vector< T >::resize(), and skepu::Vector< T >::size().

Here is the call graph for this function:

template<typename MapFunc >
template<typename Input1Iterator , typename Input2Iterator , typename OutputIterator >
void skepu::Map< MapFunc >::CU ( Input1Iterator  input1Begin,
Input1Iterator  input1End,
Input2Iterator  input2Begin,
Input2Iterator  input2End,
OutputIterator  outputBegin,
int  useNumGPU = 1 
)

Performs the Map on two element ranges with CUDA as backend. Seperate output range. The Map skeleton needs to be created with a binary user function. Decides whether to use one device and mapSingleThread_CU or multiple devices and create new threads which calls mapThreadFunc2_CU. In the case of several devices the input ranges is divided evenly among the threads created.

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.
outputBegin A Vector::iterator to the first element of the output range.
useNumGPU Integer specifying how many devices to use. 0 = Implementation decides.

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

Here is the call graph for this function:

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

Performs mapping on three vectors with CUDA as backend. Seperate output vector. The function is a wrapper for CU(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, Input3Iterator input3Begin, Input3Iterator input3End, OutputIterator outputBegin, int useNumGPU).

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.
output The result vector, will be overwritten with the result and resized if needed.
useNumGPU Integer specifying how many devices to use. 0 = Implementation decides.

References skepu::Vector< T >::begin(), skepu::Vector< T >::clear(), skepu::Map< MapFunc >::CU(), skepu::Vector< T >::end(), skepu::Vector< T >::resize(), and skepu::Vector< T >::size().

Here is the call graph for this function:

template<typename MapFunc >
template<typename T >
void skepu::Map< MapFunc >::CU ( Vector< T > &  input,
Vector< T > &  output,
int  useNumGPU = 1 
)

Performs mapping on one vector with CUDA backend. Seperate output vector. The function is a wrapper for CU(InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin, int useNumGPU).

Parameters:
input A vector which the mapping will be performed on.
output The result vector, will be overwritten with the result and resized if needed.
useNumGPU Integer specifying how many devices to use. 0 = Implementation decides.

References skepu::Vector< T >::begin(), skepu::Vector< T >::clear(), skepu::Map< MapFunc >::CU(), skepu::Vector< T >::end(), skepu::Vector< T >::resize(), and skepu::Vector< T >::size().

Here is the call graph for this function:

template<typename MapFunc >
template<typename InputIterator >
void skepu::Map< MapFunc >::CU ( InputIterator  inputBegin,
InputIterator  inputEnd,
int  useNumGPU = 1 
)

Performs the Map on one element range with CUDA as backend. Input is used as output. The Map skeleton needs to be created with a unary user function. The function is a wrapper for CU(InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin, int useNumGPU).

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.

References skepu::Map< MapFunc >::CU().

Here is the call graph for this function:

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

Performs mapping on one vector with CUDA backend. Input is used as output. The function is a wrapper for CU(InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin, int useNumGPU).

Parameters:
input A vector which the mapping will be performed on. It will be overwritten with the result.
useNumGPU Integer specifying how many devices to use. 0 = Implementation decides.

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

Here is the call graph for this function:

template<typename MapFunc >
template<typename InputIterator , typename OutputIterator >
void skepu::Map< MapFunc >::CU ( InputIterator  inputBegin,
InputIterator  inputEnd,
OutputIterator  outputBegin,
int  useNumGPU = 1 
)

Performs the Map on one element range with CUDA as backend. Seperate output range. The Map skeleton needs to be created with a unary user function. Decides whether to use one device and mapSingleThread_CU or multiple devices and create new threads which calls mapThreadFunc1_CU. In the case of several devices the input range is divided evenly among the threads created.

Parameters:
inputBegin A Vector::iterator to the first element in the range.
inputEnd A Vector::iterator to the last element of the range.
outputBegin A Vector::iterator to the first element of the output range.
useNumGPU Integer specifying how many devices to use. 0 = Implementation decides.

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

Here is the call graph for this function:

template<typename MapFunc >
void skepu::Map< MapFunc >::finishAll (  )  [inline]

Makes sure all operations on devices are finished.

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

Here is the call graph for this function:

template<typename MapFunc >
template<typename Input1Iterator , typename Input2Iterator , typename OutputIterator >
void skepu::Map< MapFunc >::OMP ( Input1Iterator  input1Begin,
Input1Iterator  input1End,
Input2Iterator  input2Begin,
Input2Iterator  input2End,
OutputIterator  outputBegin 
)

Performs the Map with two element ranges using the OpenMP backend. Seperate output range is used. The Map skeleton needs to be created with a binary user function. The computation is done by iterating over all the elements in the ranges and applying the user function on each of them. The ranges is automatically divided amongst threads by OpenMP.

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.
outputBegin A Vector::iterator to the first element of the output range.
template<typename MapFunc >
template<typename Input1Iterator , typename Input2Iterator , typename Input3Iterator , typename OutputIterator >
void skepu::Map< MapFunc >::OMP ( Input1Iterator  input1Begin,
Input1Iterator  input1End,
Input2Iterator  input2Begin,
Input2Iterator  input2End,
Input3Iterator  input3Begin,
Input3Iterator  input3End,
OutputIterator  outputBegin 
)

Performs the Map with three element ranges using the OpenMP backend. Seperate output range is used. The Map skeleton needs to be created with a trinary user function. The computation is done by iterating over all the elements in the ranges and applying the user function on each of them. The ranges is automatically divided amongst threads by OpenMP.

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.
outputBegin A Vector::iterator to the first element of the output range.
template<typename MapFunc >
template<typename T >
void skepu::Map< MapFunc >::OMP ( Vector< T > &  input,
Vector< T > &  output 
)

Performs mapping on one vector with OpenMP used as backend. Seperate output vector is used. The function is a wrapper for OMP(InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin).

Parameters:
input A vector which the mapping will be performed on. It will be overwritten with the result.
output The result vector, will be overwritten with the result and resized if needed.

References skepu::Vector< T >::begin(), skepu::Vector< T >::clear(), skepu::Vector< T >::end(), skepu::Map< MapFunc >::OMP(), skepu::Vector< T >::resize(), and skepu::Vector< T >::size().

Here is the call graph for this function:

template<typename MapFunc >
template<typename T >
void skepu::Map< MapFunc >::OMP ( Vector< T > &  input  ) 

Performs mapping on one vector with OpenMP used as backend. Input is used as output. The function is a wrapper for OMP(InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin).

Parameters:
input A vector which the mapping will be performed on. It will be overwritten with the result.

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

Here is the call graph for this function:

template<typename MapFunc >
template<typename InputIterator >
void skepu::Map< MapFunc >::OMP ( InputIterator  inputBegin,
InputIterator  inputEnd 
)

Performs the Map with one element range using the OpenMP backend. Input is used as output. The function is a wrapper for OMP(InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin).

Parameters:
inputBegin A Vector::iterator to the first element in the range.
inputEnd A Vector::iterator to the last element of the range.

References skepu::Map< MapFunc >::OMP().

Here is the call graph for this function:

template<typename MapFunc >
template<typename T >
void skepu::Map< MapFunc >::OMP ( Vector< T > &  input1,
Vector< T > &  input2,
Vector< T > &  output 
)

Performs mapping on two vectors with OpenMP used as backend. Seperate output vector is used. The function is a wrapper for OMP(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, OutputIterator outputBegin).

Parameters:
input1 A vector which the mapping will be performed on.
input2 A vector which the mapping will be performed on.
output The result vector, will be overwritten with the result and resized if needed.

References skepu::Vector< T >::begin(), skepu::Vector< T >::clear(), skepu::Vector< T >::end(), skepu::Map< MapFunc >::OMP(), skepu::Vector< T >::resize(), and skepu::Vector< T >::size().

Here is the call graph for this function:

template<typename MapFunc >
template<typename T >
void skepu::Map< MapFunc >::OMP ( Vector< T > &  input1,
Vector< T > &  input2,
Vector< T > &  input3,
Vector< T > &  output 
)

Performs mapping on three vectors with OpenMP used as backend. Seperate output vector is used. The function is a wrapper for OMP(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, Input3Iterator input3Begin, Input3Iterator input3End, OutputIterator outputBegin).

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.
output The result vector, will be overwritten with the result and resized if needed.

References skepu::Vector< T >::begin(), skepu::Vector< T >::clear(), skepu::Vector< T >::end(), skepu::Map< MapFunc >::OMP(), skepu::Vector< T >::resize(), and skepu::Vector< T >::size().

Here is the call graph for this function:

template<typename MapFunc >
template<typename InputIterator , typename OutputIterator >
void skepu::Map< MapFunc >::OMP ( InputIterator  inputBegin,
InputIterator  inputEnd,
OutputIterator  outputBegin 
)

Performs the Map with one element range using the OpenMP backend. Seperate output range is used. The Map skeleton needs to be created with a unary user function. The computation is done by iterating over all the elements in the range and applying the user function on each of them. The range is automatically divided amongst threads by OpenMP.

Parameters:
inputBegin A Vector::iterator to the first element in the range.
inputEnd A Vector::iterator to the last element of the range.
outputBegin A Vector::iterator to the first element of the output range.
template<typename MapFunc >
template<typename InputIterator , typename OutputIterator >
void skepu::Map< MapFunc >::operator() ( InputIterator  inputBegin,
InputIterator  inputEnd,
OutputIterator  outputBegin 
)

Performs the Map on a range of elements. A seperate output range is used. The Map skeleton needs to be created with a unary user function.

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.
outputBegin A Vector::iterator to the first element of the output range.

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

Here is the call graph for this function:

template<typename MapFunc >
template<typename Input1Iterator , typename Input2Iterator , typename Input3Iterator , typename OutputIterator >
void skepu::Map< MapFunc >::operator() ( Input1Iterator  input1Begin,
Input1Iterator  input1End,
Input2Iterator  input2Begin,
Input2Iterator  input2End,
Input3Iterator  input3Begin,
Input3Iterator  input3End,
OutputIterator  outputBegin 
)

Performs the Map on three ranges of elements. With a seperate output range. The Map skeleton needs to be created with a trinary user function.

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.
outputBegin A Vector::iterator to the first element of the output range.

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

Here is the call graph for this function:

template<typename MapFunc >
template<typename T >
void skepu::Map< MapFunc >::operator() ( Vector< T > &  input,
Vector< T > &  output 
)

Performs the Map on one vector. With a second vector as output. The Map skeleton needs to be created with a unary user function.

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 mapping will be performed on.
output The result vector, will be overwritten with the result and resized if needed.

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

Here is the call graph for this function:

template<typename MapFunc >
template<typename Input1Iterator , typename Input2Iterator , typename OutputIterator >
void skepu::Map< MapFunc >::operator() ( Input1Iterator  input1Begin,
Input1Iterator  input1End,
Input2Iterator  input2Begin,
Input2Iterator  input2End,
OutputIterator  outputBegin 
)

Performs the Map on two ranges of elements. With a seperate output range. The Map skeleton needs to be created with a binary user function.

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.
outputBegin A Vector::iterator to the first element of the output range.

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

Here is the call graph for this function:

template<typename MapFunc >
template<typename T >
void skepu::Map< MapFunc >::operator() ( Vector< T > &  input1,
Vector< T > &  input2,
Vector< T > &  output 
)

Performs the Map on two vectors. With a seperate output. The Map skeleton needs to be created with a binary user function.

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.
output The result vector, will be overwritten with the result and resized if needed.

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

Here is the call graph for this function:

template<typename MapFunc >
template<typename InputIterator >
void skepu::Map< MapFunc >::operator() ( InputIterator  inputBegin,
InputIterator  inputEnd 
)

Performs the Map on a range of elements. The same range is used as output. The Map skeleton needs to be created with a unary user function.

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.

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

Here is the call graph for this function:

template<typename MapFunc >
template<typename T >
void skepu::Map< MapFunc >::operator() ( Vector< T > &  input  ) 

Performs the Map on one vector. With itself as output. The Map skeleton needs to be created with a unary user function.

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 mapping will be performed on. It will be overwritten with the result.

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

Here is the call graph for this function:

template<typename MapFunc >
template<typename T >
void skepu::Map< MapFunc >::operator() ( Vector< T > &  input1,
Vector< T > &  input2,
Vector< T > &  input3,
Vector< T > &  output 
)

Performs the Map on three vectors. With a seperate output. The Map skeleton needs to be created with a trinary user function.

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.
output The result vector, will be overwritten with the result and resized if needed.

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

Here is the call graph for this function:

template<typename MapFunc >
template<typename T >
void skepu::Map< MapFunc >::setConstant ( constant1  )  [inline]

If the Mapping function supports a constant, set it with this function before a call.


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