Cuda::Storage< Type, Dim > Class Template Reference

Class to represent memory that can be allocated and freed. More...

#include <storage.hpp>

Inheritance diagram for Cuda::Storage< Type, Dim >:

Inheritance graph
[legend]
Collaboration diagram for Cuda::Storage< Type, Dim >:

Collaboration graph
[legend]

List of all members.

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.


Detailed Description

template<class Type, unsigned Dim>
class Cuda::Storage< Type, Dim >

Class to represent memory that can be allocated and freed.

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).


Constructor & Destructor Documentation

template<class Type, unsigned Dim>
Cuda::Storage< Type, Dim >::Storage ( const Size< Dim > &  _size  )  [inline]

Constructor.

Parameters:
_size requested size

template<class Type, unsigned Dim>
Cuda::Storage< Type, Dim >::Storage ( const Layout< Type, Dim > &  layout  )  [inline]

Constructor.

See Storage::alloc(const Layout<Type, Dim> &) for possible performance implications.

Parameters:
layout requested layout


Member Function Documentation

template<class Type, unsigned Dim>
void Cuda::Storage< Type, Dim >::alloc ( const Size< Dim > &  _size  )  [inline]

template<class Type, unsigned Dim>
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!

Parameters:
layout requested layout

template<class Type, unsigned Dim>
const Layout<Type, Dim>& Cuda::Storage< Type, Dim >::getLayout (  )  const [inline]

Get current layout.

Returns:
layout

template<class Type, unsigned Dim>
virtual void Cuda::Storage< Type, Dim >::init (  )  [pure virtual]


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

Generated on Sun Sep 13 00:55:21 2009 for cudatemplates by  doxygen 1.5.6