This class give a representation to a chunk or memory. More...
This class give a representation to a chunk or memory.
This class give a representation to a chunk of memory as an array of T objects
T | This is the object type |
Definition at line 26 of file memory_array.hpp.
#include <memory_array.hpp>
Public Types | |
typedef T | value_type |
type returned by this structure | |
Public Member Functions | |
void | initialize (void *ptr, size_t sz, bool init) |
Initialize the memory array. | |
size_t | size () |
return the size of the array | |
void | set_pointer (void *ptr_) |
Set the internal pointer to the indicated chunk of memory. | |
__device__ __host__ void * | get_pointer () const |
Return the pointer. | |
template<typename Tbind > | |
void | bind_ref (const memory_array< Tbind > &ref) |
Set from another memory array. | |
__host__ __device__ T & | operator[] (mem_id i) |
Access element an element of the array. | |
__host__ __device__ const T & | operator[] (mem_id i) const |
Access element an element of the array. | |
void | swap (memory_array< T > &obj) |
swap the two objects memory | |
void | deinit () |
Deinitialize the memory. | |
memory_array () | |
Default constructor. | |
memory_array (void *ptr, size_t sz, bool init) | |
Memory array constructor. | |
~memory_array () | |
Destructor. | |
Private Member Functions | |
T | get (mem_id i) |
Get the i element. | |
Private Attributes | |
T * | ptr |
Internal pointer. | |
size_t | sz |
number of elements | |
typedef T memory_array< T >::value_type |
type returned by this structure
Definition at line 60 of file memory_array.hpp.
|
inline |
Default constructor.
Definition at line 171 of file memory_array.hpp.
|
inline |
Memory array constructor.
ptr | Memory pointer |
sz | size |
init | specify if the pointer is initialized |
Definition at line 182 of file memory_array.hpp.
|
inline |
Destructor.
Definition at line 192 of file memory_array.hpp.
|
inline |
Set from another memory array.
the | other memory_array |
Definition at line 111 of file memory_array.hpp.
|
inline |
Deinitialize the memory.
Definition at line 161 of file memory_array.hpp.
|
inlineprivate |
Get the i element.
i | element |
Definition at line 51 of file memory_array.hpp.
|
inline |
Return the pointer.
Definition at line 101 of file memory_array.hpp.
|
inline |
Initialize the memory array.
ptr | pointer |
sz | number of elements in the array |
init | indicate if you have to initialize the memory |
Definition at line 71 of file memory_array.hpp.
|
inline |
Access element an element of the array.
i | element to access |
Definition at line 123 of file memory_array.hpp.
|
inline |
Access element an element of the array.
i | element to access |
Definition at line 135 of file memory_array.hpp.
|
inline |
Set the internal pointer to the indicated chunk of memory.
ptr_ | pointer |
Definition at line 95 of file memory_array.hpp.
|
inline |
return the size of the array
Definition at line 85 of file memory_array.hpp.
|
inline |
swap the two objects memory
obj | memory to swap with |
Definition at line 145 of file memory_array.hpp.
|
private |
Internal pointer.
Definition at line 37 of file memory_array.hpp.
|
private |
number of elements
Definition at line 42 of file memory_array.hpp.