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

A class representing the MapArray skeleton. More...

#include <maparray.h>

Public Member Functions

 MapArray (MapArrayFunc *mapArrayFunc)
 
 ~MapArray ()
 
template<typename U >
void setConstant (U constant1)
 
template<typename T >
void operator() (Vector< T > &input1, Vector< T > &input2, Vector< T > &output, int groupId=-1)
 
template<typename T >
void operator() (Vector< T > &input1, Matrix< T > &input2, Matrix< T > &output)
 
template<typename T >
void operator() (Vector< T > &input1, Matrix< T > &input2, Vector< T > &output)
 
template<typename T >
void operator() (Vector< T > &input1, SparseMatrix< 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 in , typename out >
void CPU (Vector< in > &input, MultiVector P, Vector< out > &output)
 
template<typename T >
void CPU (Vector< T > &input1, Vector< T > &input2, Vector< T > &output)
 
template<typename T >
void CPU (Vector< T > &input1, Matrix< T > &input2, Matrix< T > &output)
 
template<typename T >
void CPU (Vector< T > &input1, Matrix< T > &input2, Vector< T > &output)
 
template<typename T >
void CPU (Vector< T > &input1, SparseMatrix< 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 in , typename out >
void OMP (Vector< in > &input, MultiVector P, Vector< out > &output)
 
template<typename InputIterator , typename OutputIterator >
void OMP (InputIterator inputBegin, InputIterator inputEnd, MultiVector P, OutputIterator outputbegin)
 
template<typename T >
void OMP (Vector< T > &input1, Vector< T > &input2, Vector< T > &output)
 
template<typename T >
void OMP (Vector< T > &input1, Matrix< T > &input2, Matrix< T > &output)
 
template<typename T >
void OMP (Vector< T > &input1, Matrix< T > &input2, Vector< T > &output)
 
template<typename T >
void OMP (Vector< T > &input1, SparseMatrix< 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 in , typename out >
void CU (Vector< in > &input, MultiVector P, Vector< out > &output, int useNumGPU=1)
 
template<typename InputIterator , typename OutputIterator >
void CU (InputIterator inputBegin, InputIterator inputEnd, MultiVector P, OutputIterator outputbegin, int useNumGPU=1)
 
template<typename T >
void CU (Vector< T > &input1, Vector< T > &input2, Vector< T > &output, int useNumGPU=1)
 
template<typename T >
void CU (Vector< T > &input1, Matrix< T > &input2, Matrix< T > &output, int useNumGPU=1)
 
template<typename T >
void CU (Vector< T > &input1, Matrix< T > &input2, Vector< T > &output, int useNumGPU=1)
 
template<typename T >
void CU (Vector< T > &input1, SparseMatrix< 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 CL (Vector< T > &input1, Vector< T > &input2, Vector< T > &output, int useNumGPU=1)
 
template<typename T >
void CL (Vector< T > &input1, Matrix< T > &input2, Matrix< T > &output, int useNumGPU=1)
 
template<typename T >
void CL (Vector< T > &input1, Matrix< T > &input2, Vector< T > &output, int useNumGPU=1)
 
template<typename T >
void CL (Vector< T > &input1, SparseMatrix< 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)
 

Detailed Description

template<typename MapArrayFunc>
class skepu::MapArray< MapArrayFunc >

A class representing the MapArray skeleton.

This class defines the MapArray skeleton. MapArray is yet another variant of Map. It produces a result (vector/matrix) from either two input objects (vector/matrix) where each element of the result, is a function of the corresponding element of the second input (vector/matrix), and any number of elements from the first input (vector). This means that at each call to the user defined function, which is done for each element in input two, all elements from input one can be accessed. Once instantiated, it is meant to be used as a function and therefore overloading operator(). There are a few overloaded variants of this operator. One using containers as inputs and the other using iterators to define a range of elements.

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 MapArray skeleton also includes a pointer to an Environment which includes the devices available to execute on.

Constructor & Destructor Documentation

template<typename MapArrayFunc >
skepu::MapArray< MapArrayFunc >::MapArray ( MapArrayFunc *  mapArrayFunc)

When creating an instance of the MapArray skeleton, a pointer to an array 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
mapArrayFuncA pointer to a valid array user function. Will be deleted in the destructor.

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

Here is the call graph for this function:

template<typename MapArrayFunc >
skepu::MapArray< MapArrayFunc >::~MapArray ( )

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

Member Function Documentation

template<typename MapArrayFunc >
template<typename T >
void skepu::MapArray< MapArrayFunc >::CL ( Vector< T > &  input1,
Vector< T > &  input2,
Vector< T > &  output,
int  useNumGPU = 1 
)

Performs the MapArray on the two vectors with OpenCL as backend. Seperate output vector. First Vector can be accessed entirely for each element in second Vector. The function is a wrapper for CL(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, OutputIterator outputBegin, int useNumGPU).

Parameters
input1A vector which the mapping will be performed on.
input2A vector which the mapping will be performed on.
outputThe result vector, will be overwritten with the result and resized if needed.
useNumGPUInteger specifying how many devices to use. 0 = Implementation decides.

References skepu::Vector< T >::begin(), 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 MapArrayFunc >
template<typename T >
void skepu::MapArray< MapArrayFunc >::CL ( Vector< T > &  input1,
Matrix< T > &  input2,
Matrix< T > &  output,
int  useNumGPU = 1 
)

Performs the MapArray on the one vector and one matrix with OpenCL as backend. Separate output matrix. The vector can be accessed entirely for each element in the matrix.

Parameters
input1A vector which the mapping will be performed on.
input2A matrix which the mapping will be performed on.
outputThe result matrix, will be overwritten with the result and resized if needed.
useNumGPUInteger specifying how many devices to use. 0 = Implementation decides.

References skepu::Matrix< T >::at(), skepu::DeviceMemPointer_CL< T >::getDeviceDataPointer(), MAX_GPU_DEVICES, skepu::printCLError(), skepu::Vector< T >::size(), and skepu::Vector< T >::updateDevice_CL().

Here is the call graph for this function:

template<typename MapArrayFunc >
template<typename T >
void skepu::MapArray< MapArrayFunc >::CL ( Vector< T > &  input1,
Matrix< T > &  input2,
Vector< T > &  output,
int  useNumGPU = 1 
)

Performs MapArray on the one vector and one matrix block-wise with OpenCL as backend. Seperate output vector is used. The Vector can be accessed entirely for "a block of elements" in the Matrix. The block-length is specified in the user-function.

Parameters
input1A vector which the mapping will be performed on.
input2A matrix which the mapping will be performed on.
outputThe result vector, will be overwritten with the result and resized if needed.
useNumGPUInteger specifying how many devices to use. 0 = Implementation decides.

References skepu::DeviceMemPointer_CL< T >::changeDeviceData(), skepu::Vector< T >::clear(), skepu::DeviceMemPointer_CL< T >::getDeviceDataPointer(), skepu::max(), MAX_GPU_DEVICES, skepu::min(), skepu::printCLError(), skepu::Vector< T >::resize(), skepu::Vector< T >::size(), and skepu::Vector< T >::updateDevice_CL().

Here is the call graph for this function:

template<typename MapArrayFunc >
template<typename T >
void skepu::MapArray< MapArrayFunc >::CL ( Vector< T > &  input1,
SparseMatrix< T > &  input2,
Vector< T > &  output,
int  useNumGPU = 1 
)

Performs MapArray on the one vector and one matrix block-wise with OpenCL as backend. Seperate output vector is used. The Vector can be accessed entirely for "a block of elements" in the Matrix. The block-length is specified in the user-function.

Parameters
input1A vector which the mapping will be performed on.
input2A matrix which the mapping will be performed on.
outputThe result vector, will be overwritten with the result and resized if needed.
useNumGPUInteger specifying how many devices to use. 0 = Implementation decides.

References skepu::DeviceMemPointer_CL< T >::changeDeviceData(), skepu::Vector< T >::clear(), skepu::SparseMatrix< T >::get_values(), skepu::DeviceMemPointer_CL< T >::getDeviceDataPointer(), skepu::max(), MAX_GPU_DEVICES, skepu::min(), skepu::printCLError(), skepu::Vector< T >::resize(), skepu::Vector< T >::size(), skepu::SparseMatrix< T >::total_cols(), skepu::SparseMatrix< T >::total_rows(), skepu::Vector< T >::updateDevice_CL(), skepu::SparseMatrix< T >::updateDevice_CL(), and skepu::SparseMatrix< T >::updateDevice_Index_CL().

Here is the call graph for this function:

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

Performs the MapArray on the two element ranges with OpenCL as backend. Seperate output range. First range can be accessed entirely for each element in second range. Calls mapArrayNumDevices_CL(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, OutputIterator outputBegin, size_t numDevices).

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.
outputBeginAn iterator to the first element of the output range.
useNumGPUInteger specifying how many devices to use. 0 = Implementation decides.
template<typename MapArrayFunc >
template<typename in , typename out >
void skepu::MapArray< MapArrayFunc >::CPU ( Vector< in > &  input,
MultiVector  P,
Vector< out > &  output 
)

Performs MapArray using the MultiVector structure on the CPU.

Parameters
inputA vector which the mapping will be performed on
PA MultiVector containing multiple read-only input vectors.
outputThe result vector, will be overwritten with the result.

References skepu::Vector< T >::invalidateDeviceData(), skepu::Vector< T >::size(), and skepu::Vector< T >::updateHost().

Referenced by skepu::cpu_tune_wrapper_maparray().

Here is the call graph for this function:

template<typename MapArrayFunc >
template<typename T >
void skepu::MapArray< MapArrayFunc >::CPU ( Vector< T > &  input1,
Vector< T > &  input2,
Vector< T > &  output 
)

Performs MapArray with the two vectors on the CPU. Seperate output is used. First Vector can be accessed entirely for each element in second Vector. The function is a wrapper for CPU(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, OutputIterator outputBegin).

Parameters
input1A vector which the mapping will be performed on.
input2A vector which the mapping will be performed on.
outputThe 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::Vector< T >::resize(), and skepu::Vector< T >::size().

Here is the call graph for this function:

template<typename MapArrayFunc >
template<typename T >
void skepu::MapArray< MapArrayFunc >::CPU ( Vector< T > &  input1,
Matrix< T > &  input2,
Matrix< T > &  output 
)

Performs MapArray with the one vector and one matrix on the CPU. Seperate output is used. The Vector can be accessed entirely for each element in Matrix.

Parameters
input1A vector which the mapping will be performed on.
input2A matrix which the mapping will be performed on.
outputThe result matrix, will be overwritten with the result and resized if needed.

References skepu::Vector< T >::updateHost().

Here is the call graph for this function:

template<typename MapArrayFunc >
template<typename T >
void skepu::MapArray< MapArrayFunc >::CPU ( Vector< T > &  input1,
Matrix< T > &  input2,
Vector< T > &  output 
)

Performs MapArray on the one vector and one matrix block-wise with CPU as backend. Seperate output vector is used. The Vector can be accessed entirely for "a block of elements" in the Matrix. The block-length is specified in the user-function.

Parameters
input1A vector which the mapping will be performed on.
input2A matrix which the mapping will be performed on.
outputThe result vector, will be overwritten with the result and resized if needed.

References skepu::Vector< T >::clear(), skepu::Vector< T >::invalidateDeviceData(), skepu::Vector< T >::resize(), skepu::Vector< T >::size(), and skepu::Vector< T >::updateHost().

Here is the call graph for this function:

template<typename MapArrayFunc >
template<typename T >
void skepu::MapArray< MapArrayFunc >::CPU ( Vector< T > &  input1,
SparseMatrix< T > &  input2,
Vector< T > &  output 
)

Performs MapArray on the one vector and one sparse matrix block-wise with CPU as backend. Seperate output vector is used. The Vector can be accessed entirely for "a block of elements" in the SparseMatrix. The block-length is specified in the user-function.

Parameters
input1A vector which the mapping will be performed on.
input2A sparse matrix which the mapping will be performed on.
outputThe result vector, will be overwritten with the result and resized if needed.

References skepu::Vector< T >::clear(), skepu::SparseMatrix< T >::get_values(), skepu::Vector< T >::invalidateDeviceData(), skepu::Vector< T >::resize(), skepu::Vector< T >::size(), skepu::SparseMatrix< T >::total_cols(), skepu::SparseMatrix< T >::total_nnz(), skepu::SparseMatrix< T >::total_rows(), skepu::Vector< T >::updateHost(), and skepu::SparseMatrix< T >::updateHost().

Here is the call graph for this function:

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

Performs the MapArray with the two element ranges on the CPU. Seperate output range is used. First range can be accessed entirely for each element in second range. The computation is done by iterating over all the elements in the ranges and applying the user function on each of them.

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.
outputBeginAn iterator to the first element of the output range.
template<typename MapArrayFunc >
template<typename in , typename out >
void skepu::MapArray< MapArrayFunc >::CU ( Vector< in > &  input,
MultiVector  P,
Vector< out > &  output,
int  useNumGPU = 1 
)
template<typename MapArrayFunc >
template<typename InputIterator , typename OutputIterator >
void skepu::MapArray< MapArrayFunc >::CU ( InputIterator  inputBegin,
InputIterator  inputEnd,
MultiVector  P,
OutputIterator  outputBegin,
int  useNumGPU = 1 
)

performs maparray for arbitrary number of read only inputs, every element of these read only inputs can be accessed for each element of the indexing input.

Parameters
inputBeginAn iterator to the first element of the indexing input
inputEndAn iterator to the last element of the indexing input
PThe MultiVector structure containing read-only inputs
outputBeginAn iterator to the first element of the output vector
useNumGPUInteger specifying how many devices to use. 0 = Implementation decides.

References skepu::max(), MAX_GPU_DEVICES, and skepu::min().

Here is the call graph for this function:

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

Performs the MapArray on the two vectors with CUDA as backend. Seperate output vector. First Vector can be accessed entirely for each element in second Vector. The function is a wrapper for CU(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, OutputIterator outputBegin, int useNumGPU).

Parameters
input1A vector which the mapping will be performed on.
input2A vector which the mapping will be performed on.
outputThe result vector, will be overwritten with the result and resized if needed.
useNumGPUInteger specifying how many devices to use. 0 = Implementation decides.

References skepu::Vector< T >::begin(), 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 MapArrayFunc >
template<typename T >
void skepu::MapArray< MapArrayFunc >::CU ( Vector< T > &  input1,
Matrix< T > &  input2,
Matrix< T > &  output,
int  useNumGPU = 1 
)

Performs the MapArray on the one vector and one matrix with CUDA as backend. Seperate output matrix. The vector can be accessed entirely for each element in the matrix. If USE_PINNED_MEMORY is defined, HtD transfers and Kernel execution are splitted across multiple CUDA Streams to achieve overlap.

Parameters
input1A vector which the mapping will be performed on.
input2A matrix which the mapping will be performed on.
outputThe result matrix, will be overwritten with the result and resized if needed.
useNumGPUInteger specifying how many devices to use. 0 = Implementation decides.

References skepu::DeviceMemPointer_CU< T >::getDeviceDataPointer(), skepu::MapArrayKernel_CU_Matrix(), MAX_GPU_DEVICES, skepu::Vector< T >::size(), and skepu::Vector< T >::updateDevice_CU().

Here is the call graph for this function:

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

Performs MapArray on the one vector and one matrix block-wise with CUDA as backend. Seperate output vector is used. The Vector can be accessed entirely for "a block of elements" in the Matrix. The block-length is specified in the user-function. If USE_PINNED_MEMORY is defined, HtD transfers and Kernel execution are splitted across multiple CUDA Streams to achieve overlap.

Parameters
input1A vector which the mapping will be performed on.
input2A matrix which the mapping will be performed on.
outputThe result vector, will be overwritten with the result and resized if needed.
useNumGPUInteger specifying how many devices to use. 0 = Implementation decides.

References skepu::DeviceMemPointer_CU< T >::changeDeviceData(), skepu::Vector< T >::clear(), skepu::DeviceMemPointer_CU< T >::getDeviceDataPointer(), skepu::MapArrayKernel_CU_Matrix_Blockwise(), skepu::max(), MAX_GPU_DEVICES, skepu::min(), skepu::Vector< T >::resize(), skepu::Vector< T >::size(), and skepu::Vector< T >::updateDevice_CU().

Here is the call graph for this function:

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

Performs MapArray on the one vector and one sparse matrix block-wise with CUDA as backend. Seperate output vector is used. The Vector can be accessed entirely for "a block of elements" in the SparseMatrix. The block-length is specified in the user-function.

Parameters
input1A vector which the mapping will be performed on.
input2A sparse matrix which the mapping will be performed on.
outputThe result vector, will be overwritten with the result and resized if needed.
useNumGPUInteger specifying how many devices to use. 0 = Implementation decides.

References skepu::DeviceMemPointer_CU< T >::changeDeviceData(), skepu::Vector< T >::clear(), skepu::SparseMatrix< T >::get_values(), skepu::DeviceMemPointer_CU< T >::getDeviceDataPointer(), skepu::MapArrayKernel_CU_Sparse_Matrix_Blockwise(), skepu::max(), MAX_GPU_DEVICES, skepu::min(), skepu::Vector< T >::resize(), skepu::Vector< T >::size(), skepu::SparseMatrix< T >::total_cols(), skepu::SparseMatrix< T >::total_nnz(), skepu::SparseMatrix< T >::total_rows(), skepu::Vector< T >::updateDevice_CU(), skepu::SparseMatrix< T >::updateDevice_CU(), and skepu::SparseMatrix< T >::updateDevice_Index_CU().

Here is the call graph for this function:

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

Performs the MapArray on the two element ranges with CUDA as backend. Seperate output range. Decides whether to use one device and mapArraySingleThread_CU or multiple devices. In the case of several devices the input ranges is divided evenly among the threads created. First range can be accessed entirely for each element in second 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.
outputBeginAn iterator to the first element of the output range.
useNumGPUInteger specifying how many devices to use. 0 = Implementation decides.

References skepu::MapArrayKernel_CU(), skepu::max(), MAX_GPU_DEVICES, and skepu::min().

Here is the call graph for this function:

template<typename MapArrayFunc >
template<typename in , typename out >
void skepu::MapArray< MapArrayFunc >::OMP ( Vector< in > &  input,
MultiVector  P,
Vector< out > &  output 
)
template<typename MapArrayFunc >
template<typename InputIterator , typename OutputIterator >
void skepu::MapArray< MapArrayFunc >::OMP ( InputIterator  inputBegin,
InputIterator  inputEnd,
MultiVector  P,
OutputIterator  outputBegin 
)

Performs MapArray using the MultiVector structure with OpenMP as backend.

Parameters
inputBeginiterator to the start of the vector the mapping will be performed on
inputEnditerator to the end of the vector the mapping will be performed on
PA MultiVector containing multiple read-only input vectors.
outputBeginiterator to the start of the result vector, will be overwritten with the result.
template<typename MapArrayFunc >
template<typename T >
void skepu::MapArray< MapArrayFunc >::OMP ( Vector< T > &  input1,
Vector< T > &  input2,
Vector< T > &  output 
)

Performs MapArray on the two vectors with OpenMP as backend. Seperate output is used. First Vector can be accessed entirely for each element in second Vector. The function is a wrapper for OMP(Input1Iterator input1Begin, Input1Iterator input1End, Input2Iterator input2Begin, Input2Iterator input2End, OutputIterator outputBegin).

Parameters
input1A vector which the mapping will be performed on.
input2A vector which the mapping will be performed on.
outputThe 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::Vector< T >::resize(), and skepu::Vector< T >::size().

Here is the call graph for this function:

template<typename MapArrayFunc >
template<typename T >
void skepu::MapArray< MapArrayFunc >::OMP ( Vector< T > &  input1,
Matrix< T > &  input2,
Matrix< T > &  output 
)

Performs MapArray on the one vector and one matrix with OpenMP as backend. Seperate output matrix is used. The Vector can be accessed entirely for each element in the Matrix.

Parameters
input1A vector which the mapping will be performed on.
input2A matrix which the mapping will be performed on.
outputThe result matrix, will be overwritten with the result and resized if needed.

References skepu::Vector< T >::updateHost().

Here is the call graph for this function:

template<typename MapArrayFunc >
template<typename T >
void skepu::MapArray< MapArrayFunc >::OMP ( Vector< T > &  input1,
Matrix< T > &  input2,
Vector< T > &  output 
)

Performs MapArray on the one vector and one matrix block-wise with OpenMP as backend. Seperate output vector is used. The Vector can be accessed entirely for "a block of elements" in the Matrix. The block-length is specified in the user-function.

Parameters
input1A vector which the mapping will be performed on.
input2A matrix which the mapping will be performed on.
outputThe result vector, will be overwritten with the result and resized if needed.

References skepu::Vector< T >::clear(), skepu::Vector< T >::invalidateDeviceData(), skepu::Vector< T >::resize(), skepu::Vector< T >::size(), and skepu::Vector< T >::updateHost().

Here is the call graph for this function:

template<typename MapArrayFunc >
template<typename T >
void skepu::MapArray< MapArrayFunc >::OMP ( Vector< T > &  input1,
SparseMatrix< T > &  input2,
Vector< T > &  output 
)

Performs MapArray on the one vector and one sparse matrix block-wise with OpenMP as backend. Seperate output vector is used. The Vector can be accessed entirely for "a block of elements" in the SparseMatrix. The block-length is specified in the user-function.

Parameters
input1A vector which the mapping will be performed on.
input2A sparse matrix which the mapping will be performed on.
outputThe result vector, will be overwritten with the result and resized if needed.

References skepu::Vector< T >::clear(), skepu::SparseMatrix< T >::get_values(), skepu::Vector< T >::invalidateDeviceData(), skepu::Vector< T >::resize(), skepu::Vector< T >::size(), skepu::SparseMatrix< T >::total_cols(), skepu::SparseMatrix< T >::total_nnz(), skepu::SparseMatrix< T >::total_rows(), skepu::Vector< T >::updateHost(), and skepu::SparseMatrix< T >::updateHost().

Here is the call graph for this function:

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

Performs MapArray on the two vectors with OpenMP as backend. Seperate output range is used. First range can be accessed entirely for each element in second range. The computation is done by iterating over all the elements in the ranges and applying the user function on each of them. Elements are divided among threads automatically by OpenMP.

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.
outputBeginAn iterator to the first element of the output range.
template<typename MapArrayFunc >
template<typename T >
void skepu::MapArray< MapArrayFunc >::operator() ( Vector< T > &  input1,
Vector< T > &  input2,
Vector< T > &  output,
int  groupId = -1 
)

Performs the MapArray on the two Vectors specified. A seperate output vector is used.

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
input1First vector, which can be accessed entirely for each element in second vector.
input2Second vector, each value of this vector can be mapped to several values from first Vector.
outputThe result vector, will be overwritten with the result and resized if needed.

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 MapArrayFunc >
template<typename T >
void skepu::MapArray< MapArrayFunc >::operator() ( Vector< T > &  input1,
Matrix< T > &  input2,
Matrix< T > &  output 
)

Performs the MapArray on the one vector and matrix specified. A seperate output matrix is used.

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
input1First vector, which can be accessed entirely for each element in second vector.
input2Second matrix, each value of this matrix can be mapped to several values from first Vector.
outputThe result matrix, will be overwritten with the result and resized if needed.

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 MapArrayFunc >
template<typename T >
void skepu::MapArray< MapArrayFunc >::operator() ( Vector< T > &  input1,
Matrix< T > &  input2,
Vector< T > &  output 
)

Performs the MapArray block-wise on the one vector and matrix. A seperate output vector is used.

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 can be accessed entirely for each element in second vector.
input2A matrix, a set of values (blockLength specified in user function) of this matrix can be mapped to several values from first Vector.
outputThe result vector, will be overwritten with the result and resized if needed.

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 MapArrayFunc >
template<typename T >
void skepu::MapArray< MapArrayFunc >::operator() ( Vector< T > &  input1,
SparseMatrix< T > &  input2,
Vector< T > &  output 
)

Performs the MapArray block-wise on the one vector and a sparse matrix. A seperate output vector is used.

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 can be accessed entirely for each element in second vector.
input2A sparse matrix, a set of values (blockLength specified in user function) of this matrix can be mapped to several values from first Vector.
outputThe result vector, will be overwritten with the result and resized if needed.

both are on GPU...

one of them is on GPU...

nothing is on GPU...

References skepu::Vector< T >::isModified_CU(), skepu::SparseMatrix< T >::isModified_CU(), skepu::SparseMatrix< T >::isSparseMatrixOnDevice_CU(), skepu::Vector< T >::isVectorOnDevice_CU(), and skepu::Vector< T >::size().

Here is the call graph for this function:

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

Performs the MapArray on the two element ranges specified. A seperate output range is used. First range can be accessed entirely for each element in second range.

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
input1BeginA Vector::iterator to the first element in the first range.
input1EndA Vector::iterator to the last element of the first range.
input2BeginA Vector::iterator to the first element in the second range.
input2EndA Vector::iterator to the last element of the second range.
outputBeginA Vector::iterator to the first element of the output range.
template<typename MapArrayFunc>
template<typename U >
void skepu::MapArray< MapArrayFunc >::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: