#include <CudaTypes.h>

Public Types | |
| typedef T | value_type |
| typedef size_t | size_type |
Public Member Functions | |
| CudaVector () | |
| CudaVector (size_type n) | |
| CudaVector (const CudaVector< T > &v) | |
| void | clear () |
| void | operator= (const CudaVector< T > &v) |
| ~CudaVector () | |
| size_type | size () const |
| bool | empty () const |
| void | reserve (size_type s, size_type WARP_SIZE=BSIZE) |
| void | fastResize (size_type s, size_type WARP_SIZE=BSIZE) |
| resize the vector without calling constructors or destructors, and without synchronizing the device and host copy | |
| void | resize (size_type s, size_type WARP_SIZE=BSIZE) |
| void | swap (CudaVector< T > &v) |
| const void * | deviceRead (int i=0) const |
| void * | deviceWrite (int i=0) |
| const T * | hostRead (int i=0) const |
| T * | hostWrite (int i=0) |
| bool | isHostValid () const |
| bool | isDeviceValid () const |
| GLuint | bufferRead (bool create=false) |
| Get the OpenGL Buffer Object ID for reading. | |
| GLuint | bufferWrite (bool create=false) |
| Get the OpenGL Buffer Object ID for writing. | |
| void | push_back (const T &t) |
| void | pop_back () |
| const T & | operator[] (size_type i) const |
| T & | operator[] (size_type i) |
| const T & | getCached (size_type i) const |
Protected Member Functions | |
| void | copyToHost () const |
| void | copyToDevice () const |
| void | checkIndex (size_type i) const |
| void | registerBuffer () const |
| void | mapBuffer () const |
| void | unmapBuffer () const |
| void | unregisterBuffer () const |
| void | createBuffer () |
Protected Attributes | |
| size_type | vectorSize |
| Current size of the vector. | |
| size_type | allocSize |
| Allocated size. | |
| void * | devicePointer |
| Pointer to the data on the GPU side. | |
| T * | hostPointer |
| Pointer to the data on the CPU side. | |
| GLuint | bufferObject |
| Optionnal associated OpenGL buffer ID. | |
| bool | deviceIsValid |
| True if the data on the GPU is currently valid. | |
| bool | hostIsValid |
| True if the data on the CPU is currently valid. | |
| bool | bufferIsRegistered |
| True if the OpenGL buffer is registered with CUDA. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const CudaVector< T > &vec) |
| Output stream. | |
| std::istream & | operator>> (std::istream &in, CudaVector< T > &vec) |
| Input stream. | |
Definition at line 51 of file CudaTypes.h.
| typedef size_t sofa::gpu::cuda::CudaVector< T >::size_type |
Definition at line 55 of file CudaTypes.h.
| typedef T sofa::gpu::cuda::CudaVector< T >::value_type |
Definition at line 54 of file CudaTypes.h.
| sofa::gpu::cuda::CudaVector< T >::CudaVector | ( | ) | [inline] |
Definition at line 69 of file CudaTypes.h.
| sofa::gpu::cuda::CudaVector< T >::CudaVector | ( | size_type | n | ) | [inline] |
Definition at line 72 of file CudaTypes.h.
| sofa::gpu::cuda::CudaVector< T >::CudaVector | ( | const CudaVector< T > & | v | ) | [inline] |
Definition at line 77 of file CudaTypes.h.
| sofa::gpu::cuda::CudaVector< T >::~CudaVector | ( | ) | [inline] |
Definition at line 112 of file CudaTypes.h.
| GLuint sofa::gpu::cuda::CudaVector< T >::bufferRead | ( | bool | create = false |
) | [inline] |
| GLuint sofa::gpu::cuda::CudaVector< T >::bufferWrite | ( | bool | create = false |
) | [inline] |
| void sofa::gpu::cuda::CudaVector< T >::checkIndex | ( | size_type | i | ) | const [inline, protected] |
Definition at line 391 of file CudaTypes.h.
Referenced by sofa::gpu::cuda::CudaVector< TReal >::getCached(), and sofa::gpu::cuda::CudaVector< TReal >::operator[]().
| void sofa::gpu::cuda::CudaVector< T >::clear | ( | ) | [inline] |
Definition at line 82 of file CudaTypes.h.
Referenced by sofa::component::constraint::FixedConstraintInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::init(), and sofa::gpu::cuda::CudaVector< TReal >::operator=().
| void sofa::gpu::cuda::CudaVector< T >::copyToDevice | ( | ) | const [inline, protected] |
Definition at line 375 of file CudaTypes.h.
Referenced by sofa::gpu::cuda::CudaVector< TReal >::bufferRead(), sofa::gpu::cuda::CudaVector< TReal >::bufferWrite(), sofa::gpu::cuda::CudaVector< TReal >::deviceRead(), and sofa::gpu::cuda::CudaVector< TReal >::deviceWrite().
| void sofa::gpu::cuda::CudaVector< T >::copyToHost | ( | ) | const [inline, protected] |
Definition at line 360 of file CudaTypes.h.
Referenced by sofa::gpu::cuda::CudaVector< TReal >::hostRead(), sofa::gpu::cuda::CudaVector< TReal >::hostWrite(), sofa::gpu::cuda::CudaVector< TReal >::push_back(), and sofa::gpu::cuda::CudaVector< TReal >::resize().
| void sofa::gpu::cuda::CudaVector< T >::createBuffer | ( | ) | [inline, protected] |
Definition at line 429 of file CudaTypes.h.
Referenced by sofa::gpu::cuda::CudaVector< TReal >::bufferRead(), and sofa::gpu::cuda::CudaVector< TReal >::bufferWrite().
| const void* sofa::gpu::cuda::CudaVector< T >::deviceRead | ( | int | i = 0 |
) | const [inline] |
Definition at line 244 of file CudaTypes.h.
Referenced by sofa::gpu::cuda::CudaTestForceField::addDForce(), sofa::component::forcefield::SpringForceFieldInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::addDForce(), sofa::gpu::cuda::CudaTestForceField::addForce(), sofa::component::forcefield::SpringForceFieldInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::addForce(), sofa::gpu::cuda::CudaCollisionDetection::PointRigidTest::fillInfo(), sofa::gpu::cuda::CudaCollisionDetection::SphereRigidTest::fillInfo(), sofa::gpu::cuda::CudaCollisionDetection::RigidRigidTest::fillInfo(), sofa::component::visualmodel::CudaVisualModel< TDataTypes >::updateNormals(), sofa::component::MechanicalObjectInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::vDot(), sofa::component::MechanicalObjectInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::vMultiOp(), and sofa::component::MechanicalObjectInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::vOp().
| void* sofa::gpu::cuda::CudaVector< T >::deviceWrite | ( | int | i = 0 |
) | [inline] |
Definition at line 249 of file CudaTypes.h.
Referenced by sofa::gpu::cuda::CudaTestForceField::addDForce(), sofa::component::forcefield::SpringForceFieldInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::addDForce(), sofa::gpu::cuda::CudaTestForceField::addForce(), sofa::component::forcefield::SpringForceFieldInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::addForce(), sofa::gpu::cuda::CudaCollisionDetection::endNarrowPhase(), sofa::component::MechanicalObjectInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::resetForce(), sofa::component::MechanicalObjectInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::vMultiOp(), and sofa::component::MechanicalObjectInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::vOp().
| bool sofa::gpu::cuda::CudaVector< T >::empty | ( | ) | const [inline] |
Definition at line 131 of file CudaTypes.h.
Referenced by sofa::component::constraint::FixedConstraintInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::addConstraint(), sofa::gpu::cuda::CudaCollisionDetection::SphereRigidTest::init(), sofa::gpu::cuda::CudaVector< TReal >::pop_back(), and sofa::component::constraint::FixedConstraintInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::removeConstraint().
| void sofa::gpu::cuda::CudaVector< T >::fastResize | ( | size_type | s, | |
| size_type | WARP_SIZE = BSIZE | |||
| ) | [inline] |
resize the vector without calling constructors or destructors, and without synchronizing the device and host copy
Definition at line 174 of file CudaTypes.h.
Referenced by sofa::gpu::cuda::CudaCollisionDetection::endNarrowPhase(), sofa::gpu::cuda::CudaVector< TReal >::operator=(), sofa::gpu::cuda::CudaVector< TReal >::push_back(), sofa::component::MechanicalObjectInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::vAlloc(), and sofa::component::MechanicalObjectInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::vOp().
| const T& sofa::gpu::cuda::CudaVector< T >::getCached | ( | size_type | i | ) | const [inline] |
Definition at line 329 of file CudaTypes.h.
| const T* sofa::gpu::cuda::CudaVector< T >::hostRead | ( | int | i = 0 |
) | const [inline] |
Definition at line 255 of file CudaTypes.h.
Referenced by sofa::gpu::cuda::CudaCollisionDetection::endNarrowPhase(), sofa::gpu::cuda::CudaVector< TReal >::operator[](), and sofa::gpu::cuda::CudaVector< TReal >::reserve().
| T* sofa::gpu::cuda::CudaVector< T >::hostWrite | ( | int | i = 0 |
) | [inline] |
Definition at line 260 of file CudaTypes.h.
Referenced by sofa::gpu::cuda::CudaVector< TReal >::operator[]().
| bool sofa::gpu::cuda::CudaVector< T >::isDeviceValid | ( | ) | const [inline] |
Definition at line 270 of file CudaTypes.h.
| bool sofa::gpu::cuda::CudaVector< T >::isHostValid | ( | ) | const [inline] |
Definition at line 266 of file CudaTypes.h.
| void sofa::gpu::cuda::CudaVector< T >::mapBuffer | ( | ) | const [inline, protected] |
Definition at line 404 of file CudaTypes.h.
Referenced by sofa::gpu::cuda::CudaVector< TReal >::copyToDevice(), sofa::gpu::cuda::CudaVector< TReal >::copyToHost(), sofa::gpu::cuda::CudaVector< TReal >::createBuffer(), sofa::gpu::cuda::CudaVector< TReal >::operator=(), and sofa::gpu::cuda::CudaVector< TReal >::resize().
| void sofa::gpu::cuda::CudaVector< T >::operator= | ( | const CudaVector< T > & | v | ) | [inline] |
Definition at line 89 of file CudaTypes.h.
| T& sofa::gpu::cuda::CudaVector< T >::operator[] | ( | size_type | i | ) | [inline] |
Definition at line 323 of file CudaTypes.h.
| const T& sofa::gpu::cuda::CudaVector< T >::operator[] | ( | size_type | i | ) | const [inline] |
Definition at line 318 of file CudaTypes.h.
| void sofa::gpu::cuda::CudaVector< T >::pop_back | ( | ) | [inline] |
Definition at line 313 of file CudaTypes.h.
| void sofa::gpu::cuda::CudaVector< T >::push_back | ( | const T & | t | ) | [inline] |
Definition at line 305 of file CudaTypes.h.
Referenced by sofa::component::constraint::FixedConstraintInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::addConstraint(), sofa::component::constraint::FixedConstraintInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::init(), and sofa::component::constraint::FixedConstraintInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::removeConstraint().
| void sofa::gpu::cuda::CudaVector< T >::registerBuffer | ( | ) | const [inline, protected] |
Definition at line 396 of file CudaTypes.h.
Referenced by sofa::gpu::cuda::CudaVector< TReal >::mapBuffer().
| void sofa::gpu::cuda::CudaVector< T >::reserve | ( | size_type | s, | |
| size_type | WARP_SIZE = BSIZE | |||
| ) | [inline] |
Definition at line 135 of file CudaTypes.h.
Referenced by sofa::component::constraint::FixedConstraintInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::addConstraint(), sofa::gpu::cuda::CudaVector< TReal >::fastResize(), sofa::component::constraint::FixedConstraintInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::init(), sofa::component::constraint::FixedConstraintInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::removeConstraint(), and sofa::gpu::cuda::CudaVector< TReal >::resize().
| void sofa::gpu::cuda::CudaVector< T >::resize | ( | size_type | s, | |
| size_type | WARP_SIZE = BSIZE | |||
| ) | [inline] |
Definition at line 186 of file CudaTypes.h.
Referenced by sofa::component::forcefield::SpringForceFieldInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::addDForce(), sofa::component::forcefield::SpringForceFieldInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::addForce(), sofa::gpu::cuda::CudaVector< TReal >::CudaVector(), sofa::gpu::cuda::CudaTestForceField::init(), sofa::component::visualmodel::CudaVisualModel< TDataTypes >::initV(), sofa::gpu::cuda::CudaVector< TReal >::pop_back(), and sofa::component::MechanicalObjectInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::vOp().
| size_type sofa::gpu::cuda::CudaVector< T >::size | ( | void | ) | const [inline] |
Definition at line 127 of file CudaTypes.h.
Referenced by sofa::component::constraint::FixedConstraintInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::addConstraint(), sofa::gpu::cuda::CudaTestForceField::addDForce(), sofa::gpu::cuda::CudaTestForceField::addForce(), sofa::gpu::cuda::CudaVector< TReal >::checkIndex(), sofa::gpu::cuda::CudaCollisionDetection::SphereRigidTest::fillInfo(), sofa::gpu::cuda::CudaCollisionDetection::RigidRigidTest::fillInfo(), sofa::gpu::cuda::CudaTestForceField::init(), sofa::gpu::cuda::CudaCollisionDetection::SphereRigidTest::init(), sofa::component::visualmodel::CudaVisualModel< TDataTypes >::initV(), sofa::gpu::cuda::CudaVector< TReal >::operator=(), sofa::gpu::cuda::CudaVector< TReal >::pop_back(), sofa::gpu::cuda::CudaVector< TReal >::push_back(), sofa::component::MechanicalObjectInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::resetForce(), sofa::component::MechanicalObjectInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::vDot(), sofa::component::MechanicalObjectInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::vMultiOp(), and sofa::component::MechanicalObjectInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::vOp().
| void sofa::gpu::cuda::CudaVector< T >::swap | ( | CudaVector< T > & | v | ) | [inline] |
Definition at line 231 of file CudaTypes.h.
| void sofa::gpu::cuda::CudaVector< T >::unmapBuffer | ( | ) | const [inline, protected] |
Definition at line 412 of file CudaTypes.h.
Referenced by sofa::gpu::cuda::CudaVector< TReal >::bufferWrite(), and sofa::gpu::cuda::CudaVector< TReal >::unregisterBuffer().
| void sofa::gpu::cuda::CudaVector< T >::unregisterBuffer | ( | ) | const [inline, protected] |
Definition at line 420 of file CudaTypes.h.
Referenced by sofa::gpu::cuda::CudaVector< TReal >::reserve(), and sofa::gpu::cuda::CudaVector< TReal >::~CudaVector().
| std::ostream& operator<< | ( | std::ostream & | os, | |
| const CudaVector< T > & | vec | |||
| ) | [friend] |
| std::istream& operator>> | ( | std::istream & | in, | |
| CudaVector< T > & | vec | |||
| ) | [friend] |
size_type sofa::gpu::cuda::CudaVector< T >::allocSize [protected] |
Allocated size.
Definition at line 59 of file CudaTypes.h.
Referenced by sofa::gpu::cuda::CudaVector< TReal >::createBuffer(), sofa::gpu::cuda::CudaVector< TReal >::mapBuffer(), sofa::gpu::cuda::CudaVector< TReal >::registerBuffer(), sofa::gpu::cuda::CudaVector< TReal >::reserve(), sofa::gpu::cuda::CudaVector< TReal >::swap(), sofa::gpu::cuda::CudaVector< TReal >::unmapBuffer(), and sofa::gpu::cuda::CudaVector< TReal >::unregisterBuffer().
bool sofa::gpu::cuda::CudaVector< T >::bufferIsRegistered [mutable, protected] |
True if the OpenGL buffer is registered with CUDA.
Definition at line 65 of file CudaTypes.h.
Referenced by sofa::gpu::cuda::CudaVector< TReal >::registerBuffer(), sofa::gpu::cuda::CudaVector< TReal >::swap(), and sofa::gpu::cuda::CudaVector< TReal >::unregisterBuffer().
GLuint sofa::gpu::cuda::CudaVector< T >::bufferObject [protected] |
Optionnal associated OpenGL buffer ID.
Definition at line 62 of file CudaTypes.h.
Referenced by sofa::gpu::cuda::CudaVector< TReal >::bufferRead(), sofa::gpu::cuda::CudaVector< TReal >::bufferWrite(), sofa::gpu::cuda::CudaVector< TReal >::copyToDevice(), sofa::gpu::cuda::CudaVector< TReal >::copyToHost(), sofa::gpu::cuda::CudaVector< TReal >::createBuffer(), sofa::gpu::cuda::CudaVector< TReal >::mapBuffer(), sofa::gpu::cuda::CudaVector< TReal >::operator=(), sofa::gpu::cuda::CudaVector< TReal >::registerBuffer(), sofa::gpu::cuda::CudaVector< TReal >::reserve(), sofa::gpu::cuda::CudaVector< TReal >::resize(), sofa::gpu::cuda::CudaVector< TReal >::swap(), sofa::gpu::cuda::CudaVector< TReal >::unmapBuffer(), sofa::gpu::cuda::CudaVector< TReal >::unregisterBuffer(), and sofa::gpu::cuda::CudaVector< TReal >::~CudaVector().
bool sofa::gpu::cuda::CudaVector< T >::deviceIsValid [mutable, protected] |
True if the data on the GPU is currently valid.
Definition at line 63 of file CudaTypes.h.
Referenced by sofa::gpu::cuda::CudaVector< TReal >::clear(), sofa::gpu::cuda::CudaVector< TReal >::copyToDevice(), sofa::gpu::cuda::CudaVector< TReal >::createBuffer(), sofa::gpu::cuda::CudaVector< TReal >::fastResize(), sofa::gpu::cuda::CudaVector< TReal >::hostWrite(), sofa::gpu::cuda::CudaVector< TReal >::isDeviceValid(), sofa::gpu::cuda::CudaVector< TReal >::operator=(), sofa::gpu::cuda::CudaVector< TReal >::push_back(), sofa::gpu::cuda::CudaVector< TReal >::reserve(), sofa::gpu::cuda::CudaVector< TReal >::resize(), and sofa::gpu::cuda::CudaVector< TReal >::swap().
void* sofa::gpu::cuda::CudaVector< T >::devicePointer [mutable, protected] |
Pointer to the data on the GPU side.
Definition at line 60 of file CudaTypes.h.
Referenced by sofa::gpu::cuda::CudaVector< TReal >::copyToDevice(), sofa::gpu::cuda::CudaVector< TReal >::copyToHost(), sofa::gpu::cuda::CudaVector< TReal >::createBuffer(), sofa::gpu::cuda::CudaVector< TReal >::deviceRead(), sofa::gpu::cuda::CudaVector< TReal >::deviceWrite(), sofa::gpu::cuda::CudaVector< TReal >::mapBuffer(), sofa::gpu::cuda::CudaVector< TReal >::operator=(), sofa::gpu::cuda::CudaVector< TReal >::reserve(), sofa::gpu::cuda::CudaVector< TReal >::resize(), sofa::gpu::cuda::CudaVector< TReal >::swap(), sofa::gpu::cuda::CudaVector< TReal >::unmapBuffer(), and sofa::gpu::cuda::CudaVector< TReal >::~CudaVector().
bool sofa::gpu::cuda::CudaVector< T >::hostIsValid [mutable, protected] |
True if the data on the CPU is currently valid.
Definition at line 64 of file CudaTypes.h.
Referenced by sofa::gpu::cuda::CudaVector< TReal >::bufferWrite(), sofa::gpu::cuda::CudaVector< TReal >::clear(), sofa::gpu::cuda::CudaVector< TReal >::copyToHost(), sofa::gpu::cuda::CudaVector< TReal >::deviceWrite(), sofa::gpu::cuda::CudaVector< TReal >::fastResize(), sofa::gpu::cuda::CudaVector< TReal >::isHostValid(), sofa::gpu::cuda::CudaVector< TReal >::operator=(), sofa::gpu::cuda::CudaVector< TReal >::reserve(), sofa::gpu::cuda::CudaVector< TReal >::resize(), and sofa::gpu::cuda::CudaVector< TReal >::swap().
T* sofa::gpu::cuda::CudaVector< T >::hostPointer [protected] |
Pointer to the data on the CPU side.
Definition at line 61 of file CudaTypes.h.
Referenced by sofa::gpu::cuda::CudaVector< TReal >::copyToDevice(), sofa::gpu::cuda::CudaVector< TReal >::copyToHost(), sofa::gpu::cuda::CudaVector< TReal >::getCached(), sofa::gpu::cuda::CudaVector< TReal >::hostRead(), sofa::gpu::cuda::CudaVector< TReal >::hostWrite(), sofa::gpu::cuda::CudaVector< TReal >::operator=(), sofa::gpu::cuda::CudaVector< TReal >::push_back(), sofa::gpu::cuda::CudaVector< TReal >::reserve(), sofa::gpu::cuda::CudaVector< TReal >::resize(), sofa::gpu::cuda::CudaVector< TReal >::swap(), and sofa::gpu::cuda::CudaVector< TReal >::~CudaVector().
size_type sofa::gpu::cuda::CudaVector< T >::vectorSize [protected] |
Current size of the vector.
Definition at line 58 of file CudaTypes.h.
Referenced by sofa::gpu::cuda::CudaVector< TReal >::clear(), sofa::gpu::cuda::CudaVector< TReal >::copyToDevice(), sofa::gpu::cuda::CudaVector< TReal >::copyToHost(), sofa::gpu::cuda::CudaVector< TReal >::createBuffer(), sofa::gpu::cuda::CudaVector< TReal >::empty(), sofa::gpu::cuda::CudaVector< TReal >::fastResize(), sofa::gpu::cuda::CudaVector< TReal >::operator=(), sofa::gpu::cuda::CudaVector< TReal >::reserve(), sofa::gpu::cuda::CudaVector< TReal >::resize(), sofa::gpu::cuda::CudaVector< TReal >::size(), and sofa::gpu::cuda::CudaVector< TReal >::swap().
1.5.7.1