SkelCL
SkelCL is a high level multi GPU skeleton library developed at the university of Münster, Germany.
|
An instance of the Zip class describes a calculation which can be performed on one or more devices. More...
#include <Zip.h>
Public Member Functions | |
Zip (const Source &source, const std::string &funcName=std::string("func")) | |
Constructor taking the source code used to customize the Zip skeleton. More... | |
template<template< typename > class C, typename... Args> | |
C< Tout > | operator() (const C< Tleft > &left, const C< Tright > &right, Args &&...args) |
Function call operator. Executes the skeleton on the data provided as arguments left, right and args. The resulting data is returned as a moved copy. More... | |
template<template< typename > class C, typename... Args> | |
C< Tout > & | operator() (Out< C< Tout >> output, const C< Tleft > &left, const C< Tright > &right, Args &&...args) |
Function call operator. Executes the skeleton on the data provided as arguments left, right and args. The resulting data is stored in the provided container output. A reference to the output container is returned to allow for chaining skeleton calls. More... | |
const std::string & | source () const |
Return the source code of the user defined function. More... | |
const std::string & | func () const |
Return the name of the user defined function. More... | |
An instance of the Zip class describes a calculation which can be performed on one or more devices.
This is the most general version of the Zip skeleton. It can be customized with a user-defined function taking arbitrary types as arguments (no classes are currently possible) and produces an arbitrary typed output.
On creation the Zip skeleton is customized with source code defining a binary function. The Zip skeleton can be executed by passing two containers. The given function is executed ones for every pair of item of the two input containers.
More formally: When x and y are two containers of length n and m with items x[0] .. x[n-1] and y[0] .. y[m-1], where m is equal or greater than n, f is the provided function, the Zip skeleton calculates the output container z as follows: z[i] = f(x[i], y[i]) for every i in 0 .. n-1.
Tleft | Type of the left input data of the skeleton |
Tright | Type of the right input data of the skeleton |
Tout | Type of the output data of the skeleton |
skelcl::Zip< Tout(Tleft, Tright)>::Zip | ( | const Source & | source, |
const std::string & | funcName = std::string("func") |
||
) |
Constructor taking the source code used to customize the Zip skeleton.
source | Source code used to customize the skeleton |
funcName | Name of the 'main' function (the starting point) of the given source code |
const std::string& skelcl::Zip< Tout(Tleft, Tright)>::func | ( | ) | const |
Return the name of the user defined function.
C<Tout> skelcl::Zip< Tout(Tleft, Tright)>::operator() | ( | const C< Tleft > & | left, |
const C< Tright > & | right, | ||
Args &&... | args | ||
) |
Function call operator. Executes the skeleton on the data provided as arguments left, right and args. The resulting data is returned as a moved copy.
left | The first (left) input data for the skeleton managed inside a container. The actual Type of this argument must be a subtype of the Container class. If no distribution is set for this container as well as for the right container as default the Block distribution is selected. If no distribution is set for this container and a distribution is set for the right container the distribution from the right container is adopted. If a distribution is set and differs from the distribution of the right distribution the Block distribution is set for both containers. |
right | The second (right) input data for the skeleton managed inside a container. The actual Type of this argument must be a subtype of the Container class. If no distribution is set for this container as well as for the left container as default the Block distribution is selected. If no distribution is set for this container and a distribution is set for the left container the distribution from the left container is adopted. If a distribution is set and differs from the distribution of the left distribution the Block distribution is set for both containers. |
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. |
C<Tout>& skelcl::Zip< Tout(Tleft, Tright)>::operator() | ( | Out< C< Tout >> | output, |
const C< Tleft > & | left, | ||
const C< Tright > & | right, | ||
Args &&... | args | ||
) |
Function call operator. Executes the skeleton on the data provided as arguments left, right and args. The resulting data is stored in the provided container output. A reference to the output container is returned to allow for chaining skeleton calls.
output | The container storing the result of the execution of the skeleton. A reference to this container is also returned. The container might be resized to fit the result. The distribution of the container might change. |
left | The first (left) input data for the skeleton managed inside a container. The actual Type of this argument must be a subtype of the Container class. If no distribution is set for this container as well as for the right container as default the Block distribution is selected. If no distribution is set for this container and a distribution is set for the right container the distribution from the right container is adopted. If a distribution is set and differs from the distribution of the right distribution the Block distribution is set for both containers. |
right | The second (right) input data for the skeleton managed inside a container. The actual Type of this argument must be a subtype of the Container class. If no distribution is set for this container as well as for the left container as default the Block distribution is selected. If no distribution is set for this container and a distribution is set for the left container the distribution from the left container is adopted. If a distribution is set and differs from the distribution of the left distribution the Block distribution is set for both containers. |
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. |
const std::string& skelcl::Zip< Tout(Tleft, Tright)>::source | ( | ) | const |
Return the source code of the user defined function.