Base class for managed-memory objects (that could potentially live on GPUs as well) with unspecified data type. More...
#include <ManagedMemory.h>
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. | |
Base class for managed-memory objects (that could potentially live on GPUs as well) with unspecified data type.