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 586 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 593 of file KokkosSystem.h.

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

◆ SystemHolder() [2/2]

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

Copy constructor.

Definition at line 597 of file KokkosSystem.h.

598  : _systems_host(holder._systems_host), _systems_device(holder._systems_host)
599  {
600  }
const Array< System > _systems_device
Device copy of the Kokkos systems.
Definition: KokkosSystem.h:647
Array< System > & _systems_host
Host reference of the Kokkos systems.
Definition: KokkosSystem.h:643

Member Function Documentation

◆ kokkosSystem() [1/2]

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

◆ 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 636 of file KokkosSystem.h.

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

◆ 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 608 of file KokkosSystem.h.

Referenced by Moose::Kokkos::AuxKernel::operator()(), Moose::Kokkos::Material::operator()(), Moose::Kokkos::NodalBC::operator()(), Moose::Kokkos::NodalKernel::operator()(), Moose::Kokkos::IntegratedBC::operator()(), and Moose::Kokkos::Kernel::operator()().

609  {
610  KOKKOS_IF_ON_HOST(return _systems_host;)
611 
612  return _systems_device;
613  }
const Array< System > _systems_device
Device copy of the Kokkos systems.
Definition: KokkosSystem.h:647
Array< System > & _systems_host
Host reference of the Kokkos systems.
Definition: KokkosSystem.h:643

◆ 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 618 of file KokkosSystem.h.

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

Member Data Documentation

◆ _systems_device

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

Device copy of the Kokkos systems.

Definition at line 647 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 643 of file KokkosSystem.h.

Referenced by kokkosSystem(), and kokkosSystems().


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