NVBIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Methods | Public Members | Related Functions | List of all members
nvbio::DeviceVectorArray< T > Struct Template Reference

Detailed description

template< typename T>
struct nvbio::DeviceVectorArray< T >

A utility class to manage a vector of dynamically-allocated arrays

Definition at line 168 of file vector_array.h.

#include <vector_array.h>

Public Types

typedef device_tag system_tag
 
typedef VectorArrayView< T > device_view_type
 this object's plain view type More...
 
typedef VectorArrayView< T > plain_view_type
 this object's plain view type More...
 

Public Methods

 DeviceVectorArray ()
 
uint64 resize (const uint32 size, const uint32 arena, const bool do_alloc=true)
 
bool has_overflown ()
 
void clear ()
 
uint32 size () const
 
uint32 allocated_size () const
 
uint32 arena_size () const
 
DeviceVectorArrayoperator= (const DeviceVectorArray< T > &vec)
 
DeviceVectorArrayswap (DeviceVectorArray< T > &vec)
 
device_view_type device_view ()
 
plain_view_type plain_view ()
 

Public Members

thrust::device_vector< T > m_arena
 memory arena More...
 
thrust::device_vector< uint32m_index
 index of the allocated arrays More...
 
thrust::device_vector< uint32m_sizes
 sizes of the allocated arrays More...
 
thrust::device_vector< uint32m_pool
 pool counter More...
 

Related Functions

(Note that these are not member functions.)

template<typename T >
VectorArrayView< T > device_view (DeviceVectorArray< T > &vec)
 
template<typename T >
VectorArrayView< T > plain_view (DeviceVectorArray< T > &vec)
 
template<typename T >
VectorArrayView< T > plain_view (HostVectorArray< T > &vec)
 

Member Typedef Documentation

template<typename T>
typedef VectorArrayView<T> nvbio::DeviceVectorArray< T >::device_view_type

this object's plain view type

Definition at line 171 of file vector_array.h.

template<typename T>
typedef VectorArrayView<T> nvbio::DeviceVectorArray< T >::plain_view_type

this object's plain view type

Definition at line 172 of file vector_array.h.

template<typename T>
typedef device_tag nvbio::DeviceVectorArray< T >::system_tag

Definition at line 170 of file vector_array.h.

Constructor & Destructor Documentation

template<typename T>
nvbio::DeviceVectorArray< T >::DeviceVectorArray ( )
inline

constructor

Definition at line 176 of file vector_array.h.

Member Function Documentation

template<typename T>
uint32 nvbio::DeviceVectorArray< T >::allocated_size ( ) const
inline

return allocated size

Definition at line 225 of file vector_array.h.

template<typename T>
uint32 nvbio::DeviceVectorArray< T >::arena_size ( ) const
inline

return allocated size

Definition at line 229 of file vector_array.h.

template<typename T>
void nvbio::DeviceVectorArray< T >::clear ( void  )
inline

clear the pool

Definition at line 217 of file vector_array.h.

template<typename T>
device_view_type nvbio::DeviceVectorArray< T >::device_view ( )
inline

return the device view of this object

Definition at line 255 of file vector_array.h.

template<typename T>
bool nvbio::DeviceVectorArray< T >::has_overflown ( )
inline

check for overlows

Definition at line 213 of file vector_array.h.

template<typename T>
DeviceVectorArray& nvbio::DeviceVectorArray< T >::operator= ( const DeviceVectorArray< T > &  vec)
inline

copy operator

Definition at line 233 of file vector_array.h.

template<typename T>
plain_view_type nvbio::DeviceVectorArray< T >::plain_view ( )
inline

return the plain view of this object

Definition at line 267 of file vector_array.h.

template<typename T>
uint64 nvbio::DeviceVectorArray< T >::resize ( const uint32  size,
const uint32  arena,
const bool  do_alloc = true 
)
inline

resize the arena

Parameters
sizesize of the array (i.e. number of vectors)
arenasize of the memory arena
do_alloca flag to indicate whether to really perform allocations; if false, the function will just return the amount of memory needed
Returns
amount of memory allocated/needed

Definition at line 188 of file vector_array.h.

template<typename T>
uint32 nvbio::DeviceVectorArray< T >::size ( void  ) const
inline

return number of vectors

Definition at line 221 of file vector_array.h.

template<typename T>
DeviceVectorArray& nvbio::DeviceVectorArray< T >::swap ( DeviceVectorArray< T > &  vec)
inline

swap

Definition at line 244 of file vector_array.h.

Member Data Documentation

template<typename T>
thrust::device_vector<T> nvbio::DeviceVectorArray< T >::m_arena

memory arena

Definition at line 277 of file vector_array.h.

template<typename T>
thrust::device_vector<uint32> nvbio::DeviceVectorArray< T >::m_index

index of the allocated arrays

Definition at line 278 of file vector_array.h.

template<typename T>
thrust::device_vector<uint32> nvbio::DeviceVectorArray< T >::m_pool

pool counter

Definition at line 280 of file vector_array.h.

template<typename T>
thrust::device_vector<uint32> nvbio::DeviceVectorArray< T >::m_sizes

sizes of the allocated arrays

Definition at line 279 of file vector_array.h.


The documentation for this struct was generated from the following file: