curfil  ..
 All Classes Functions Variables Typedefs Friends Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
cuv::memory< V, M > Class Template Reference

simply keeps a pointer and deallocates it when destroyed More...

#include <memory.hpp>

Inheritance diagram for cuv::memory< V, M >:
cuv::linear_memory< V, M > cuv::pitched_memory< V, M >

Public Types

typedef unconst< V >::type value_type
 type of contained values
typedef const V const_value_type
 const version of value_type
typedef M memory_space_type
 host or dev memory_space
typedef unsigned int size_type
 type of shapes
typedef int index_type
 how to index values
typedef reference< V, M > reference_type
 type of reference you get using operator[]
typedef const reference< V, M > const_reference_type
 type of reference you get using operator[]

Public Member Functions

V * ptr ()
const V * ptr () const
size_type size () const
size_type memsize () const
void reset (V *p, size_type s)
 reset information (use with care, for deserialization)
 memory (const boost::shared_ptr< allocator > &_allocator)
 default constructor (just sets ptr to NULL)
 memory (value_type *ptr, size_type size, const boost::shared_ptr< allocator > &_allocator, bool owned=true)
 construct with pointer (takes /ownership/ of this pointer and deletes it when destroyed!)
 ~memory ()
 destructor (deallocates the memory)
void dealloc ()
 dellocate space
template<class value_type2 , class memory_space >
void copy_from (V *dst, const value_type2 *src, size_t size, memory_space m, cudaStream_t stream)
template<class value_type2 , class memory_space >
void copy_from (const value_type2 *src, size_t size, memory_space m, cudaStream_t stream)
template<class value_type2 , class memory_space >
void copy2d_from (V *dst, const value_type2 *src, size_t dpitch, size_t spitch, size_t h, size_t w, memory_space m, cudaStream_t stream)
template<class value_type2 , class memory_space >
void copy2d_from (const value_type2 *src, size_t dpitch, size_t spitch, size_t h, size_t w, memory_space m, cudaStream_t stream)

Protected Member Functions

void check_size_limit (size_t size) const

Protected Attributes

V * m_ptr
 points to allocated memory
size_type m_size
 size (for serialization)
boost::shared_ptr< allocatorm_allocator
 how stored memory was allocated
bool m_owned
 flag is this instance owns the memory (m_ptr) and is responsibly for destroying

Friends

class boost::serialization::access

Detailed Description

template<class V, class M>
class cuv::memory< V, M >

simply keeps a pointer and deallocates it when destroyed

Definition at line 105 of file memory.hpp.

Member Function Documentation

template<class V, class M>
size_type cuv::memory< V, M >::memsize ( ) const
inline
Returns
number of stored bytes

Reimplemented in cuv::pitched_memory< V, M >.

Definition at line 155 of file memory.hpp.

template<class V, class M>
V* cuv::memory< V, M >::ptr ( )
inline
Returns
pointer to allocated memory

Definition at line 140 of file memory.hpp.

template<class V, class M>
const V* cuv::memory< V, M >::ptr ( ) const
inline
Returns
pointer to allocated memory (const)

Definition at line 145 of file memory.hpp.

template<class V, class M>
size_type cuv::memory< V, M >::size ( ) const
inline
Returns
number of stored elements

Reimplemented in cuv::pitched_memory< V, M >.

Definition at line 150 of file memory.hpp.


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