#include <storage.hpp>
Public Member Functions | |
Storage () | |
Default constructor. | |
Storage (const Size< Dim > &_size) | |
Constructor. | |
Storage (const Layout< Type, Dim > &layout) | |
Constructor. | |
virtual | ~Storage () |
Destructor. | |
virtual void | alloc ()=0 |
Allocate memory. | |
void | alloc (const Size< Dim > &_size) |
Allocate memory. | |
void | alloc (const Layout< Type, Dim > &layout) |
Allocate memory. | |
virtual void | free ()=0 |
Free memory. | |
const Layout< Type, Dim > & | getLayout () const |
Get current layout. | |
virtual void | init ()=0 |
Initialize data structure. | |
Protected Member Functions | |
Storage (const Storage &s) | |
Copy constructor. |
This is used as a virtual base class for all types of memory for which the CUDA templates should perform their own memory management (i.e., allocation and deallocation).
Cuda::Storage< Type, Dim >::Storage | ( | const Size< Dim > & | _size | ) | [inline] |
Constructor.
_size | requested size |
Cuda::Storage< Type, Dim >::Storage | ( | const Layout< Type, Dim > & | layout | ) | [inline] |
Constructor.
See Storage::alloc(const Layout<Type, Dim> &) for possible performance implications.
layout | requested layout |
void Cuda::Storage< Type, Dim >::alloc | ( | const Size< Dim > & | _size | ) | [inline] |
Allocate memory.
_size | requested size |
Reimplemented in Cuda::Array< Type, Dim >, Cuda::DeviceMemoryLinear< Type, Dim >, Cuda::DeviceMemoryPitched< Type, Dim >, Cuda::HostMemoryHeap< Type, Dim >, Cuda::OpenGL::BufferObject< Type, Dim >, Cuda::OpenGL::Texture< Type, Dim >, Cuda::Array< Type, 1 >, Cuda::Array< Type, 2 >, Cuda::Array< Type, 3 >, Cuda::DeviceMemoryLinear< Type, 1 >, Cuda::DeviceMemoryLinear< Type, 2 >, Cuda::DeviceMemoryLinear< Type, 3 >, Cuda::DeviceMemoryPitched< Type, 1 >, Cuda::DeviceMemoryPitched< Type, 2 >, Cuda::DeviceMemoryPitched< Type, 3 >, Cuda::HostMemoryHeap< Type, 1 >, Cuda::HostMemoryHeap< Type, 2 >, Cuda::HostMemoryHeap< Type, 3 >, Cuda::OpenGL::BufferObject< Type, 1 >, Cuda::OpenGL::BufferObject< Type, 2 >, Cuda::OpenGL::BufferObject< Type, 3 >, Cuda::OpenGL::Texture< Type, 1 >, Cuda::OpenGL::Texture< Type, 2 >, and Cuda::OpenGL::Texture< Type, 3 >.
void Cuda::Storage< Type, Dim >::alloc | ( | const Layout< Type, Dim > & | layout | ) | [inline] |
Allocate memory.
This uses the requested layout regardless of constraints imposed by subclasses (such as DeviceMemoryPitched). Use with care to avoid performance penalties!
layout | requested layout |
const Layout<Type, Dim>& Cuda::Storage< Type, Dim >::getLayout | ( | ) | const [inline] |
Get current layout.
virtual void Cuda::Storage< Type, Dim >::init | ( | ) | [pure virtual] |
Initialize data structure.
Subclasses should use this method to initialize their internal data representation to a defined "empty" state.
Implemented in Cuda::Array< Type, Dim >, Cuda::DeviceMemoryStorage< Type, Dim >, Cuda::HostMemoryStorage< Type, Dim >, Cuda::PointerStorage< Type, Dim >, Cuda::OpenGL::Texture< Type, Dim >, Cuda::Array< Type, 1 >, Cuda::Array< Type, 2 >, Cuda::Array< Type, 3 >, Cuda::OpenGL::Texture< Type, 1 >, Cuda::OpenGL::Texture< Type, 2 >, and Cuda::OpenGL::Texture< Type, 3 >.