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

MFEM backends. More...

#include <device.hpp>

Public Types

enum  Id : unsigned long {
  CPU = 1 << 0, OMP = 1 << 1, CUDA = 1 << 2, HIP = 1 << 3,
  RAJA_CPU = 1 << 4, RAJA_OMP = 1 << 5, RAJA_CUDA = 1 << 6, OCCA_CPU = 1 << 7,
  OCCA_OMP = 1 << 8, OCCA_CUDA = 1 << 9, CEED_CPU = 1 << 10, CEED_CUDA = 1 << 11,
  CEED_HIP = 1 << 12, DEBUG_DEVICE = 1 << 13
}
 In the documentation below, we use square brackets to indicate the type of the backend: host or device. More...
 
enum  {
  NUM_BACKENDS = 14, CPU_MASK = CPU | RAJA_CPU | OCCA_CPU | CEED_CPU, CUDA_MASK = CUDA | RAJA_CUDA | OCCA_CUDA | CEED_CUDA, HIP_MASK = HIP | CEED_HIP,
  OMP_MASK = OMP | RAJA_OMP | OCCA_OMP, CEED_MASK = CEED_CPU | CEED_CUDA | CEED_HIP, DEVICE_MASK = CUDA_MASK | HIP_MASK | DEBUG_DEVICE, RAJA_MASK = RAJA_CPU | RAJA_OMP | RAJA_CUDA,
  OCCA_MASK = OCCA_CPU | OCCA_OMP | OCCA_CUDA
}
 Additional useful constants. For example, the *_MASK constants can be used with Device::Allows(). More...
 

Detailed Description

MFEM backends.

Individual backends will generally implement only a subset of the kernels implemented by the default CPU backend. The goal of the backends is to accelerate data-parallel portions of the code and they can use a device memory space (e.g. GPUs) or share the memory space of the host (OpenMP).

Definition at line 26 of file device.hpp.

Member Enumeration Documentation

anonymous enum

Additional useful constants. For example, the *_MASK constants can be used with Device::Allows().

Enumerator
NUM_BACKENDS 

Number of backends: from (1 << 0) to (1 << (NUM_BACKENDS-1)).

CPU_MASK 

Biwise-OR of all CPU backends.

CUDA_MASK 

Biwise-OR of all CUDA backends.

HIP_MASK 

Biwise-OR of all HIP backends.

OMP_MASK 

Biwise-OR of all OpenMP backends.

CEED_MASK 

Bitwise-OR of all CEED backends.

DEVICE_MASK 

Biwise-OR of all device backends.

RAJA_MASK 

Biwise-OR of all RAJA backends.

OCCA_MASK 

Biwise-OR of all OCCA backends.

Definition at line 77 of file device.hpp.

enum mfem::Backend::Id : unsigned long

In the documentation below, we use square brackets to indicate the type of the backend: host or device.

Enumerator
CPU 

[host] Default CPU backend: sequential execution on each MPI rank.

OMP 

[host] OpenMP backend. Enabled when MFEM_USE_OPENMP = YES.

CUDA 

[device] CUDA backend. Enabled when MFEM_USE_CUDA = YES.

HIP 

[device] HIP backend. Enabled when MFEM_USE_HIP = YES.

RAJA_CPU 

[host] RAJA CPU backend: sequential execution on each MPI rank. Enabled when MFEM_USE_RAJA = YES.

RAJA_OMP 

[host] RAJA OpenMP backend. Enabled when MFEM_USE_RAJA = YES and MFEM_USE_OPENMP = YES.

RAJA_CUDA 

[device] RAJA CUDA backend. Enabled when MFEM_USE_RAJA = YES and MFEM_USE_CUDA = YES.

OCCA_CPU 

[host] OCCA CPU backend: sequential execution on each MPI rank. Enabled when MFEM_USE_OCCA = YES.

OCCA_OMP 

[host] OCCA OpenMP backend. Enabled when MFEM_USE_OCCA = YES.

OCCA_CUDA 

[device] OCCA CUDA backend. Enabled when MFEM_USE_OCCA = YES and MFEM_USE_CUDA = YES.

CEED_CPU 

[host] CEED CPU backend. GPU backends can still be used, but with expensive memory transfers. Enabled when MFEM_USE_CEED = YES.

CEED_CUDA 

[device] CEED CUDA backend working together with the CUDA backend. Enabled when MFEM_USE_CEED = YES and MFEM_USE_CUDA = YES. NOTE: The current default libCEED CUDA backend is non-deterministic!

CEED_HIP 

[device] CEED HIP backend working together with the HIP backend. Enabled when MFEM_USE_CEED = YES and MFEM_USE_HIP = YES.

DEBUG_DEVICE 

[device] Debug backend: host memory is READ/WRITE protected while a device is in use. It allows to test the "device" code-path (using separate host/device memory pools and host <-> device transfers) without any GPU hardware. As 'DEBUG' is sometimes used as a macro, _DEVICE has been added to avoid conflicts.

Definition at line 30 of file device.hpp.


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