VexCL
Public Types | Public Member Functions | List of all members
vex::stencil< T > Class Template Reference

Stencil. More...

#include <stencil.hpp>

Inherits stencil_base< T >.

Public Types

typedef T value_type
 

Public Member Functions

 stencil (const std::vector< cl::CommandQueue > &queue, const std::vector< T > &st, uint center)
 Costructor. More...
 
template<class Iterator >
 stencil (const std::vector< cl::CommandQueue > &queue, Iterator begin, Iterator end, uint center)
 Costructor. More...
 
 stencil (const std::vector< cl::CommandQueue > &queue, std::initializer_list< T > list, uint center)
 Costructor. More...
 
void convolve (const vex::vector< T > &x, vex::vector< T > &y, T alpha=0, T beta=1) const
 Convolve stencil with a vector. More...
 

Detailed Description

template<typename T>
class vex::stencil< T >

Stencil.

Should be used for stencil convolutions with vex::vectors as in

void convolve(
{
y = x * s;
}

Stencil should be small enough to fit into local memory of all compute devices it resides on.

Constructor & Destructor Documentation

template<typename T>
vex::stencil< T >::stencil ( const std::vector< cl::CommandQueue > &  queue,
const std::vector< T > &  st,
uint  center 
)
inline

Costructor.

Parameters
queuevector of queues. Each queue represents one compute device.
stvector holding stencil values.
centercenter of the stencil.
template<typename T>
template<class Iterator >
vex::stencil< T >::stencil ( const std::vector< cl::CommandQueue > &  queue,
Iterator  begin,
Iterator  end,
uint  center 
)
inline

Costructor.

Parameters
queuevector of queues. Each queue represents one compute device.
beginiterator to begin of sequence holding stencil data.
enditerator to end of sequence holding stencil data.
centercenter of the stencil.
template<typename T>
vex::stencil< T >::stencil ( const std::vector< cl::CommandQueue > &  queue,
std::initializer_list< T >  list,
uint  center 
)
inline

Costructor.

Parameters
queuevector of queues. Each queue represents one compute device.
listintializer list holding stencil values.
centercenter of the stencil.

Member Function Documentation

template<typename T >
void vex::stencil< T >::convolve ( const vex::vector< T > &  x,
vex::vector< T > &  y,
alpha = 0,
beta = 1 
) const

Convolve stencil with a vector.

y = alpha * y + beta * conv(x);

Parameters
xinput vector.
youtput vector.
alphaScaling coefficient in front of y.
betaScaling coefficient in front of convolution.

References vex::alignup(), vex::num_workgroups(), and vex::vector< T >::part_size().


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