An instance of the Reduce class describes a scan (a.k.a. prefix sum) calculation customized by a given binary user-defined function.
More...
#include <Scan.h>
|
| Scan (const Source &source, const std::string &id="0", const std::string &funcName=std::string("func")) |
| Constructor taking the source code to customize the Scan skeleton. More...
|
|
template<typename... Args> |
Vector< T > | operator() (const Vector< T > &input, Args &&...args) |
| Function call operator. Executes the skeleton on the data provided as argument input and args. The resulting data is returned as a moved copy. More...
|
|
template<typename... Args> |
Vector< T > & | operator() (Out< Vector< T >> output, const Vector< T > &input, Args &&...args) |
| Function call operator. Executes the skeleton on the data provided as argument input and args. The resulting data is stored in the provided Vector output. A reference to the output Vector is returned to allow for chaining skeleton calls. More...
|
|
template<typename T>
class skelcl::Scan< T(T)>
An instance of the Reduce class describes a scan (a.k.a. prefix sum) calculation customized by a given binary user-defined function.
- Template Parameters
-
T | Type of the input and output data of the skeleton. |
Definition at line 81 of file Scan.h.
template<typename T >
skelcl::Scan< T(T)>::Scan |
( |
const Source & |
source, |
|
|
const std::string & |
id = "0" , |
|
|
const std::string & |
funcName = std::string("func") |
|
) |
| |
Constructor taking the source code to customize the Scan skeleton.
- Parameters
-
source | Source code used to customize the skeleton. |
id | Identity for he function named by funcName and defined in source. Meaning: if func is the name of the function defined in source, func(x, id) = x and func(id, x) = x for every possible value of x |
funcName | Name of the 'main' function (the starting point) of the given source code |
template<typename T >
template<typename... Args>
Vector<T> skelcl::Scan< T(T)>::operator() |
( |
const Vector< T > & |
input, |
|
|
Args &&... |
args |
|
) |
| |
Function call operator. Executes the skeleton on the data provided as argument input and args. The resulting data is returned as a moved copy.
- Parameters
-
input | The input data for the skeleton managed inside a Vector. If no distribution is set the Single distribution using the device with id 0 is used. Currently only the Single distribution is supported for the input Vector! This will certainly be advanced in a future version. |
args | Additional arguments which are passed to the function named by funcName and defined in the source code at created. The individual arguments must be passed in the same order here as they where defined in the funcName function declaration. |
template<typename T >
template<typename... Args>
Vector<T>& skelcl::Scan< T(T)>::operator() |
( |
Out< Vector< T >> |
output, |
|
|
const Vector< T > & |
input, |
|
|
Args &&... |
args |
|
) |
| |
Function call operator. Executes the skeleton on the data provided as argument input and args. The resulting data is stored in the provided Vector output. A reference to the output Vector is returned to allow for chaining skeleton calls.
- Parameters
-
output | The Vector storing the result of the execution of the skeleton. A reference to this container is also returned. The Vector might be resized to fit the result. The distribution of the container might change. |
input | The input data for the skeleton managed inside a Vector. If no distribution is set the Single distribution using the device with id 0 is used. Currently only the Single distribution is supported for the input Vector! This will certainly be advanced in a future version. |
args | Additional arguments which are passed to the function named by funcName and defined in the source code at created. The individual arguments must be passed in the same order here as they where defined in the funcName function declaration. |
The documentation for this class was generated from the following file: