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> | |
void | 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. More... | |
An instance of the Zip class describes a calculation which can be performed on one or more devices.
This is a more specialized version of the general Zip<Tout(Tleft, Tright)> skeleton. It can be customized with a user-defined function taking arbitrary types as arguments (no classes are currently possible) and produces no 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< void(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 |
void skelcl::Zip< void(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.
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. |