MFEM v4.7.0
Finite element discretization library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
device.hpp File Reference

Go to the source code of this file.

Classes

struct  mfem::Backend
 MFEM backends. More...
 
class  mfem::Device
 The MFEM Device class abstracts hardware devices such as GPUs, as well as programming models such as CUDA, OCCA, RAJA and OpenMP. More...
 

Namespaces

namespace  mfem
 

Functions

template<typename T >
MemoryClass mfem::GetMemoryClass (const Memory< T > &mem, bool on_dev)
 Return the memory class to be used by the functions Read(), Write(), and ReadWrite(), while setting the device use flag in mem, if on_dev is true.
 
template<typename T >
const T * mfem::Read (const Memory< T > &mem, int size, bool on_dev=true)
 Get a pointer for read access to mem with the mfem::Device's DeviceMemoryClass, if on_dev = true, or the mfem::Device's HostMemoryClass, otherwise.
 
template<typename T >
const T * mfem::HostRead (const Memory< T > &mem, int size)
 Shortcut to Read(const Memory<T> &mem, int size, false)
 
template<typename T >
T * mfem::Write (Memory< T > &mem, int size, bool on_dev=true)
 Get a pointer for write access to mem with the mfem::Device's DeviceMemoryClass, if on_dev = true, or the mfem::Device's HostMemoryClass, otherwise.
 
template<typename T >
T * mfem::HostWrite (Memory< T > &mem, int size)
 Shortcut to Write(const Memory<T> &mem, int size, false)
 
template<typename T >
T * mfem::ReadWrite (Memory< T > &mem, int size, bool on_dev=true)
 Get a pointer for read+write access to mem with the mfem::Device's DeviceMemoryClass, if on_dev = true, or the mfem::Device's HostMemoryClass, otherwise.
 
template<typename T >
T * mfem::HostReadWrite (Memory< T > &mem, int size)
 Shortcut to ReadWrite(Memory<T> &mem, int size, false)