|
ug4
|
#include <gpuvector.h>
Inheritance diagram for ug::GPUVector< TValueType >:Public Types | |
| typedef Vector< TValueType > | super |
| typedef TValueType | value_type |
| typedef GPUVector< TValueType > | vector_type |
Public Types inherited from ug::Vector< TValueType > | |
| typedef TValueType | value_type |
| typedef Vector< TValueType > | vector_type |
Public Member Functions | |
| void | add (double alpha, const GPUVector< value_type > &v) |
| void | assure_on_cpu () |
| void | assure_on_cpu () const |
| void | assure_on_gpu () |
| void | assure_on_gpu () const |
| SmartPtr< vector_type > | clone () const |
| clones the vector (deep-copy) including values | |
| SmartPtr< vector_type > | clone_without_values () const |
| clones the vector (deep-copy) excluding values | |
| double | dotprod (const GPUVector< value_type > &w) const |
| double * | get_dev_ptr () |
| const double * | get_dev_ptr () const |
| GPUVector () | |
| constructor | |
| GPUVector (size_t _length) | |
| constructor with length | |
| double | norm () const |
| return sqrt(sum values[i]^2) (euclidian norm) | |
| bool | on_cpu () |
| bool | on_gpu () |
| void | operator*= (const number &a) |
| void | operator+= (const GPUVector< value_type > &v) |
| void | operator-= (const GPUVector< value_type > &v) |
| void | operator= (const GPUVector< value_type > &v) |
| value_type & | operator[] (size_t i) |
| access element i of the vector | |
| const value_type & | operator[] (size_t i) const |
| void | reserve (size_t newCapacity, bool bCopyValues=true) |
| void | reserve (size_t newCapacity, bool bCopyValues=true) |
| void | resize (size_t newSize, bool bCopyValues=true) |
| void | resize (size_t newSize, bool bCopyValues=true) |
| size_t | size () const |
Public Member Functions inherited from ug::Vector< TValueType > | |
| template<typename V > | |
| void | add (const V &u) |
| void | add (const value_type *u, const size_t *indices, size_t nr) |
| size_t | capacity () const |
| SmartPtr< vector_type > | clone () const |
| clones the vector (deep-copy) including values | |
| SmartPtr< vector_type > | clone_without_values () const |
| clones the vector (deep-copy) excluding values | |
| void | create (const Vector &v) |
| create as a copy of other vector | |
| void | create (size_t size) |
| create a vector with specific size | |
| size_t | defragment () |
| double | dotprod (const Vector &w) |
| returns v.T w, that is the dotprod of this vector and w | |
| template<typename V > | |
| void | get (V &u) const |
| void | get (value_type *u, const size_t *indices, size_t nr) const |
| double | maxnorm () const |
| return max values[i] (max norm) | |
| double | norm () const |
| return sqrt(sum values[i]^2) (euclidian norm) | |
| void | operator*= (const number &a) |
| void | operator+= (const Vector &v) |
| void | operator-= (const Vector &v) |
| void | operator= (const Vector &v) |
| assign other vector v | |
| double | operator= (double d) |
| assign double d to whole Vector | |
| value_type & | operator[] (size_t i) |
| access element i of the vector | |
| const value_type & | operator[] (size_t i) const |
| void | p () |
| gdb shortcut for print | |
| void | print (const char *const text=NULL) const |
| print vector to console | |
| void | reserve (size_t newCapacity, bool bCopyValues=true) |
| void | reserve_exactly (size_t newCapacity, bool bCopyValues) |
| void | reserve_sloppy (size_t newCapacity, bool bCopyValues=true) |
| void | resize (size_t newSize, bool bCopyValues=true) |
| void | resize_exactly (size_t newSize, bool bCopyValues=true) |
| resize the vector to be EXACTLY newSize big (no overhead) | |
| void | resize_sloppy (size_t newSize, bool bCopyValues=true) |
| template<typename V > | |
| void | set (const V &u) |
| void | set (const value_type *u, const size_t *indices, size_t nr) |
| void | set (double d) |
| assign double d to whole Vector | |
| void | set_random (double from, double to) |
| size_t | size () const |
| Vector () | |
| constructor | |
| Vector (const vector_type &v) | |
| Vector (size_t size) | |
| constructor with size | |
| virtual | ~Vector () |
| virtual destructor | |
Protected Member Functions | |
| virtual vector_type * | virtual_clone () const |
| virtual clone using covariant return type | |
| virtual vector_type * | virtual_clone_without_values () const |
| virtual clone using covariant return type excluding values | |
Private Types | |
| enum | GPU_STATE { ON_GPU = 1 , ON_CPU = 2 , ON_GPU_AND_CPU = 3 } |
Private Attributes | |
| double * | m_devValues |
| int | m_GPUState |
| size_t | m_sizeOnGPU |
| typedef Vector<TValueType> ug::GPUVector< TValueType >::super |
| typedef TValueType ug::GPUVector< TValueType >::value_type |
| typedef GPUVector<TValueType> ug::GPUVector< TValueType >::vector_type |
|
private |
|
inline |
constructor
References ug::GPUVector< TValueType >::m_GPUState, and ug::GPUVector< TValueType >::ON_CPU.
|
inline |
constructor with length
References ug::GPUVector< TValueType >::m_GPUState, and ug::GPUVector< TValueType >::ON_CPU.
|
inline |
|
inline |
References ug::CudaCpyToHost(), ug::GPUVector< TValueType >::m_devValues, ug::GPUVector< TValueType >::m_GPUState, ug::GPUVector< TValueType >::on_cpu(), and ug::GPUVector< TValueType >::ON_CPU.
Referenced by ug::GPUVector< TValueType >::assure_on_cpu(), ug::GPUVector< TValueType >::operator[](), ug::GPUVector< TValueType >::operator[](), and ug::GPUVector< TValueType >::resize().
|
inline |
References ug::GPUVector< TValueType >::assure_on_cpu().
|
inline |
References ug::CudaCpyToDevice(), ug::CudaCreateAndCopyToDevice(), ug::GPUVector< TValueType >::m_devValues, ug::GPUVector< TValueType >::m_GPUState, ug::GPUVector< TValueType >::m_sizeOnGPU, ug::GPUVector< TValueType >::on_gpu(), ug::GPUVector< TValueType >::ON_GPU, and ug::GPUVector< TValueType >::size().
Referenced by ug::GPUVector< TValueType >::assure_on_gpu(), ug::GPUVector< TValueType >::get_dev_ptr(), and ug::GPUVector< TValueType >::get_dev_ptr().
|
inline |
References ug::GPUVector< TValueType >::assure_on_gpu().
|
inline |
|
inline |
References ug::GPUVector< TValueType >::assure_on_gpu(), ug::GPUVector< TValueType >::m_devValues, ug::GPUVector< TValueType >::m_GPUState, and ug::GPUVector< TValueType >::ON_GPU.
Referenced by ug::GPUVector< TValueType >::add(), ug::GPUVector< TValueType >::dotprod(), ug::GPUVector< TValueType >::norm(), ug::GPUVector< TValueType >::operator*=(), ug::GPUVector< TValueType >::operator+=(), ug::GPUVector< TValueType >::operator-=(), ug::GPUVector< TValueType >::operator=(), ug::VecProd(), ug::VecScaleAdd(), and ug::VecScaleAdd().
|
inline |
|
inline |
return sqrt(sum values[i]^2) (euclidian norm)
References ug::GPUVector< TValueType >::get_dev_ptr(), and ug::GPUVector< TValueType >::size().
|
inline |
References ug::GPUVector< TValueType >::m_GPUState, and ug::GPUVector< TValueType >::ON_CPU.
Referenced by ug::GPUVector< TValueType >::assure_on_cpu().
|
inline |
References ug::GPUVector< TValueType >::m_GPUState, and ug::GPUVector< TValueType >::ON_GPU.
Referenced by ug::GPUVector< TValueType >::assure_on_gpu().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
access element i of the vector
References ug::GPUVector< TValueType >::assure_on_cpu(), ug::GPUVector< TValueType >::m_GPUState, ug::GPUVector< TValueType >::ON_CPU, and ug::Vector< TValueType >::operator[]().
|
inline |
|
inline |
|
inline |
References ug::GPUVector< TValueType >::reserve(), and UG_LOG.
Referenced by ug::GPUVector< TValueType >::reserve().
|
inline |
|
inline |
|
inline |
Referenced by ug::GPUVector< TValueType >::add(), ug::GPUVector< TValueType >::assure_on_gpu(), ug::GPUVector< TValueType >::dotprod(), ug::GPUVector< TValueType >::norm(), ug::GPUVector< TValueType >::operator*=(), ug::GPUVector< TValueType >::operator+=(), ug::GPUVector< TValueType >::operator-=(), ug::GPUVector< TValueType >::operator=(), ug::VecAssign(), ug::VecNormSquaredAdd(), ug::VecProd(), ug::VecScaleAdd(), ug::VecScaleAdd(), and ug::VecScaleAssign().
|
private |
|
private |
Referenced by ug::GPUVector< TValueType >::assure_on_cpu(), ug::GPUVector< TValueType >::assure_on_gpu(), ug::GPUVector< TValueType >::get_dev_ptr(), ug::GPUVector< TValueType >::GPUVector(), ug::GPUVector< TValueType >::GPUVector(), ug::GPUVector< TValueType >::on_cpu(), ug::GPUVector< TValueType >::on_gpu(), ug::GPUVector< TValueType >::operator[](), and ug::GPUVector< TValueType >::resize().
|
private |
Referenced by ug::GPUVector< TValueType >::assure_on_gpu().