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

A class representing the Scan skeleton. More...

#include <scan.h>

Public Member Functions

 Scan (ScanFunc *scanFunc)
 
 ~Scan ()
 
template<typename T >
void operator() (Vector< T > &input, ScanType type, T init=T())
 
template<typename T >
void operator() (Matrix< T > &input, ScanType type, T init=T())
 
template<typename InputIterator >
void operator() (InputIterator inputBegin, InputIterator inputEnd, ScanType type, typename InputIterator::value_type init=typename InputIterator::value_type())
 
template<typename T >
void operator() (Vector< T > &input, Vector< T > &output, ScanType type, T init=T())
 
template<typename T >
void operator() (Matrix< T > &input, Matrix< T > &output, ScanType type, T init=T())
 
template<typename InputIterator , typename OutputIterator >
void operator() (InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin, ScanType type, typename InputIterator::value_type init=typename InputIterator::value_type())
 
template<typename T >
void CPU (Vector< T > &input, ScanType type=INCLUSIVE, T init=T())
 
template<typename T >
void CPU (Matrix< T > &input, ScanType type, T init=T())
 
template<typename InputIterator >
void CPU (InputIterator inputBegin, InputIterator inputEnd, ScanType type=INCLUSIVE, typename InputIterator::value_type init=typename InputIterator::value_type())
 
template<typename T >
void CPU (Vector< T > &input, Vector< T > &output, ScanType type=INCLUSIVE, T init=T())
 
template<typename T >
void CPU (Matrix< T > &input, Matrix< T > &output, ScanType type, T init=T())
 
template<typename InputIterator , typename OutputIterator >
void CPU (InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin, ScanType type=INCLUSIVE, typename InputIterator::value_type init=typename InputIterator::value_type())
 
template<typename T >
void OMP (Vector< T > &input, ScanType type=INCLUSIVE, T init=T())
 
template<typename T >
void OMP (Matrix< T > &input, ScanType type, T init=T())
 
template<typename InputIterator >
void OMP (InputIterator inputBegin, InputIterator inputEnd, ScanType type=INCLUSIVE, typename InputIterator::value_type init=typename InputIterator::value_type())
 
template<typename T >
void OMP (Vector< T > &input, Vector< T > &output, ScanType type=INCLUSIVE, T init=T())
 
template<typename T >
void OMP (Matrix< T > &input, Matrix< T > &output, ScanType type, T init=T())
 
template<typename InputIterator , typename OutputIterator >
void OMP (InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin, ScanType type=INCLUSIVE, typename InputIterator::value_type init=typename InputIterator::value_type())
 
template<typename T >
void CU (Vector< T > &input, ScanType type=INCLUSIVE, T init=T(), int useNumGPU=1)
 
template<typename InputIterator >
void CU (InputIterator inputBegin, InputIterator inputEnd, ScanType type=INCLUSIVE, typename InputIterator::value_type init=typename InputIterator::value_type(), int useNumGPU=1)
 
template<typename T >
void CU (Vector< T > &input, Vector< T > &output, ScanType type=INCLUSIVE, T init=T(), int useNumGPU=1)
 
template<typename InputIterator , typename OutputIterator >
void CU (InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin, ScanType type=INCLUSIVE, typename InputIterator::value_type init=typename InputIterator::value_type(), int useNumGPU=1)
 
template<typename T >
void CL (Vector< T > &input, ScanType type=INCLUSIVE, T init=T(), int useNumGPU=1)
 
template<typename InputIterator >
void CL (InputIterator inputBegin, InputIterator inputEnd, ScanType type=INCLUSIVE, typename InputIterator::value_type init=typename InputIterator::value_type(), int useNumGPU=1)
 
template<typename T >
void CL (Vector< T > &input, Vector< T > &output, ScanType type=INCLUSIVE, T init=T(), int useNumGPU=1)
 
template<typename InputIterator , typename OutputIterator >
void CL (InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin, ScanType type=INCLUSIVE, typename InputIterator::value_type init=typename InputIterator::value_type(), int useNumGPU=1)
 

Detailed Description

template<typename ScanFunc>
class skepu::Scan< ScanFunc >

A class representing the Scan skeleton.

This class defines the Scan skeleton, also known as prefix sum. It is related to the Scan operation but instead of producing a single scalar result it produces an output vector of the same length as the input with its elements being the reduction of itself all elements preceding it in the input. For example the input vector [4 3 7 6 9] would produce the result vector [4 7 14 20 29]. The Scan operation can either include or exclude the current element. It can be either inclusive or exclusive. In the previous example a inclusive scan was performed, the exclusive result would be [0 4 7 14 20]. Exclusive scan is sometimes called prescan. This Scan skeleton supports both variants by adding a parameter to the function calls, default is inclusive.

Once instantiated, it is meant to be used as a function and therefore overloading operator(). There are a few overloaded variants of this operator depending on if a seperate output vector is provided or if vectors or iterators are used 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 Scan skeleton also includes a pointer to an Environment which, in turn, includes the devices available to execute on.

Constructor & Destructor Documentation

template<typename ScanFunc >
skepu::Scan< ScanFunc >::Scan ( ScanFunc *  scanFunc)

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

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

Here is the call graph for this function:

template<typename ScanFunc >
skepu::Scan< ScanFunc >::~Scan ( )

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

Member Function Documentation

template<typename ScanFunc >
template<typename T >
void skepu::Scan< ScanFunc >::CL ( Vector< T > &  input,
ScanType  type = INCLUSIVE,
init = T(),
int  useNumGPU = 1 
)

Performs the Scan on a whole Vector using OpenCL with the input as output. A wrapper for CL(InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin, ScanType type, typename InputIterator::value_type init, int useNumGPU).

Parameters
inputA vector which will be scanned. It will be overwritten with the result.
typeThe scan type, either INCLUSIVE or EXCLUSIVE.
initThe initialization value for exclusive scans.
useNumGPUInteger 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 ScanFunc >
template<typename InputIterator >
void skepu::Scan< ScanFunc >::CL ( InputIterator  inputBegin,
InputIterator  inputEnd,
ScanType  type = INCLUSIVE,
typename InputIterator::value_type  init = typename InputIterator::value_type(),
int  useNumGPU = 1 
)

Performs the Scan on an input range using OpenCL with the input range also used as an output. A wrapper for CL(InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin, ScanType type, typename InputIterator::value_type init, int useNumGPU).

Parameters
inputBeginA Vector::iterator to the first element in the range.
inputEndA Vector::iterator to the last element of the range.
typeThe scan type, either INCLUSIVE or EXCLUSIVE.
initThe initialization value for exclusive scans.
useNumGPUInteger specifying how many devices to use. 0 = Implementation decides.
template<typename ScanFunc >
template<typename T >
void skepu::Scan< ScanFunc >::CL ( Vector< T > &  input,
Vector< T > &  output,
ScanType  type = INCLUSIVE,
init = T(),
int  useNumGPU = 1 
)

Performs the Scan on a whole Vector using OpenCL with a separate Vector as output. The output Vector will be resized an overwritten. A wrapper for CL(InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin, ScanType type, typename InputIterator::value_type init, int useNumGPU).

Parameters
inputA vector which will be scanned.
outputThe result vector, will be overwritten with the result and resized if needed.
typeThe scan type, either INCLUSIVE or EXCLUSIVE.
initThe initialization value for exclusive scans.
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 ScanFunc >
template<typename InputIterator , typename OutputIterator >
void skepu::Scan< ScanFunc >::CL ( InputIterator  inputBegin,
InputIterator  inputEnd,
OutputIterator  outputBegin,
ScanType  type = INCLUSIVE,
typename InputIterator::value_type  init = typename InputIterator::value_type(),
int  useNumGPU = 1 
)

Performs the Scan on a range of elements. Returns a scalar result. The function decides whether to perform the reduction on one device, calling scanSingle_CL or on multiple devices, calling scanNumDevices_CL. Using OpenCL as backend.

Parameters
inputBeginA Vector::iterator to the first element in the range.
inputEndA Vector::iterator to the last element of the range.
outputBeginA Vector::iterator to the first element of the output range.
typeThe scan type, either INCLUSIVE or EXCLUSIVE.
initThe initialization value for exclusive scans.
useNumGPUInteger specifying how many devices to use. 0 = Implementation decides.
template<typename ScanFunc >
template<typename T >
void skepu::Scan< ScanFunc >::CPU ( Vector< T > &  input,
ScanType  type = INCLUSIVE,
init = T() 
)

Performs the Scan on a whole Vector on the CPU with itself as output. A wrapper for CPU(InputIterator inputBegin, InputIterator inputEnd, ScanType type, typename InputIterator::value_type init).

Parameters
inputA vector which will be scanned. It will be overwritten with the result.
typeThe scan type, either INCLUSIVE or EXCLUSIVE.
initThe initialization value for exclusive scans.

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

Here is the call graph for this function:

template<typename ScanFunc >
template<typename T >
void skepu::Scan< ScanFunc >::CPU ( Matrix< T > &  input,
ScanType  type,
init = T() 
)

Performs the row-wise Scan on a whole Matrix on the CPU with itself as output.

Parameters
inputA matrix which will be scanned. It will be overwritten with the result.
typeThe scan type, either INCLUSIVE or EXCLUSIVE.
initThe initialization value for exclusive scans.
template<typename ScanFunc >
template<typename InputIterator >
void skepu::Scan< ScanFunc >::CPU ( InputIterator  inputBegin,
InputIterator  inputEnd,
ScanType  type = INCLUSIVE,
typename InputIterator::value_type  init = typename InputIterator::value_type() 
)

Performs the Scan on a range of elements on the CPU with the same range as output.

Parameters
inputBeginA Vector::iterator to the first element in the range.
inputEndA Vector::iterator to the last element of the range.
typeThe scan type, either INCLUSIVE or EXCLUSIVE.
initThe initialization value for exclusive scans.
template<typename ScanFunc >
template<typename T >
void skepu::Scan< ScanFunc >::CPU ( Vector< T > &  input,
Vector< T > &  output,
ScanType  type = INCLUSIVE,
init = T() 
)

Performs the Scan on a whole Vector on the CPU with a seperate output vector. Wrapper for CPU(InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin, ScanType type, typename InputIterator::value_type init).

Parameters
inputA vector which will be scanned.
outputThe result vector, will be overwritten with the result and resized if needed.
typeThe scan type, either INCLUSIVE or EXCLUSIVE.
initThe initialization value for exclusive scans.

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 ScanFunc >
template<typename T >
void skepu::Scan< ScanFunc >::CPU ( Matrix< T > &  input,
Matrix< T > &  output,
ScanType  type,
init = T() 
)

Performs the row-wise Scan on a whole Matrix on the CPU with a separate Matrix as output.

Parameters
inputA matrix which will be scanned.
outputThe result matrix, will be overwritten with the result and resized if needed.
typeThe scan type, either INCLUSIVE or EXCLUSIVE.
initThe initialization value for exclusive scans.
template<typename ScanFunc >
template<typename InputIterator , typename OutputIterator >
void skepu::Scan< ScanFunc >::CPU ( InputIterator  inputBegin,
InputIterator  inputEnd,
OutputIterator  outputBegin,
ScanType  type = INCLUSIVE,
typename InputIterator::value_type  init = typename InputIterator::value_type() 
)

Performs the Scan on a range of elements on the CPU with a seperate output range.

Parameters
inputBeginA Vector::iterator to the first element in the range.
inputEndA Vector::iterator to the last element of the range.
outputBeginA Vector::iterator to the first element of the output range.
typeThe scan type, either INCLUSIVE or EXCLUSIVE.
initThe initialization value for exclusive scans.
template<typename ScanFunc >
template<typename T >
void skepu::Scan< ScanFunc >::CU ( Vector< T > &  input,
ScanType  type = INCLUSIVE,
init = T(),
int  useNumGPU = 1 
)

Performs the Scan on a whole Vector using CUDA with the input as output. A wrapper for CU(InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin, ScanType type, typename InputIterator::value_type init, int useNumGPU).

Parameters
inputA vector which will be scanned. It will be overwritten with the result.
typeThe scan type, either INCLUSIVE or EXCLUSIVE.
initThe initialization value for exclusive scans.
useNumGPUInteger 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 ScanFunc >
template<typename InputIterator >
void skepu::Scan< ScanFunc >::CU ( InputIterator  inputBegin,
InputIterator  inputEnd,
ScanType  type = INCLUSIVE,
typename InputIterator::value_type  init = typename InputIterator::value_type(),
int  useNumGPU = 1 
)

Performs the Scan on an input range using CUDA with the input range also used as an output. A wrapper for CU(InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin, ScanType type, typename InputIterator::value_type init, int useNumGPU).

Parameters
inputBeginA Vector::iterator to the first element in the range.
inputEndA Vector::iterator to the last element of the range.
typeThe scan type, either INCLUSIVE or EXCLUSIVE.
initThe initialization value for exclusive scans.
useNumGPUInteger specifying how many devices to use. 0 = Implementation decides.
template<typename ScanFunc >
template<typename T >
void skepu::Scan< ScanFunc >::CU ( Vector< T > &  input,
Vector< T > &  output,
ScanType  type = INCLUSIVE,
init = T(),
int  useNumGPU = 1 
)

Performs the Scan on a whole Vector using CUDA with a separate Vector as output. The output Vector will be resized an overwritten. A wrapper for CU(InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin, ScanType type, typename InputIterator::value_type init, int useNumGPU).

Parameters
inputA vector which will be scanned.
outputThe result vector, will be overwritten with the result and resized if needed.
typeThe scan type, either INCLUSIVE or EXCLUSIVE.
initThe initialization value for exclusive scans.
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 ScanFunc >
template<typename InputIterator , typename OutputIterator >
void skepu::Scan< ScanFunc >::CU ( InputIterator  inputBegin,
InputIterator  inputEnd,
OutputIterator  outputBegin,
ScanType  type = INCLUSIVE,
typename InputIterator::value_type  init = typename InputIterator::value_type(),
int  useNumGPU = 1 
)

Performs the Scan on an input range using CUDA with a separate output range. The function decides whether to perform the scan on one device, calling scanSingleThread_CU or on multiple devices, dividing the work between multiple devices.

Parameters
inputBeginA Vector::iterator to the first element in the range.
inputEndA Vector::iterator to the last element of the range.
outputBeginA Vector::iterator to the first element of the output range.
typeThe scan type, either INCLUSIVE or EXCLUSIVE.
initThe initialization value for exclusive scans.
useNumGPUInteger specifying how many devices to use. 0 = Implementation decides.

References skepu::min(), skepu::Vector< T >::push_back(), skepu::ScanAdd_CU(), and skepu::scanLargeVectorRecursivelyM_CU().

Here is the call graph for this function:

template<typename ScanFunc >
template<typename T >
void skepu::Scan< ScanFunc >::OMP ( Vector< T > &  input,
ScanType  type = INCLUSIVE,
init = T() 
)

Performs the Scan on a whole Vector with itself as output using OpenMP as backend. A wrapper for OMP(InputIterator inputBegin, InputIterator inputEnd, ScanType type, typename InputIterator::value_type init).

Parameters
inputA vector which will be scanned. It will be overwritten with the result.
typeThe scan type, either INCLUSIVE or EXCLUSIVE.
initThe initialization value for exclusive scans.

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

Here is the call graph for this function:

template<typename ScanFunc >
template<typename T >
void skepu::Scan< ScanFunc >::OMP ( Matrix< T > &  input,
ScanType  type,
init = T() 
)

Performs the Scan on a whole Matrix with itself as output using OpenMP as backend.

Parameters
inputA matrix which will be scanned. It will be overwritten with the result.
typeThe scan type, either INCLUSIVE or EXCLUSIVE.
initThe initialization value for exclusive scans.
template<typename ScanFunc >
template<typename InputIterator >
void skepu::Scan< ScanFunc >::OMP ( InputIterator  inputBegin,
InputIterator  inputEnd,
ScanType  type = INCLUSIVE,
typename InputIterator::value_type  init = typename InputIterator::value_type() 
)

Performs the Scan on a range of elements with the same range as output using OpenMP as backend.

Parameters
inputBeginA Vector::iterator to the first element in the range.
inputEndA Vector::iterator to the last element of the range.
typeThe scan type, either INCLUSIVE or EXCLUSIVE.
initThe initialization value for exclusive scans.
template<typename ScanFunc >
template<typename T >
void skepu::Scan< ScanFunc >::OMP ( Vector< T > &  input,
Vector< T > &  output,
ScanType  type = INCLUSIVE,
init = T() 
)

Performs the Scan on a whole Vector with a seperate output vector using OpenMP as backend. Wrapper for OMP(InputIterator inputBegin, InputIterator inputEnd, OutputIterator outputBegin, ScanType type, typename InputIterator::value_type init).

Parameters
inputA vector which will be scanned.
outputThe result vector, will be overwritten with the result and resized if needed.
typeThe scan type, either INCLUSIVE or EXCLUSIVE.
initThe initialization value for exclusive scans.

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 ScanFunc >
template<typename T >
void skepu::Scan< ScanFunc >::OMP ( Matrix< T > &  input,
Matrix< T > &  output,
ScanType  type,
init = T() 
)

Performs the Scan on a whole Matrix with a separate Matrix as output using OpenMP as backend.

Parameters
inputA matrix which will be scanned.
outputThe result matrix, will be overwritten with the result and resized if needed.
typeThe scan type, either INCLUSIVE or EXCLUSIVE.
initThe initialization value for exclusive scans.
template<typename ScanFunc >
template<typename InputIterator , typename OutputIterator >
void skepu::Scan< ScanFunc >::OMP ( InputIterator  inputBegin,
InputIterator  inputEnd,
OutputIterator  outputBegin,
ScanType  type = INCLUSIVE,
typename InputIterator::value_type  init = typename InputIterator::value_type() 
)

Performs the Scan on a range of elements with a seperate output range using OpenMP as backend.

Parameters
inputBeginA Vector::iterator to the first element in the range.
inputEndA Vector::iterator to the last element of the range.
outputBeginA Vector::iterator to the first element of the output range.
typeThe scan type, either INCLUSIVE or EXCLUSIVE.
initThe initialization value for exclusive scans.
template<typename ScanFunc >
template<typename T >
void skepu::Scan< ScanFunc >::operator() ( Vector< T > &  input,
ScanType  type,
init = T() 
)

Performs the Scan on a whole Vector. With itself as output.

Depending on which backend was used, different versions of the skeleton is called. If SKEPU_CUDA is defined, the CUDA backend is used, similarly if SKEPU_OPENCL or SKEPU_OPENMP are defined then the OpenCL or OpenMP backend is used. As a fallback there is always a CPU version.

Parameters
inputA vector which will be scanned. It will be overwritten with the result.
typeThe scan type, either INCLUSIVE or EXCLUSIVE.
initThe initialization value for exclusive scans.

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 ScanFunc >
template<typename T >
void skepu::Scan< ScanFunc >::operator() ( Matrix< T > &  input,
ScanType  type,
init = T() 
)

Performs the Scan on a whole Matrix. With itself as output.

Depending on which backend was used, different versions of the skeleton is called. If SKEPU_OPENMP are defined then the OpenMP backend is used. As a fallback there is always a CPU version.

Parameters
inputA matrix which will be scanned. It will be overwritten with the result.
typeThe scan type, either INCLUSIVE or EXCLUSIVE.
initThe initialization value for exclusive scans.
template<typename ScanFunc >
template<typename InputIterator >
void skepu::Scan< ScanFunc >::operator() ( InputIterator  inputBegin,
InputIterator  inputEnd,
ScanType  type,
typename InputIterator::value_type  init = typename InputIterator::value_type() 
)

Performs the Scan on a range of elements. With the same range as output.

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
inputBeginA Vector::iterator to the first element in the range.
inputEndA Vector::iterator to the last element of the range.
typeThe scan type, either INCLUSIVE or EXCLUSIVE.
initThe initialization value for exclusive scans.
template<typename ScanFunc >
template<typename T >
void skepu::Scan< ScanFunc >::operator() ( Vector< T > &  input,
Vector< T > &  output,
ScanType  type,
init = T() 
)

Performs the Scan on a whole Vector. With a seperate Vector as output.

Depending on which backend was used, different versions of the skeleton is called. If SKEPU_CUDA is defined, the CUDA backend is used, similarly if SKEPU_OPENCL or SKEPU_OPENMP are defined then the OpenCL or OpenMP backend is used. As a fallback there is always a CPU version.

Parameters
inputA vector which will be scanned.
outputThe result vector, will be overwritten with the result and resized if needed.
typeThe scan type, either INCLUSIVE or EXCLUSIVE.
initThe initialization value for exclusive scans.

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 ScanFunc >
template<typename T >
void skepu::Scan< ScanFunc >::operator() ( Matrix< T > &  input,
Matrix< T > &  output,
ScanType  type,
init = T() 
)

Performs the Scan on a whole Matrix. With a seperate Matrix as output.

Depending on which backend was used, different versions of the skeleton is called. If SKEPU_OPENMP are defined then the OpenMP backend is used. As a fallback there is always a CPU version.

Parameters
inputA matrix which will be scanned.
outputThe result matrix, will be overwritten with the result and resized if needed.
typeThe scan type, either INCLUSIVE or EXCLUSIVE.
initThe initialization value for exclusive scans.
template<typename ScanFunc >
template<typename InputIterator , typename OutputIterator >
void skepu::Scan< ScanFunc >::operator() ( InputIterator  inputBegin,
InputIterator  inputEnd,
OutputIterator  outputBegin,
ScanType  type,
typename InputIterator::value_type  init = typename InputIterator::value_type() 
)

Performs the Scan on a range of elements. With a seperate output 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
inputBeginA Vector::iterator to the first element in the range.
inputEndA Vector::iterator to the last element of the range.
outputBeginA Vector::iterator to the first element of the output range.
typeThe scan type, either INCLUSIVE or EXCLUSIVE.
initThe initialization value for exclusive scans.

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