https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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.
 
 MeshHolder (const MeshHolder &holder)
 Copy constructor.
 
KOKKOS_FUNCTION const Mesh & kokkosMesh () const
 Get the const reference of the Kokkos mesh.
 

Private Attributes

const Mesh & _mesh_host
 Host reference of the Kokkos mesh.
 
const Mesh _mesh_device
 Device copy of the Kokkos mesh.
 

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 668 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 675 of file KokkosMesh.h.

675: _mesh_host(mesh), _mesh_device(mesh) {}
const Mesh & _mesh_host
Host reference of the Kokkos mesh.
Definition KokkosMesh.h:708
const Mesh _mesh_device
Device copy of the Kokkos mesh.
Definition KokkosMesh.h:712

◆ MeshHolder() [2/2]

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

Copy constructor.

Definition at line 679 of file KokkosMesh.h.

680 : _mesh_host(holder._mesh_host), _mesh_device(holder._mesh_host)
681 {
682 }

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 690 of file KokkosMesh.h.

691 {
692 KOKKOS_IF_ON_HOST(
694 "kokkosMesh() was called too early. Kokkos mesh is available after problem "
695 "initialization. Override initialSetup() if you need to setup your object data "
696 "using the Kokkos mesh.");
697
698 return _mesh_host;)
699
700 return _mesh_device;
701 }
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

Referenced by Moose::Kokkos::Assembly::computePhysicalMap(), Moose::Kokkos::Assembly::computePhysicalMap(), Moose::Kokkos::LinearFVFluxKernel::operator()(), Moose::Kokkos::LinearFVBoundaryCondition::operator()(), Moose::Kokkos::LinearFVFluxKernel::operator()(), Moose::Kokkos::LinearFVBoundaryCondition::operator()(), Moose::Kokkos::LinearFVFluxKernel::operator()(), Moose::Kokkos::LinearFVFluxKernel::operator()(), Moose::Kokkos::LinearFVElementalKernel::operator()(), Moose::Kokkos::IntegratedBC::operator()(), Moose::Kokkos::VectorIntegratedBC::operator()(), Moose::Kokkos::Kernel::operator()(), Moose::Kokkos::VectorKernel::operator()(), Moose::Kokkos::IntegratedBC::operator()(), Moose::Kokkos::Kernel::operator()(), Moose::Kokkos::LinearFVElementalKernel::operator()(), Moose::Kokkos::Datum::q_point(), and KokkosBoundNodalKernel::skipOnBoundary().

Member Data Documentation

◆ _mesh_device

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

Device copy of the Kokkos mesh.

Definition at line 712 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 708 of file KokkosMesh.h.

Referenced by kokkosMesh().


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