SkelCL
SkelCL is a high level multi GPU skeleton library developed at the university of Münster, Germany.
|
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... | |
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.
Vector< Index >::value_type skelcl::Vector< Index >::at | ( | size_type | n | ) | const |
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.
n | The position for which the Index should be returned. |
Definition at line 123 of file IndexVector.cpp.
Vector< Index >::value_type skelcl::Vector< Index >::back | ( | ) | const |
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.
|
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.
Definition at line 160 of file IndexVector.cpp.
detail::Distribution< Vector< Index > > & skelcl::Vector< Index >::distribution | ( | ) | const |
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).
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.
n | The position for which the Index should be returned. |
Definition at line 118 of file IndexVector.cpp.
void skelcl::Vector< Index >::setDistribution | ( | const detail::Distribution< Vector< U >> & | distribution | ) | const |
void skelcl::Vector< Index >::setDistribution | ( | const std::unique_ptr< detail::Distribution< Vector< U >>> & | newDistribution | ) | const |
void skelcl::Vector< Index >::setDistribution | ( | std::unique_ptr< detail::Distribution< Vector< Index >>> && | newDistribution | ) | const |
Changes the distribution of the Vector.
newDistribution | The 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.
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.
Definition at line 107 of file IndexVector.cpp.