https://mooseframework.inl.gov
Public Member Functions | Private Attributes | List of all members
Moose::Kokkos::MeshHolder Class Reference

The Kokkos interface that holds the host reference of the Kokkos mesh and copies it to device during parallel dispatch Maintains synchronization between host and device Kokkos mesh and provides access to the appropriate Kokkos mesh depending on the architecture. More...

#include <KokkosMesh.h>

Inheritance diagram for Moose::Kokkos::MeshHolder:
[legend]

Public Member Functions

 MeshHolder (const Mesh &mesh)
 Constructor. More...
 
 MeshHolder (const MeshHolder &holder)
 Copy constructor. More...
 
KOKKOS_FUNCTION const MeshkokkosMesh () const
 Get the const reference of the Kokkos mesh. More...
 

Private Attributes

const Mesh_mesh_host
 Host reference of the Kokkos mesh. More...
 
const Mesh _mesh_device
 Device copy of the Kokkos mesh. More...
 

Detailed Description

The Kokkos interface that holds the host reference of the Kokkos mesh and copies it to device during parallel dispatch Maintains synchronization between host and device Kokkos mesh and provides access to the appropriate Kokkos mesh depending on the architecture.

Definition at line 430 of file KokkosMesh.h.

Constructor & Destructor Documentation

◆ MeshHolder() [1/2]

Moose::Kokkos::MeshHolder::MeshHolder ( const Mesh mesh)
inline

Constructor.

Parameters
meshThe Kokkos mesh

Definition at line 437 of file KokkosMesh.h.

437 : _mesh_host(mesh), _mesh_device(mesh) {}
const Mesh _mesh_device
Device copy of the Kokkos mesh.
Definition: KokkosMesh.h:474
const Mesh & _mesh_host
Host reference of the Kokkos mesh.
Definition: KokkosMesh.h:470

◆ MeshHolder() [2/2]

Moose::Kokkos::MeshHolder::MeshHolder ( const MeshHolder holder)
inline

Copy constructor.

Definition at line 441 of file KokkosMesh.h.

442  : _mesh_host(holder._mesh_host), _mesh_device(holder._mesh_host)
443  {
444  }
const Mesh _mesh_device
Device copy of the Kokkos mesh.
Definition: KokkosMesh.h:474
const Mesh & _mesh_host
Host reference of the Kokkos mesh.
Definition: KokkosMesh.h:470

Member Function Documentation

◆ kokkosMesh()

KOKKOS_FUNCTION const Mesh& Moose::Kokkos::MeshHolder::kokkosMesh ( ) const
inline

Get the const reference of the Kokkos mesh.

Returns
The const reference of the Kokkos mesh depending on the architecture this function is being called on

Definition at line 452 of file KokkosMesh.h.

Referenced by Moose::Kokkos::Assembly::computePhysicalMap(), Moose::Kokkos::Kernel::operator()(), Moose::Kokkos::IntegratedBC::operator()(), Moose::Kokkos::Datum::q_point(), and KokkosBoundNodalKernel::skipOnBoundary().

453  {
454  KOKKOS_IF_ON_HOST(
456  "kokkosMesh() was called too early. Kokkos mesh is available after problem "
457  "initialization. Override initialSetup() if you need to setup your object data "
458  "using the Kokkos mesh.");
459 
460  return _mesh_host;)
461 
462  return _mesh_device;
463  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
bool initialized() const
Get whether the mesh was initialized.
Definition: KokkosMesh.h:68
const Mesh _mesh_device
Device copy of the Kokkos mesh.
Definition: KokkosMesh.h:474
const Mesh & _mesh_host
Host reference of the Kokkos mesh.
Definition: KokkosMesh.h:470

Member Data Documentation

◆ _mesh_device

const Mesh Moose::Kokkos::MeshHolder::_mesh_device
private

Device copy of the Kokkos mesh.

Definition at line 474 of file KokkosMesh.h.

Referenced by kokkosMesh().

◆ _mesh_host

const Mesh& Moose::Kokkos::MeshHolder::_mesh_host
private

Host reference of the Kokkos mesh.

Definition at line 470 of file KokkosMesh.h.

Referenced by kokkosMesh().


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