SkelCL
SkelCL is a high level multi GPU skeleton library developed at the university of Münster, Germany.
 All Classes Namespaces Files Functions Variables Typedefs Groups
Public Member Functions | List of all members
skelcl::Zip< Tout(Tleft, Tright)> Class Template Reference

An instance of the Zip class describes a calculation which can be performed on one or more devices. More...

#include <Zip.h>

Inheritance diagram for skelcl::Zip< Tout(Tleft, Tright)>:

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...
 

Detailed Description

template<typename Tleft, typename Tright, typename Tout>
class skelcl::Zip< Tout(Tleft, Tright)>

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.

Template Parameters
TleftType of the left input data of the skeleton
TrightType of the right input data of the skeleton
ToutType of the output data of the skeleton

Definition at line 99 of file Zip.h.

Constructor & Destructor Documentation

template<typename Tleft , typename Tright , typename Tout >
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.

Parameters
sourceSource code used to customize the skeleton
funcNameName of the 'main' function (the starting point) of the given source code

Member Function Documentation

template<typename Tleft , typename Tright , typename Tout >
const std::string& skelcl::Zip< Tout(Tleft, Tright)>::func ( ) const

Return the name of the user defined function.

Returns
The name of the user defined function.
template<typename Tleft , typename Tright , typename Tout >
template<template< typename > class C, typename... Args>
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.

Parameters
leftThe 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.
rightThe 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.
argsAdditional 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 Tleft , typename Tright , typename Tout >
template<template< typename > class C, typename... Args>
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.

Parameters
outputThe 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.
leftThe 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.
rightThe 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.
argsAdditional 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 Tleft , typename Tright , typename Tout >
const std::string& skelcl::Zip< Tout(Tleft, Tright)>::source ( ) const

Return the source code of the user defined function.

Returns
The source code of the user defined function.

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