JDFTx  1.7.0
ManagedMemoryBase Class Reference

Base class for managed-memory objects (that could potentially live on GPUs as well) with unspecified data type. More...

#include <ManagedMemory.h>

Inheritance diagram for ManagedMemoryBase:
ManagedMemory< double > ManagedMemory< int > ManagedMemory< vector3< int > > ManagedMemory< complex > ManagedMemory< T > FieldData< double > ManagedArray< double > IndexArray IndexVecArray FieldData< complex > ManagedArray< complex > ColumnBundle matrix ManagedArray< symmetricMatrix3<> > ManagedArray< matrix3<> > ManagedArray< size_t > ManagedArray< vector3<> > ManagedArray< uint64_t > FieldData< T > ManagedArray< T >

Static Public Member Functions

static void reportUsage ()
 print memory usage report
 

Protected Member Functions

 ManagedMemoryBase ()
 Initialize a valid state, but don't allocate anything.
 
void memFree ()
 Free memory.
 
void memInit (string category, size_t nBytes, bool onGpu=false)
 Allocate memory.
 
void memMove (ManagedMemoryBase &&)
 Steal the other object's data (used for move constructors/assignment)
 
void toCpu () const
 move data to the CPU (does nothing without GPU_ENABLED); logically const, but data location may change
 
void toGpu () const
 move data to the GPU (does nothing without GPU_ENABLED); logically const, but data location may change
 

Protected Attributes

string category
 category of managed memory objects to report memory usage under
 
size_t nBytes
 Size of stored data.
 
void * c
 Actual data storage.
 
bool onGpu
 For reduced #ifdef's, this flag is retained even in the absence of gpu support.
 

Detailed Description

Base class for managed-memory objects (that could potentially live on GPUs as well) with unspecified data type.


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