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 Types | Public Member Functions | Static Public Member Functions | List of all members
skelcl::Vector< Index > Class Template Reference

The IndexVector (a.k.a. Vector<Index>) class is a special implementation of a Vector with Elements of type Index. More...

#include <IndexVector.h>

Public Types

typedef Index value_type
 Defines the type of the elements in the Vector.
 
typedef size_t size_type
 Defines the type used to denote size of the Vector.
 

Public Member Functions

 Vector (const value_type size)
 Create a new IndexVector with the given size.
 
 Vector (const Vector< Index > &rhs)
 Create a new IndexVector with the size and distribution given by rhs.
 
size_type size () const
 Returns the total size of the Vector. More...
 
detail::Sizes sizes () const
 Returns the size of the parts of the Vector which are stored on each device. More...
 
value_type operator[] (size_type n) const
 Returns the Index at position n (i.e. n). More...
 
value_type at (size_type n) const
 Returns the Index at position n (i.e. n). More...
 
value_type front () const
 Return the first Index stored in the Vector (i.e. 0). More...
 
value_type back () const
 Return the last Index stored in the Vector (i.e. size()-1). More...
 
detail::Distribution< Vector
< Index > > & 
distribution () const
 Returns the current distribution of the Vector. More...
 
template<typename U >
void setDistribution (const detail::Distribution< Vector< U >> &distribution) const
 Changes the distribution of the Vector. More...
 
template<typename U >
void setDistribution (const std::unique_ptr< detail::Distribution< Vector< U >>> &newDistribution) const
 Changes the distribution of the Vector. More...
 
void setDistribution (std::unique_ptr< detail::Distribution< Vector< Index >>> &&newDistribution) const
 Changes the distribution of the Vector. More...
 
const detail::DeviceBuffer & deviceBuffer (const detail::Device &device) const
 This function should never be called as it only exists for compatibility reasons with the Matrix class. More...
 
std::vector< Index > & hostBuffer () const
 This function should never be called as it only exists for compatibility reasons with the Matrix class. More...
 
void dataOnDeviceModified () const
 This function should never be called as it only exists for compatibility reasons with the Matrix class. More...
 
void dataOnHostModified () const
 This function should never be called as it only exists for compatibility reasons with the Matrix class. More...
 

Static Public Member Functions

static std::string deviceFunctions ()
 Returns a string defining functions necessary to access the Vector on the device. For the IndexVector this function always returns an empty string. More...
 

Detailed Description

template<>
class skelcl::Vector< Index >

The IndexVector (a.k.a. Vector<Index>) class is a special implementation of a Vector with Elements of type Index.

The implementation guaranties that no data is transfered to and from the devices when using this version of the Vector. OpenCL functionality (global ids) is used to make the Indexs available on the device. This implementation requires, that the Vector is const and can, therefore, not be modified after creation.

Definition at line 72 of file IndexVector.h.

Member Function Documentation

Returns the Index at position n (i.e. n).

This version does prevent out of range accesses. If n > size() an std::out_of_range exception is thrown.

Parameters
nThe position for which the Index should be returned.
Returns
The Index at position n. As the Vector stores Indexes from 0 up to its size the return value is always n.

Definition at line 123 of file IndexVector.cpp.

Vector< Index >::value_type skelcl::Vector< Index >::back ( ) const

Return the last Index stored in the Vector (i.e. size()-1).

Returns
Always size()-1.

Definition at line 134 of file IndexVector.cpp.

void skelcl::Vector< Index >::dataOnDeviceModified ( ) const

This function should never be called as it only exists for compatibility reasons with the Matrix class.

This function will always fail with an assertion.

Definition at line 194 of file IndexVector.cpp.

void skelcl::Vector< Index >::dataOnHostModified ( ) const

This function should never be called as it only exists for compatibility reasons with the Matrix class.

This function will always fail with an assertion.

Definition at line 199 of file IndexVector.cpp.

const detail::DeviceBuffer & skelcl::Vector< Index >::deviceBuffer ( const detail::Device &  device) const

This function should never be called as it only exists for compatibility reasons with the Matrix class.

This function will always fail with an assertion.

Definition at line 180 of file IndexVector.cpp.

std::string skelcl::Vector< Index >::deviceFunctions ( )
static

Returns a string defining functions necessary to access the Vector on the device. For the IndexVector this function always returns an empty string.

This functions exists for compatibility reasons with the Vector class.

Returns
An empty string.

Definition at line 160 of file IndexVector.cpp.

detail::Distribution< Vector< Index > > & skelcl::Vector< Index >::distribution ( ) const

Returns the current distribution of the Vector.

Returns
The current distribution of the Vector.

Definition at line 139 of file IndexVector.cpp.

Vector< Index >::value_type skelcl::Vector< Index >::front ( ) const

Return the first Index stored in the Vector (i.e. 0).

Returns
Always 0.

Definition at line 129 of file IndexVector.cpp.

std::vector< Index > & skelcl::Vector< Index >::hostBuffer ( ) const

This function should never be called as it only exists for compatibility reasons with the Matrix class.

This function will always fail with an assertion.

Definition at line 187 of file IndexVector.cpp.

Vector< Index >::value_type skelcl::Vector< Index >::operator[] ( size_type  n) const

Returns the Index at position n (i.e. n).

This version does not prevent out of range accesses. If n > size() the behavior is undefined.

Parameters
nThe position for which the Index should be returned.
Returns
The Index at position n. As the Vector stores Indexes from 0 up to its size the return value is always n.

Definition at line 118 of file IndexVector.cpp.

template<typename U >
void skelcl::Vector< Index >::setDistribution ( const detail::Distribution< Vector< U >> &  distribution) const

Changes the distribution of the Vector.

Parameters
distributionThe new distribution to be set. After this call distribution is the new selected distribution of the Vector.
template<typename U >
void skelcl::Vector< Index >::setDistribution ( const std::unique_ptr< detail::Distribution< Vector< U >>> &  newDistribution) const

Changes the distribution of the Vector.

Parameters
newDistributionThe new distribution to be set. After this call distribution is the new selected distribution of the Vector.
void skelcl::Vector< Index >::setDistribution ( std::unique_ptr< detail::Distribution< Vector< Index >>> &&  newDistribution) const

Changes the distribution of the Vector.

Parameters
newDistributionThe new distribution to be set. After this call distribution is the new selected distribution of the Vector.

Definition at line 146 of file IndexVector.cpp.

Vector< Index >::size_type skelcl::Vector< Index >::size ( ) const

Returns the total size of the Vector.

Returns
The total size of the Vector.

Definition at line 102 of file IndexVector.cpp.

detail::Sizes skelcl::Vector< Index >::sizes ( ) const

Returns the size of the parts of the Vector which are stored on each device.

Returns
The sizes of the parts of the Vector which are stored on each device.

Definition at line 107 of file IndexVector.cpp.


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