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

Detailed description

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

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

Definition at line 287 of file vector_array.h.

#include <vector_array.h>

Public Types

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

Public Methods

 HostVectorArray ()
 
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
 
HostVectorArrayoperator= (const DeviceVectorArray< T > &vec)
 
HostVectorArrayswap (HostVectorArray< T > &vec)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE const T * 
operator[] (const uint32 index) const
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
slot (const uint32 index) const
 
plain_view_type plain_view ()
 

Public Members

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

Member Typedef Documentation

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

this object's plain view type

Definition at line 290 of file vector_array.h.

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

Definition at line 289 of file vector_array.h.

Constructor & Destructor Documentation

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

constructor

Definition at line 294 of file vector_array.h.

Member Function Documentation

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

return allocated size

Definition at line 343 of file vector_array.h.

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

clear the pool

Definition at line 335 of file vector_array.h.

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

check for overlows

Definition at line 331 of file vector_array.h.

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

copy operator

Definition at line 347 of file vector_array.h.

template<typename T>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE const T* nvbio::HostVectorArray< T >::operator[] ( const uint32  index) const
inline

return the vector corresponding to the given index

Definition at line 370 of file vector_array.h.

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

return the plain view of this object

Definition at line 383 of file vector_array.h.

template<typename T>
uint64 nvbio::HostVectorArray< 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 306 of file vector_array.h.

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

return number of vectors

Definition at line 339 of file vector_array.h.

template<typename T>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::HostVectorArray< T >::slot ( const uint32  index) const
inline

return the slot corresponding to the given index

Definition at line 379 of file vector_array.h.

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

swap

Definition at line 358 of file vector_array.h.

Member Data Documentation

template<typename T>
thrust::host_vector<T> nvbio::HostVectorArray< T >::m_arena

memory arena

Definition at line 393 of file vector_array.h.

template<typename T>
thrust::host_vector<uint32> nvbio::HostVectorArray< T >::m_index

index of the allocated arrays

Definition at line 394 of file vector_array.h.

template<typename T>
thrust::host_vector<uint32> nvbio::HostVectorArray< T >::m_pool

pool counter

Definition at line 396 of file vector_array.h.

template<typename T>
thrust::host_vector<uint32> nvbio::HostVectorArray< T >::m_sizes

sizes of the allocated arrays

Definition at line 395 of file vector_array.h.


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