CUV  0.9.201304091348
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Static Public 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 <tensor.hpp>

Inheritance diagram for cuv::memory< V, M >:
Inheritance graph
[legend]

Public Types

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,
index_type
reference_type
 type of reference you get using operator[]
typedef const reference< V, M,
index_type
const_reference_type
 type of reference you get using operator[]
typedef value_typepointer_type
typedef const_value_typeconst_pointer_type

Public Member Functions

pointer_type ptr ()
const_pointer_type ptr () const
size_type size () const
size_type memsize () const
void reset (pointer_type p, size_type s)
 reset information (use with care, for deserialization)
 memory ()
 default constructor (just sets ptr to NULL)
 memory (value_type *ptr, size_type size)
 construct with pointer (takes /ownership/ of this pointer and deletes it when destroyed!)
 ~memory ()
 destructor (deallocates the memory)
void dealloc ()
 dellocate space

Static Public Member Functions

typedef unconst< V >::type value_type
 type of contained values

Protected Attributes

pointer_type m_ptr
 points to allocated memory
size_type m_size
 size (for serialization)

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 179 of file tensor.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 210 of file tensor.hpp.

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

Definition at line 203 of file tensor.hpp.

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

Definition at line 205 of file tensor.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 208 of file tensor.hpp.


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