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

Detailed Description

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

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.

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 275 of file Zip.h.

Constructor & Destructor Documentation

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

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 >
template<template< typename > class C, typename... Args>
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.

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.

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