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 MeshkokkosMesh () 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 629 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 636 of file KokkosMesh.h.

636: _mesh_host(mesh), _mesh_device(mesh) {}
const Mesh & _mesh_host
Host reference of the Kokkos mesh.
Definition KokkosMesh.h:669
const Mesh _mesh_device
Device copy of the Kokkos mesh.
Definition KokkosMesh.h:673

◆ MeshHolder() [2/2]

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

Copy constructor.

Definition at line 640 of file KokkosMesh.h.

641 : _mesh_host(holder._mesh_host), _mesh_device(holder._mesh_host)
642 {
643 }

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

652 {
653 KOKKOS_IF_ON_HOST(
655 "kokkosMesh() was called too early. Kokkos mesh is available after problem "
656 "initialization. Override initialSetup() if you need to setup your object data "
657 "using the Kokkos mesh.");
658
659 return _mesh_host;)
660
661 return _mesh_device;
662 }
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::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 673 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 669 of file KokkosMesh.h.

Referenced by kokkosMesh().


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