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::Matrix< IndexPoint > Class Template Reference

The IndexMatrix (a.k.a. Matrix<IndexPoint>) class is a special implementation of a Matrix with Elements of type IndexPoint. More...

#include <IndexMatrix.h>

Public Types

typedef IndexPoint value_type
 Defines the type of the elements in the Matrix.
 
typedef skelcl::MatrixSize size_type
 Defines the type used to denote size of the Matrix.
 

Public Member Functions

 Matrix (const size_type size)
 Create a new IndexMatrix with the given size.
 
size_type size () const
 Returns the total size of the Matrix. More...
 
detail::Sizes sizes () const
 Returns the size of the parts of the Matrix which are stored on each device. More...
 
value_type operator[] (size_type n) const
 Returns the IndexPoint at position n (i.e. n). More...
 
value_type at (size_type n) const
 Returns the IndexPoint at position n (i.e. n). More...
 
value_type front () const
 Return the first IndexPoint stored in the Matrix (i.e. {0, 0}). More...
 
value_type back () const
 Return the last Index stored in the Vector (i.e. {size().rowCount()-1, size().columnCount()-1}). More...
 
detail::Distribution< Matrix
< IndexPoint > > & 
distribution () const
 Returns the current distribution of the Matrix. More...
 
template<typename U >
void setDistribution (const detail::Distribution< Matrix< U >> &distribution) const
 Changes the distribution of the Matrix. More...
 
template<typename U >
void setDistribution (const std::unique_ptr< detail::Distribution< Matrix< U >>> &newDistribution) const
 Changes the distribution of the Matrix. More...
 
void setDistribution (std::unique_ptr< detail::Distribution< Matrix< IndexPoint >>> &&newDistribution) const
 Changes the distribution of the Matrix. 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< IndexPoint > & 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 Matrix on the device. For the IndexMatrix this function always returns an empty string. More...
 

Detailed Description

template<>
class skelcl::Matrix< IndexPoint >

The IndexMatrix (a.k.a. Matrix<IndexPoint>) class is a special implementation of a Matrix with Elements of type IndexPoint.

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

Definition at line 73 of file IndexMatrix.h.

Member Function Documentation

Returns the IndexPoint 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 IndexPoint should be returned.
Returns
The IndexPoint at position n. As the Matirx stores IndexPoints from 0 up to its size the return value is always n.

Definition at line 110 of file IndexMatrix.cpp.

Return the last Index stored in the Vector (i.e. {size().rowCount()-1, size().columnCount()-1}).

Returns
Always {size().rowCount()-1, size().columnCount()-1}).

Definition at line 124 of file IndexMatrix.cpp.

void skelcl::Matrix< IndexPoint >::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 184 of file IndexMatrix.cpp.

void skelcl::Matrix< IndexPoint >::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 189 of file IndexMatrix.cpp.

const detail::DeviceBuffer & skelcl::Matrix< IndexPoint >::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 170 of file IndexMatrix.cpp.

std::string skelcl::Matrix< IndexPoint >::deviceFunctions ( )
static

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

This functions exists for compatibility reasons with the Matrix class.

Returns
An empty string.

Definition at line 150 of file IndexMatrix.cpp.

detail::Distribution< Matrix< IndexPoint > > & skelcl::Matrix< IndexPoint >::distribution ( ) const

Returns the current distribution of the Matrix.

Returns
The current distribution of the Matrix.

Definition at line 130 of file IndexMatrix.cpp.

Return the first IndexPoint stored in the Matrix (i.e. {0, 0}).

Returns
Always {0, 0}.

Definition at line 119 of file IndexMatrix.cpp.

std::vector< IndexPoint > & skelcl::Matrix< IndexPoint >::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 177 of file IndexMatrix.cpp.

Returns the IndexPoint 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 IndexPoint should be returned.
Returns
The IndexPoint at position n. As the Matirx stores IndexPoints from 0 up to its size the return value is always n.

Definition at line 105 of file IndexMatrix.cpp.

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

Changes the distribution of the Matrix.

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

Changes the distribution of the Matrix.

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

Changes the distribution of the Matrix.

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

Definition at line 136 of file IndexMatrix.cpp.

Returns the total size of the Matrix.

Returns
The total size of the Matrix.

Definition at line 89 of file IndexMatrix.cpp.

detail::Sizes skelcl::Matrix< IndexPoint >::sizes ( ) const

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

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

Definition at line 94 of file IndexMatrix.cpp.


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