MFEM  v4.6.0
Finite element discretization library
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, RAJA_HIP = 1 << 7,
  OCCA_CPU = 1 << 8, OCCA_OMP = 1 << 9, OCCA_CUDA = 1 << 10, CEED_CPU = 1 << 11,
  CEED_CUDA = 1 << 12, CEED_HIP = 1 << 13, DEBUG_DEVICE = 1 << 14
}
 In the documentation below, we use square brackets to indicate the type of the backend: host or device. More...
 
enum  {
  NUM_BACKENDS = 15, CPU_MASK = CPU | RAJA_CPU | OCCA_CPU | CEED_CPU, CUDA_MASK = CUDA | RAJA_CUDA | OCCA_CUDA | CEED_CUDA, HIP_MASK = HIP | RAJA_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 | RAJA_HIP,
  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

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 80 of file device.hpp.

◆ Id

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.

RAJA_HIP 

[device] RAJA HIP backend. Enabled when MFEM_USE_RAJA = YES and MFEM_USE_HIP = 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: