MFEM  v4.2.0
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Static Public Member Functions | Friends | List of all members
mfem::MemoryManager Class Reference

#include <mem_manager.hpp>

Public Member Functions

 MemoryManager ()
 
 ~MemoryManager ()
 
void Init ()
 Initialize the memory manager. More...
 
void Configure (const MemoryType h_mt, const MemoryType d_mt)
 
void SetUmpireAllocatorNames (const char *h_name, const char *d_name)
 Set the host and device UMpire allocator names. More...
 
const char * GetUmpireAllocatorHostName ()
 
const char * GetUmpireAllocatorDeviceName ()
 
void Destroy ()
 Free all the device memories. More...
 
bool IsKnown (const void *h_ptr)
 Return true if the pointer is known by the memory manager. More...
 
bool IsAlias (const void *h_ptr)
 Return true if the pointer is known by the memory manager as an alias. More...
 
void RegisterCheck (void *h_ptr)
 Check if the host pointer has been registered in the memory manager. More...
 
int PrintPtrs (std::ostream &out=mfem::out)
 
int PrintAliases (std::ostream &out=mfem::out)
 

Static Public Member Functions

static MemoryType GetHostMemoryType ()
 
static MemoryType GetDeviceMemoryType ()
 

Friends

template<typename T >
class Memory
 

Detailed Description

The MFEM memory manager class. Host-side pointers are inserted into this manager which keeps track of the associated device pointer, and where the data currently resides.

Definition at line 477 of file mem_manager.hpp.

Constructor & Destructor Documentation

mfem::MemoryManager::MemoryManager ( )

Definition at line 1266 of file mem_manager.cpp.

mfem::MemoryManager::~MemoryManager ( )

Definition at line 1268 of file mem_manager.cpp.

Member Function Documentation

void mfem::MemoryManager::Configure ( const MemoryType  h_mt,
const MemoryType  d_mt 
)

Configure the Memory manager with given default host and device types This method will be called when configuring a device.

Definition at line 1270 of file mem_manager.cpp.

void mfem::MemoryManager::Destroy ( )

Free all the device memories.

Definition at line 1287 of file mem_manager.cpp.

static MemoryType mfem::MemoryManager::GetDeviceMemoryType ( )
inlinestatic

Definition at line 656 of file mem_manager.hpp.

static MemoryType mfem::MemoryManager::GetHostMemoryType ( )
inlinestatic

Definition at line 655 of file mem_manager.hpp.

const char* mfem::MemoryManager::GetUmpireAllocatorDeviceName ( )
inline

Definition at line 632 of file mem_manager.hpp.

const char* mfem::MemoryManager::GetUmpireAllocatorHostName ( )
inline

Definition at line 631 of file mem_manager.hpp.

void mfem::MemoryManager::Init ( )

Initialize the memory manager.

Definition at line 1257 of file mem_manager.cpp.

bool mfem::MemoryManager::IsAlias ( const void *  h_ptr)
inline

Return true if the pointer is known by the memory manager as an alias.

Definition at line 642 of file mem_manager.hpp.

bool mfem::MemoryManager::IsKnown ( const void *  h_ptr)
inline

Return true if the pointer is known by the memory manager.

Definition at line 639 of file mem_manager.hpp.

int mfem::MemoryManager::PrintAliases ( std::ostream &  out = mfem::out)

Prints all aliases known by the memory manager returning the number of printed pointers

Definition at line 1330 of file mem_manager.cpp.

int mfem::MemoryManager::PrintPtrs ( std::ostream &  out = mfem::out)

Prints all pointers known by the memory manager, returning the number of printed pointers

Definition at line 1315 of file mem_manager.cpp.

void mfem::MemoryManager::RegisterCheck ( void *  h_ptr)

Check if the host pointer has been registered in the memory manager.

Definition at line 1304 of file mem_manager.cpp.

void mfem::MemoryManager::SetUmpireAllocatorNames ( const char *  h_name,
const char *  d_name 
)

Set the host and device UMpire allocator names.

Definition at line 1279 of file mem_manager.cpp.

Friends And Related Function Documentation

template<typename T >
friend class Memory
friend

Definition at line 484 of file mem_manager.hpp.


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