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

The Kokkos interface that holds the host reference of the Kokkos systems and copies it to device during parallel dispatch. More...

#include <KokkosSystem.h>

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

Public Member Functions

 SystemHolder (Array< System > &systems)
 Constructor. More...
 
 SystemHolder (const SystemHolder &holder)
 Copy constructor. More...
 
KOKKOS_FUNCTION const Array< System > & kokkosSystems () const
 Get the const reference of the Kokkos systems. More...
 
Array< System > & kokkosSystems ()
 Get the writeable host reference of the Kokkos systems. More...
 
KOKKOS_FUNCTION const SystemkokkosSystem (unsigned int sys) const
 Get the const reference of a Kokkos system. More...
 
SystemkokkosSystem (unsigned int sys)
 Get the writeable reference of a Kokkos system. More...
 

Private Attributes

Array< System > & _systems_host
 Host reference of the Kokkos systems. More...
 
const Array< System_systems_device
 Device copy of the Kokkos systems. More...
 

Detailed Description

The Kokkos interface that holds the host reference of the Kokkos systems and copies it to device during parallel dispatch.

Maintains synchronization between host and device Kokkos systems and provides access to the appropriate Kokkos systems depending on the architecture.

Definition at line 576 of file KokkosSystem.h.

Constructor & Destructor Documentation

◆ SystemHolder() [1/2]

Moose::Kokkos::SystemHolder::SystemHolder ( Array< System > &  systems)
inline

Constructor.

Parameters
systemsThe Kokkos systems

Definition at line 583 of file KokkosSystem.h.

583 : _systems_host(systems), _systems_device(systems) {}
const Array< System > _systems_device
Device copy of the Kokkos systems.
Definition: KokkosSystem.h:637
Array< System > & _systems_host
Host reference of the Kokkos systems.
Definition: KokkosSystem.h:633

◆ SystemHolder() [2/2]

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

Copy constructor.

Definition at line 587 of file KokkosSystem.h.

588  : _systems_host(holder._systems_host), _systems_device(holder._systems_host)
589  {
590  }
const Array< System > _systems_device
Device copy of the Kokkos systems.
Definition: KokkosSystem.h:637
Array< System > & _systems_host
Host reference of the Kokkos systems.
Definition: KokkosSystem.h:633

Member Function Documentation

◆ kokkosSystem() [1/2]

KOKKOS_FUNCTION const System& Moose::Kokkos::SystemHolder::kokkosSystem ( unsigned int  sys) const
inline

Get the const reference of a Kokkos system.

Parameters
sysThe system number
Returns
The const reference of the Kokkos system depending on the architecture this function is being called on

Definition at line 615 of file KokkosSystem.h.

Referenced by Moose::Kokkos::ResidualObject::accumulateTaggedElementalMatrix(), Moose::Kokkos::ResidualObject::accumulateTaggedElementalResidual(), Moose::Kokkos::ResidualObject::accumulateTaggedNodalMatrix(), Moose::Kokkos::ResidualObject::accumulateTaggedNodalResidual(), and Moose::Kokkos::VariableNodalValue::operator()().

616  {
617  KOKKOS_IF_ON_HOST(return _systems_host[sys];)
618 
619  return _systems_device[sys];
620  }
const Array< System > _systems_device
Device copy of the Kokkos systems.
Definition: KokkosSystem.h:637
Array< System > & _systems_host
Host reference of the Kokkos systems.
Definition: KokkosSystem.h:633

◆ kokkosSystem() [2/2]

System& Moose::Kokkos::SystemHolder::kokkosSystem ( unsigned int  sys)
inline

Get the writeable reference of a Kokkos system.

Parameters
sysThe system number
Returns
The writeable host reference of the Kokkos system

Definition at line 626 of file KokkosSystem.h.

626 { return _systems_host[sys]; }
Array< System > & _systems_host
Host reference of the Kokkos systems.
Definition: KokkosSystem.h:633

◆ kokkosSystems() [1/2]

KOKKOS_FUNCTION const Array<System>& Moose::Kokkos::SystemHolder::kokkosSystems ( ) const
inline

Get the const reference of the Kokkos systems.

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

Definition at line 598 of file KokkosSystem.h.

599  {
600  KOKKOS_IF_ON_HOST(return _systems_host;)
601 
602  return _systems_device;
603  }
const Array< System > _systems_device
Device copy of the Kokkos systems.
Definition: KokkosSystem.h:637
Array< System > & _systems_host
Host reference of the Kokkos systems.
Definition: KokkosSystem.h:633

◆ kokkosSystems() [2/2]

Array<System>& Moose::Kokkos::SystemHolder::kokkosSystems ( )
inline

Get the writeable host reference of the Kokkos systems.

Returns
The writeable host reference of the Kokkos systems

Definition at line 608 of file KokkosSystem.h.

608 { return _systems_host; }
Array< System > & _systems_host
Host reference of the Kokkos systems.
Definition: KokkosSystem.h:633

Member Data Documentation

◆ _systems_device

const Array<System> Moose::Kokkos::SystemHolder::_systems_device
private

Device copy of the Kokkos systems.

Definition at line 637 of file KokkosSystem.h.

Referenced by kokkosSystem(), and kokkosSystems().

◆ _systems_host

Array<System>& Moose::Kokkos::SystemHolder::_systems_host
private

Host reference of the Kokkos systems.

Definition at line 633 of file KokkosSystem.h.

Referenced by kokkosSystem(), and kokkosSystems().


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