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) |
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.
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.
mapArrayFunc | A pointer to a valid array user function. Will be deleted in the destructor. |
References skepu::Environment< T >::getInstance().
skepu::MapArray< MapArrayFunc >::~MapArray | ( | ) |
When the MapArray skeleton is destroyed, it deletes the user function it was created with.
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).
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::Vector< T >::end(), skepu::Vector< T >::resize(), and skepu::Vector< T >::size().
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.
input1 | A vector which the mapping will be performed on. |
input2 | A matrix which the mapping will be performed on. |
output | The result matrix, will be overwritten with the result and resized if needed. |
useNumGPU | Integer 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().
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.
input1 | A vector which the mapping will be performed on. |
input2 | A matrix 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::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().
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.
input1 | A vector which the mapping will be performed on. |
input2 | A matrix 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::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().
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).
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. |
outputBegin | An iterator to the first element of the output range. |
useNumGPU | Integer specifying how many devices to use. 0 = Implementation decides. |
void skepu::MapArray< MapArrayFunc >::CPU | ( | Vector< in > & | input, |
MultiVector | P, | ||
Vector< out > & | output | ||
) |
Performs MapArray using the MultiVector structure on the CPU.
input | A vector which the mapping will be performed on |
P | A MultiVector containing multiple read-only input vectors. |
output | The 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().
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).
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::Vector< T >::resize(), and skepu::Vector< T >::size().
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.
input1 | A vector which the mapping will be performed on. |
input2 | A matrix which the mapping will be performed on. |
output | The result matrix, will be overwritten with the result and resized if needed. |
References skepu::Vector< T >::updateHost().
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.
input1 | A vector which the mapping will be performed on. |
input2 | A matrix 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 >::clear(), skepu::Vector< T >::invalidateDeviceData(), skepu::Vector< T >::resize(), skepu::Vector< T >::size(), and skepu::Vector< T >::updateHost().
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.
input1 | A vector which the mapping will be performed on. |
input2 | A sparse matrix 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 >::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().
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.
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. |
outputBegin | An iterator to the first element of the output range. |
void skepu::MapArray< MapArrayFunc >::CU | ( | Vector< in > & | input, |
MultiVector | P, | ||
Vector< out > & | output, | ||
int | useNumGPU = 1 |
||
) |
References skepu::Vector< T >::begin(), and skepu::Vector< T >::end().
Referenced by skepu::cuda_tune_wrapper_maparray().
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.
inputBegin | An iterator to the first element of the indexing input |
inputEnd | An iterator to the last element of the indexing input |
P | The MultiVector structure containing read-only inputs |
outputBegin | An iterator to the first element of the output vector |
useNumGPU | Integer specifying how many devices to use. 0 = Implementation decides. |
References skepu::max(), MAX_GPU_DEVICES, and skepu::min().
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).
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::Vector< T >::end(), skepu::Vector< T >::resize(), and skepu::Vector< T >::size().
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.
input1 | A vector which the mapping will be performed on. |
input2 | A matrix which the mapping will be performed on. |
output | The result matrix, will be overwritten with the result and resized if needed. |
useNumGPU | Integer 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().
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.
input1 | A vector which the mapping will be performed on. |
input2 | A matrix 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::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().
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.
input1 | A vector which the mapping will be performed on. |
input2 | A sparse matrix 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::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().
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.
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. |
outputBegin | An iterator to the first element of the output range. |
useNumGPU | Integer specifying how many devices to use. 0 = Implementation decides. |
References skepu::MapArrayKernel_CU(), skepu::max(), MAX_GPU_DEVICES, and skepu::min().
void skepu::MapArray< MapArrayFunc >::OMP | ( | Vector< in > & | input, |
MultiVector | P, | ||
Vector< out > & | output | ||
) |
wrapper for OMP(InputIterator inputBegin, InputIterator inputEnd, MultiVector P, OutputIterator outputBegin)
References skepu::Vector< T >::begin(), and skepu::Vector< T >::end().
Referenced by skepu::omp_tune_wrapper_maparray().
void skepu::MapArray< MapArrayFunc >::OMP | ( | InputIterator | inputBegin, |
InputIterator | inputEnd, | ||
MultiVector | P, | ||
OutputIterator | outputBegin | ||
) |
Performs MapArray using the MultiVector structure with OpenMP as backend.
inputBegin | iterator to the start of the vector the mapping will be performed on |
inputEnd | iterator to the end of the vector the mapping will be performed on |
P | A MultiVector containing multiple read-only input vectors. |
outputBegin | iterator to the start of the result vector, will be overwritten with the result. |
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).
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::Vector< T >::resize(), and skepu::Vector< T >::size().
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.
input1 | A vector which the mapping will be performed on. |
input2 | A matrix which the mapping will be performed on. |
output | The result matrix, will be overwritten with the result and resized if needed. |
References skepu::Vector< T >::updateHost().
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.
input1 | A vector which the mapping will be performed on. |
input2 | A matrix 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 >::clear(), skepu::Vector< T >::invalidateDeviceData(), skepu::Vector< T >::resize(), skepu::Vector< T >::size(), and skepu::Vector< T >::updateHost().
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.
input1 | A vector which the mapping will be performed on. |
input2 | A sparse matrix 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 >::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().
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.
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. |
outputBegin | An iterator to the first element of the output range. |
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.
input1 | First vector, which can be accessed entirely for each element in second vector. |
input2 | Second vector, each value of this vector can be mapped to several values from first Vector. |
output | The 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().
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.
input1 | First vector, which can be accessed entirely for each element in second vector. |
input2 | Second matrix, each value of this matrix can be mapped to several values from first Vector. |
output | The 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().
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.
input1 | A vector, which can be accessed entirely for each element in second vector. |
input2 | A matrix, a set of values (blockLength specified in user function) of this matrix can be mapped to several values from first Vector. |
output | The 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().
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.
input1 | A vector, which can be accessed entirely for each element in second vector. |
input2 | A sparse matrix, a set of values (blockLength specified in user function) of this matrix can be mapped to several values from first Vector. |
output | The 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().
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.
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. |
|
inline |
If the Mapping function supports a constant, set it with this function before a call.