https://mooseframework.inl.gov
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
Moose::Kokkos Namespace Reference

Namespaces

 Utils
 

Classes

class  ADIntegratedBC
 The base class for a user to derive their own Kokkos integrated boundary conditions using automatic differentiation (AD). More...
 
class  ADKernel
 The base class for a user to derive their own Kokkos kernels using automatic differentiation (AD). More...
 
class  ADNodalBC
 The base class for a user to derive their own Kokkos nodal boundary conditions using automatic differentiation (AD). More...
 
class  ADTimeKernel
 The base class for Kokkos time-derivative kernels. More...
 
class  Array
 The Kokkos array class. More...
 
class  Array< T, 1, index_type, LayoutType::LEFT >
 
class  ArrayBase
 The base class for Kokkos arrays. More...
 
struct  ArrayDeepCopy
 The type trait that determines the default behavior of copy constructor and deepCopy() If this type trait is set to true, the copy constructor will call deepCopy(), and the deepCopy() method will copy-construct each entry. More...
 
struct  ArrayDeepCopy< ADVariableGradient >
 
struct  ArrayDeepCopy< ADVariableValue >
 
struct  ArrayDeepCopy< Array< T, dimension, index_type, layout > >
 
struct  ArrayDeepCopy< MaterialProperty< T, dimension > >
 
struct  ArrayDeepCopy< ReferenceWrapper< T > >
 
struct  ArrayDeepCopy< Scalar< T > >
 
class  Assembly
 The Kokkos assembly class. More...
 
class  AssemblyDatum
 The Kokkos object that holds thread-private data in the parallel operations of Kokkos kernels. More...
 
class  AssemblyHolder
 The Kokkos interface that holds the host reference of the Kokkos assembly and copies it to device during parallel dispatch. More...
 
class  AuxKernel
 The base class for a user to derive their own Kokkos auxiliary kernels. More...
 
class  BoundaryCondition
 The base class for Kokkos boundary conditions. More...
 
class  Datum
 The Kokkos object that holds thread-private data in the parallel operations of any Kokkos object. More...
 
class  DirichletBCBaseTempl
 The base Kokkos boundary condition of a Dirichlet type. More...
 
class  Dispatcher
 Class that dispatches a parallel loop operation of a Kokkos functor. More...
 
class  DispatcherBase
 Base class for Kokkos functor dispatcher. More...
 
class  DispatcherRegistry
 Class that registers dispatchers of all Kokkos functors. More...
 
class  DispatcherRegistryEntry
 Class that stores the information of a dispatcher and builds it. More...
 
class  DispatcherRegistryEntryBase
 Base class for dispatcher registry entry. More...
 
struct  ElementInfo
 The Kokkos object that contains the information of an element The IDs used in Kokkos are different from the MOOSE or libMesh IDs The Kokkos IDs start from zero in each process and are contiguous. More...
 
class  ElementPostprocessor
 
class  ElementReducer
 
class  ElementReporter
 
class  ElementUserObject
 
class  ElementVectorPostprocessor
 
class  Function
 The abstract class that provides polymorphic interfaces for a function. More...
 
class  FunctionBase
 The base class for a user to derive their own Kokkos functions. More...
 
class  FunctionRegistryEntry
 
class  FunctionRegistryEntryBase
 
class  FunctionWrapperDevice
 Device function wrapper class that provides polymorphic interfaces for a function. More...
 
class  FunctionWrapperDeviceBase
 Base class for device function wrapper. More...
 
class  FunctionWrapperHost
 Host function wrapper class that allocates a function on device and creates its device wrapper. More...
 
class  FunctionWrapperHostBase
 Base class for host function wrapper. More...
 
class  FunctorCopy
 
class  FunctorRegistry
 
class  FunctorRegistryEntry
 
class  FunctorRegistryEntryBase
 
class  FunctorWrapperDevice
 Device functor wrapper class that provides polymorphic interfaces for a functor. More...
 
class  FunctorWrapperDeviceBase
 Base class for device functor wrapper. More...
 
class  FunctorWrapperHost
 Host functor wrapper class that allocates a functor on device and creates its device wrapper. More...
 
class  FunctorWrapperHostBase
 Base class for host functor wrapper. More...
 
class  GeneralPostprocessor
 
class  GeneralReporter
 
class  GeneralUserObject
 
class  GeneralVectorPostprocessor
 
class  IntegratedBC
 The base class for a user to derive their own Kokkos integrated boundary conditions. More...
 
class  IntegratedBCBase
 The base class for Kokkos integrated boundary conditions. More...
 
class  IntegratedBCValue
 The base class for a user to derive their own Kokkos integrated boundary conditions where the residual is of the form. More...
 
struct  is_kokkos_array
 The type trait that determines if a template type is Kokkos array. More...
 
struct  is_kokkos_array< Array< T, dimension, index_type, layout > >
 
struct  is_scalar
 
struct  is_scalar< Scalar< T, Enable > >
 
class  JaggedArray
 The Kokkos jagged array class. More...
 
class  JaggedArrayInnerData
 The inner array wrapper class. More...
 
struct  JaggedArrayInnerDim
 A simple object holding the dimension information of an inner array. More...
 
class  Kernel
 The base class for a user to derive their own Kokkos kernels. More...
 
class  KernelBase
 The base class for Kokkos kernels. More...
 
class  KernelGrad
 The base class for a user to derive their own Kokkos kernels where the residual is of the form. More...
 
class  KernelValue
 The base class for a user to derive their own Kokkos kernels where the residual is of the form. More...
 
class  LocalParallelInterface
 Interface class for controlling local DOF parallelization of kernels and integrated BCs. More...
 
class  MapBase
 The Kokkos wrapper class for standard map. More...
 
class  Material
 The base class for a user to derive their own Kokkos materials. More...
 
class  MaterialBase
 The base class for Kokkos materials. More...
 
class  MaterialProperty
 The Kokkos material property class. More...
 
class  MaterialPropertyBase
 The base class for Kokkos material properties. More...
 
class  MaterialPropertyStorage
 The Kokkos class responsible for allocating and storing Kokkos material properties. More...
 
class  MaterialPropertyValue
 
class  MaterialPropertyValue< T, 0 >
 
class  MaterialPropertyValueBase
 The Kokkos wrapper class for accessing the material property values of a single quadrature point. More...
 
class  Matrix
 The Kokkos wrapper class for PETSc matrix. More...
 
class  MemoryChunk
 A temporary object returned by the Kokkos memory pool during memory chunk allocation. More...
 
class  MemoryPool
 The Kokkos class that manages memory pool for dynamically-sized temporary arrays in Kokkos parallel functions. More...
 
class  MemoryPoolHolder
 The Kokkos interface that holds the Kokkos memory pool. More...
 
class  Mesh
 The Kokkos mesh object. More...
 
class  MeshHolder
 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...
 
class  NodalBC
 The base class for a user to derive their own Kokkos nodal boundary conditions. More...
 
class  NodalBCBase
 The base class for Kokkos nodal boundary conditions. More...
 
class  NodalKernel
 The base class for a user to derive their own Kokkos nodal kernels. More...
 
class  NodalKernelBase
 The base class for Kokkos nodal kernels. More...
 
class  NodalPostprocessor
 
class  NodalReducer
 
class  NodalReporter
 
class  NodalUserObject
 
class  NodalVectorPostprocessor
 
struct  Pair
 
class  ParsedObjectBase
 
class  PEGParser
 Parsing Expression Grammar (PEG) More...
 
class  Postprocessor
 
struct  PropRecord
 A structure storing the metadata of Kokkos material properties. More...
 
struct  Real33
 
class  Reducer
 Class that dispatches a parallel reduction operation of a Kokkos functor. More...
 
class  ReducerBase
 
class  ReducerRegistryEntry
 
class  ReferenceWrapper
 The Kokkos object that can hold the reference of a variable. More...
 
class  Reporter
 
class  ResidualObject
 The base class for Kokkos residual objects. More...
 
class  RPNBuilder
 Reverse Polish Notation (RPN) builder. More...
 
class  RPNEvaluator
 Reverse Polish Notation (RPN) evaluator. More...
 
class  Scalar
 The Kokkos wrapper class that can hold the reference of an arithmetic scalar variable. More...
 
class  SidePostprocessor
 
class  SideReducer
 
class  SideReporter
 
class  SideUserObject
 
class  SideVectorPostprocessor
 
class  System
 The Kokkos system class. More...
 
class  SystemHolder
 The Kokkos interface that holds the host reference of the Kokkos systems and copies it to device during parallel dispatch. More...
 
class  Thread
 The Kokkos thread object that aids in converting the one-dimensional thread index into multi-dimensional thread indices. More...
 
class  TimeKernel
 The base class for Kokkos time-derivative kernels. More...
 
class  TimeNodalKernel
 The base class for Kokkos time-derivative nodal kernels. More...
 
class  UserObject
 
class  Variable
 The Kokkos variable object that carries the coupled variable and tag information. More...
 
class  VariableGradientTempl
 
class  VariablePhiGradient
 
class  VariablePhiValue
 The Kokkos wrapper classes for MOOSE-like shape function access. More...
 
class  VariableTestGradient
 
class  VariableTestValue
 
class  VariableValueTempl
 The Kokkos wrapper classes for MOOSE-like variable value access. More...
 
class  Vector
 The Kokkos wrapper class for PETSc vector. More...
 
struct  Vector3
 
class  VectorPostprocessor
 

Typedefs

template<typename T , typename index_type = MOOSE_KOKKOS_INDEX_TYPE>
using Array1D = Array< T, 1, index_type, LayoutType::LEFT >
 
template<typename T , typename index_type = MOOSE_KOKKOS_INDEX_TYPE, LayoutType layout = LayoutType::LEFT>
using Array2D = Array< T, 2, index_type, layout >
 
template<typename T , typename index_type = MOOSE_KOKKOS_INDEX_TYPE, LayoutType layout = LayoutType::LEFT>
using Array3D = Array< T, 3, index_type, layout >
 
template<typename T , typename index_type = MOOSE_KOKKOS_INDEX_TYPE, LayoutType layout = LayoutType::LEFT>
using Array4D = Array< T, 4, index_type, layout >
 
template<typename T , typename index_type = MOOSE_KOKKOS_INDEX_TYPE, LayoutType layout = LayoutType::LEFT>
using Array5D = Array< T, 5, index_type, layout >
 
using Policy = ::Kokkos::RangePolicy< ExecSpace, ::Kokkos::IndexType< ThreadID > >
 
template<typename T1 , typename T2 >
using Map = MapBase< T1, T2, std::map >
 
template<typename T1 , typename T2 >
using UnorderedMap = MapBase< T1, T2, std::unordered_map >
 
using PostprocessorValue = Scalar< const PostprocessorValue >
 
using ThreadID = MOOSE_KOKKOS_INDEX_TYPE
 
using Real3 = Vector3< Real >
 
using ADReal3 = Vector3< ADReal >
 
typedef DirichletBCBaseTempl< false > DirichletBCBase
 
typedef DirichletBCBaseTempl< true > ADDirichletBCBase
 
using StorageKey = Moose::PassKey< MaterialPropertyStorage >
 
using PropertyStore = std::function< void(std::ostream &, void *)>
 
using PropertyLoad = std::function< void(std::istream &, void *)>
 
typedef KokkosSemiDynamicSparseNumberArray< Real, libMesh::dof_id_type, NWrapper< MOOSE_AD_MAX_DOFS_PER_ELEM > > DNDerivativeType
 
template<std::size_t N>
using DNDerivativeSize = KokkosSemiDynamicSparseNumberArray< Real, libMesh::dof_id_type, NWrapper< N > >
 
typedef DualNumber< Real, DNDerivativeType, false > ADReal
 
using ADVariablePhiValue = VariablePhiValue
 
using ADVariablePhiGradient = VariablePhiGradient
 
using ADVariableTestValue = VariableTestValue
 
using ADVariableTestGradient = VariableTestGradient
 
using VariableValue = VariableValueTempl< false >
 
using ADVariableValue = VariableValueTempl< true >
 
using VariableGradient = VariableGradientTempl< false >
 
using ADVariableGradient = VariableGradientTempl< true >
 

Enumerations

enum  MemcpyType { MemcpyType::HOST_TO_HOST, MemcpyType::HOST_TO_DEVICE, MemcpyType::DEVICE_TO_HOST, MemcpyType::DEVICE_TO_DEVICE }
 The enumerator that dictates the memory copy direction. More...
 
enum  LayoutType { LayoutType::LEFT, LayoutType::RIGHT }
 The enumerator that dictates the memory layout. More...
 
enum  PropertyConstantOption { PropertyConstantOption::NONE, PropertyConstantOption::ELEMENT, PropertyConstantOption::SUBDOMAIN }
 Property constant options. More...
 

Functions

void free (void *ptr)
 
template<typename T >
void copyToDeviceInner (T &)
 
template<typename T , unsigned int dimension, typename index_type , LayoutType layout>
void copyToDeviceInner (Array< T, dimension, index_type, layout > &data)
 
template<typename T , unsigned int dimension, typename index_type , LayoutType layout>
void dataStore (std::ostream &stream, Array< T, dimension, index_type, layout > &array, void *context)
 
template<typename T , unsigned int dimension, typename index_type , LayoutType layout>
void dataLoad (std::istream &stream, Array< T, dimension, index_type, layout > &array, void *context)
 
template<typename T >
KOKKOS_FUNCTION uint32_t fnv1aHash (const T &key, uint32_t hash)
 
template<typename T >
KOKKOS_FUNCTION uint32_t fnv1aHash (const T &key)
 
template<typename T1 , typename T2 >
KOKKOS_FUNCTION uint32_t fnv1aHash (const Pair< T1, T2 > &key)
 
template<typename T1 , typename T2 , template< typename... > class MapType>
void dataStore (std::ostream &stream, MapBase< T1, T2, MapType > &map, void *context)
 
template<typename T1 , typename T2 , template< typename... > class MapType>
void dataLoad (std::istream &stream, MapBase< T1, T2, MapType > &map, void *context)
 
template<typename T , typename U , typename = typename std::enable_if<!is_scalar<typename std::decay<T>::type>::value>::type>
KOKKOS_SCALAR_FUNCTION auto operator+ (const T &left, const Scalar< U > &right) -> decltype(left+static_cast< const U &>(right))
 
template<typename T , typename U , typename = typename std::enable_if<!is_scalar<typename std::decay<T>::type>::value>::type>
KOKKOS_SCALAR_FUNCTION auto operator- (const T &left, const Scalar< U > &right) -> decltype(left - static_cast< const U &>(right))
 
template<typename T , typename U , typename = typename std::enable_if<!is_scalar<typename std::decay<T>::type>::value>::type>
KOKKOS_SCALAR_FUNCTION auto operator* (const T &left, const Scalar< U > &right) -> decltype(left *static_cast< const U &>(right))
 
template<typename T , typename U , typename = typename std::enable_if<!is_scalar<typename std::decay<T>::type>::value>::type>
KOKKOS_SCALAR_FUNCTION auto operator/ (const T &left, const Scalar< U > &right) -> decltype(left/static_cast< const U &>(right))
 
template<typename T , typename U , typename = typename std::enable_if<!is_scalar<typename std::decay<T>::type>::value>::type>
KOKKOS_SCALAR_FUNCTION auto operator% (const T &left, const Scalar< U > &right) -> decltype(left % static_cast< const U &>(right))
 
template<typename T >
KOKKOS_INLINE_FUNCTION Vector3< T > operator+ (const T &left, const Vector3< T > &right)
 
template<typename T >
KOKKOS_INLINE_FUNCTION Vector3< T > operator+ (const Vector3< T > &left, const T &right)
 
template<typename T >
KOKKOS_INLINE_FUNCTION Vector3< T > operator+ (const Vector3< T > &left, const Vector3< T > &right)
 
template<typename T >
KOKKOS_INLINE_FUNCTION Vector3< T > operator- (const T &left, const Vector3< T > &right)
 
template<typename T >
KOKKOS_INLINE_FUNCTION Vector3< T > operator- (const Vector3< T > &left, const T &right)
 
template<typename T >
KOKKOS_INLINE_FUNCTION Vector3< T > operator- (const Vector3< T > &left, const Vector3< T > &right)
 
template<typename T >
KOKKOS_INLINE_FUNCTION Vector3< T > operator* (const T &left, const Vector3< T > &right)
 
template<typename T >
KOKKOS_INLINE_FUNCTION Vector3< T > operator* (const Vector3< T > &left, const T &right)
 
template<typename T >
KOKKOS_INLINE_FUNCTION T operator* (const Vector3< T > &left, const Vector3< T > &right)
 
KOKKOS_INLINE_FUNCTION Real3 operator* (const Real33 left, const Real3 right)
 
KOKKOS_INLINE_FUNCTION Real33 operator* (const Real33 left, const Real33 right)
 
KOKKOS_INLINE_FUNCTION Real3 operator+ (const Real left, const Real3 right)
 
KOKKOS_INLINE_FUNCTION Real3 operator+ (const Real3 left, const Real right)
 
KOKKOS_INLINE_FUNCTION Real3 operator- (const Real left, const Real3 right)
 
KOKKOS_INLINE_FUNCTION Real3 operator- (const Real3 left, const Real right)
 
KOKKOS_INLINE_FUNCTION Real3 operator* (const Real left, const Real3 right)
 
KOKKOS_INLINE_FUNCTION Real3 operator* (const Real3 left, const Real right)
 
template<typename T , typename = typename std::enable_if< std::is_same<typename std::decay<T>::type, ADReal>::value>::type>
KOKKOS_INLINE_FUNCTION ADReal3 operator* (const Real3 left, const T &right)
 
template<typename T , typename = typename std::enable_if< std::is_same<typename std::decay<T>::type, ADReal>::value>::type>
KOKKOS_INLINE_FUNCTION ADReal3 operator* (const T &left, const Real3 right)
 
KOKKOS_INLINE_FUNCTION ADReal operator* (const Real3 left, const ADReal3 &right)
 
KOKKOS_INLINE_FUNCTION ADReal operator* (const ADReal3 &left, const Real3 right)
 
template<typename T1 , typename T2 >
bool operator< (const Pair< T1, T2 > &left, const Pair< T1, T2 > &right)
 
template<typename T , unsigned int dimension>
void propertyStore (std::ostream &stream, void *prop)
 
template<typename T , unsigned int dimension>
void propertyLoad (std::istream &stream, void *prop)
 

Variables

constexpr unsigned int MAX_TAG = 30
 Maximum tag ID. More...
 
constexpr unsigned int MAX_CACHED_DOF = 30
 Maximum number of DOFs to cache during residual and Jacobian computation. More...
 
constexpr uint32_t FNV_PRIME = 0x01000193
 
constexpr uint32_t FNV_OFFSET_BASIS = 0x811C9DC5
 

Typedef Documentation

◆ ADDirichletBCBase

Definition at line 113 of file KokkosDirichletBCBase.h.

◆ ADReal

typedef DualNumber<Real, DNDerivativeType, false> Moose::Kokkos::ADReal

Definition at line 28 of file KokkosADReal.h.

◆ ADReal3

Definition at line 32 of file KokkosTypes.h.

◆ ADVariableGradient

Definition at line 539 of file KokkosVariableValue.h.

◆ ADVariablePhiGradient

Definition at line 114 of file KokkosVariableValue.h.

◆ ADVariablePhiValue

Definition at line 113 of file KokkosVariableValue.h.

◆ ADVariableTestGradient

Definition at line 116 of file KokkosVariableValue.h.

◆ ADVariableTestValue

Definition at line 115 of file KokkosVariableValue.h.

◆ ADVariableValue

Definition at line 537 of file KokkosVariableValue.h.

◆ Array1D

template<typename T , typename index_type = MOOSE_KOKKOS_INDEX_TYPE>
using Moose::Kokkos::Array1D = typedef Array<T, 1, index_type, LayoutType::LEFT>

Definition at line 1640 of file KokkosArray.h.

◆ Array2D

template<typename T , typename index_type = MOOSE_KOKKOS_INDEX_TYPE, LayoutType layout = LayoutType::LEFT>
using Moose::Kokkos::Array2D = typedef Array<T, 2, index_type, layout>

Definition at line 1644 of file KokkosArray.h.

◆ Array3D

template<typename T , typename index_type = MOOSE_KOKKOS_INDEX_TYPE, LayoutType layout = LayoutType::LEFT>
using Moose::Kokkos::Array3D = typedef Array<T, 3, index_type, layout>

Definition at line 1648 of file KokkosArray.h.

◆ Array4D

template<typename T , typename index_type = MOOSE_KOKKOS_INDEX_TYPE, LayoutType layout = LayoutType::LEFT>
using Moose::Kokkos::Array4D = typedef Array<T, 4, index_type, layout>

Definition at line 1652 of file KokkosArray.h.

◆ Array5D

template<typename T , typename index_type = MOOSE_KOKKOS_INDEX_TYPE, LayoutType layout = LayoutType::LEFT>
using Moose::Kokkos::Array5D = typedef Array<T, 5, index_type, layout>

Definition at line 1656 of file KokkosArray.h.

◆ DirichletBCBase

Definition at line 112 of file KokkosDirichletBCBase.h.

◆ DNDerivativeSize

template<std::size_t N>
using Moose::Kokkos::DNDerivativeSize = typedef KokkosSemiDynamicSparseNumberArray<Real, libMesh::dof_id_type, NWrapper<N> >

Definition at line 26 of file KokkosADReal.h.

◆ DNDerivativeType

typedef KokkosSemiDynamicSparseNumberArray<Real, libMesh::dof_id_type, NWrapper<MOOSE_AD_MAX_DOFS_PER_ELEM> > Moose::Kokkos::DNDerivativeType

Definition at line 22 of file KokkosADReal.h.

◆ Map

template<typename T1 , typename T2 >
using Moose::Kokkos::Map = typedef MapBase<T1, T2, std::map>

Definition at line 360 of file KokkosMap.h.

◆ Policy

using Moose::Kokkos::Policy = typedef ::Kokkos::RangePolicy<ExecSpace, ::Kokkos::IndexType<ThreadID> >

Definition at line 20 of file KokkosDispatcher.h.

◆ PostprocessorValue

Definition at line 308 of file KokkosScalar.h.

◆ PropertyLoad

using Moose::Kokkos::PropertyLoad = typedef std::function<void(std::istream &, void *)>

Definition at line 87 of file KokkosMaterialPropertyDecl.h.

◆ PropertyStore

using Moose::Kokkos::PropertyStore = typedef std::function<void(std::ostream &, void *)>

Definition at line 86 of file KokkosMaterialPropertyDecl.h.

◆ Real3

using Moose::Kokkos::Real3 = typedef Vector3<Real>

Definition at line 31 of file KokkosTypes.h.

◆ StorageKey

Definition at line 25 of file KokkosMaterialPropertyDecl.h.

◆ ThreadID

using Moose::Kokkos::ThreadID = typedef MOOSE_KOKKOS_INDEX_TYPE

Definition at line 22 of file KokkosThread.h.

◆ UnorderedMap

template<typename T1 , typename T2 >
using Moose::Kokkos::UnorderedMap = typedef MapBase<T1, T2, std::unordered_map>

Definition at line 363 of file KokkosMap.h.

◆ VariableGradient

Definition at line 538 of file KokkosVariableValue.h.

◆ VariableValue

Definition at line 536 of file KokkosVariableValue.h.

Enumeration Type Documentation

◆ LayoutType

The enumerator that dictates the memory layout.

Enumerator
LEFT 
RIGHT 

Definition at line 51 of file KokkosArray.h.

◆ MemcpyType

The enumerator that dictates the memory copy direction.

Enumerator
HOST_TO_HOST 
HOST_TO_DEVICE 
DEVICE_TO_HOST 
DEVICE_TO_DEVICE 

Definition at line 40 of file KokkosArray.h.

◆ PropertyConstantOption

Property constant options.

Enumerator
NONE 
ELEMENT 
SUBDOMAIN 

Definition at line 40 of file KokkosMaterialPropertyDecl.h.

Function Documentation

◆ copyToDeviceInner() [1/2]

template<typename T >
void Moose::Kokkos::copyToDeviceInner ( T &  )

◆ copyToDeviceInner() [2/2]

template<typename T , unsigned int dimension, typename index_type , LayoutType layout>
void Moose::Kokkos::copyToDeviceInner ( Array< T, dimension, index_type, layout > &  data)

Definition at line 1144 of file KokkosArray.h.

1145 {
1146  data.copyToDeviceNested();
1147 }

◆ dataLoad() [1/2]

template<typename T1 , typename T2 , template< typename... > class MapType>
void Moose::Kokkos::dataLoad ( std::istream &  stream,
MapBase< T1, T2, MapType > &  map,
void context 
)

Definition at line 348 of file KokkosMap.h.

349 {
351 
352  dataLoad(stream, map.get(), context);
353  dataLoad(stream, map._keys, context);
354  dataLoad(stream, map._values, context);
355  dataLoad(stream, map._offset, context);
356 }
void dataLoad(std::istream &stream, MapBase< T1, T2, MapType > &map, void *context)
Definition: KokkosMap.h:348

◆ dataLoad() [2/2]

template<typename T , unsigned int dimension, typename index_type , LayoutType layout>
void Moose::Kokkos::dataLoad ( std::istream &  stream,
Array< T, dimension, index_type, layout > &  array,
void context 
)

Definition at line 1269 of file KokkosArray.h.

Referenced by dataLoad(), and propertyLoad().

1270 {
1272 
1273  bool is_alloc;
1274  dataLoad(stream, is_alloc, nullptr);
1275 
1276  if (!is_alloc)
1277  return;
1278 
1279  std::string from_type_name;
1280  dataLoad(stream, from_type_name, nullptr);
1281 
1282  if (from_type_name != typeid(T).name())
1283  mooseError("Kokkos array error: cannot load array because the stored array is of type '",
1284  MooseUtils::prettyCppType(libMesh::demangle(from_type_name.c_str())),
1285  "' but the loading array is of type '",
1287  "'.");
1288 
1289  unsigned int from_dimension;
1290  dataLoad(stream, from_dimension, nullptr);
1291 
1292  if (from_dimension != dimension)
1293  mooseError("Kokkos array error: cannot load array because the stored array is ",
1294  from_dimension,
1295  "D but the loading array is ",
1296  dimension,
1297  "D.");
1298 
1299  std::vector<index_type> from_n(dimension);
1300  std::vector<index_type> n(dimension);
1301 
1302  for (unsigned int dim = 0; dim < dimension; ++dim)
1303  {
1304  dataLoad(stream, from_n[dim], nullptr);
1305  n[dim] = array.n(dim);
1306  }
1307 
1308  if (from_n != n)
1309  mooseError("Kokkos array error: cannot load array because the stored array has dimensions (",
1310  Moose::stringify(from_n),
1311  ") but the loading array has dimensions (",
1312  Moose::stringify(n),
1313  ").");
1314 
1315  if (array.isHostAlloc())
1316  {
1317  for (auto & value : array)
1318  dataLoad(stream, value, context);
1319 
1320  if (array.isDeviceAlloc())
1321  array.copyToDevice();
1322  }
1323  else
1324  {
1325  std::vector<T> data(array.size());
1326 
1327  for (auto & value : data)
1328  dataLoad(stream, value, context);
1329 
1330  array.copyIn(data.data(), MemcpyType::HOST_TO_DEVICE, array.size());
1331  }
1332 }
std::string name(const ElemQuality q)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
void dataLoad(std::istream &stream, Array< T, dimension, index_type, layout > &array, void *context)
Definition: KokkosArray.h:1269
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:163
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:64
std::string demangle(const char *name)
std::string prettyCppType(const std::string &cpp_type)
Definition: MooseUtils.C:1140

◆ dataStore() [1/2]

template<typename T1 , typename T2 , template< typename... > class MapType>
void Moose::Kokkos::dataStore ( std::ostream &  stream,
MapBase< T1, T2, MapType > &  map,
void context 
)

Definition at line 336 of file KokkosMap.h.

337 {
339 
340  dataStore(stream, map.get(), context);
341  dataStore(stream, map._keys, context);
342  dataStore(stream, map._values, context);
343  dataStore(stream, map._offset, context);
344 }
void dataStore(std::ostream &stream, MapBase< T1, T2, MapType > &map, void *context)
Definition: KokkosMap.h:336

◆ dataStore() [2/2]

template<typename T , unsigned int dimension, typename index_type , LayoutType layout>
void Moose::Kokkos::dataStore ( std::ostream &  stream,
Array< T, dimension, index_type, layout > &  array,
void context 
)

Definition at line 1225 of file KokkosArray.h.

Referenced by dataStore(), and propertyStore().

1226 {
1228 
1229  bool is_alloc = array.isAlloc();
1230  dataStore(stream, is_alloc, nullptr);
1231 
1232  if (!is_alloc)
1233  return;
1234 
1235  std::string type = typeid(T).name();
1236  dataStore(stream, type, nullptr);
1237 
1238  unsigned int dim = dimension;
1239  dataStore(stream, dim, nullptr);
1240 
1241  for (unsigned int dim = 0; dim < dimension; ++dim)
1242  {
1243  auto n = array.n(dim);
1244  dataStore(stream, n, nullptr);
1245  }
1246 
1247  if (array.isDeviceAlloc())
1248  {
1249  // We use malloc/free because we just want a memory copy
1250  // If T is a Kokkos array and we use new/delete or vector to copy it out,
1251  // the arrays will be destroyed on cleanup
1252 
1253  T * data = static_cast<T *>(std::malloc(array.size() * sizeof(T)));
1254 
1255  array.copyOut(data, MemcpyType::DEVICE_TO_HOST, array.size());
1256 
1257  for (index_type i = 0; i < array.size(); ++i)
1258  dataStore(stream, data[i], context);
1259 
1260  std::free(data);
1261  }
1262  else
1263  for (auto & value : array)
1264  dataStore(stream, value, context);
1265 }
std::string name(const ElemQuality q)
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:163
void dataStore(std::ostream &stream, Array< T, dimension, index_type, layout > &array, void *context)
Definition: KokkosArray.h:1225
void free(void *ptr)

◆ fnv1aHash() [1/3]

template<typename T >
KOKKOS_FUNCTION uint32_t Moose::Kokkos::fnv1aHash ( const T &  key,
uint32_t  hash 
)

Definition at line 26 of file KokkosMap.h.

Referenced by Moose::Kokkos::MapBase< unsigned int, unsigned int >::copy(), Moose::Kokkos::MapBase< unsigned int, unsigned int >::find(), and fnv1aHash().

27 {
28  auto bytes = reinterpret_cast<const uint8_t *>(&key);
29 
30  for (size_t i = 0; i < sizeof(T); ++i)
31  {
32  hash ^= bytes[i];
33  hash *= FNV_PRIME;
34  }
35 
36  return hash;
37 }
constexpr uint32_t FNV_PRIME
Definition: KokkosMap.h:21

◆ fnv1aHash() [2/3]

template<typename T >
KOKKOS_FUNCTION uint32_t Moose::Kokkos::fnv1aHash ( const T &  key)

Definition at line 41 of file KokkosMap.h.

42 {
43  return fnv1aHash(key, FNV_OFFSET_BASIS);
44 }
constexpr uint32_t FNV_OFFSET_BASIS
Definition: KokkosMap.h:22
KOKKOS_FUNCTION uint32_t fnv1aHash(const Pair< T1, T2 > &key)
Definition: KokkosMap.h:51

◆ fnv1aHash() [3/3]

template<typename T1 , typename T2 >
KOKKOS_FUNCTION uint32_t Moose::Kokkos::fnv1aHash ( const Pair< T1, T2 > &  key)

Definition at line 51 of file KokkosMap.h.

52 {
53  return fnv1aHash(key.second, fnv1aHash(key.first));
54 }
KOKKOS_FUNCTION uint32_t fnv1aHash(const Pair< T1, T2 > &key)
Definition: KokkosMap.h:51

◆ free()

void Moose::Kokkos::free ( void ptr)

◆ operator%()

template<typename T , typename U , typename = typename std::enable_if<!is_scalar<typename std::decay<T>::type>::value>::type>
KOKKOS_SCALAR_FUNCTION auto Moose::Kokkos::operator% ( const T &  left,
const Scalar< U > &  right 
) -> decltype(left % static_cast<const U &>(right))

Definition at line 296 of file KokkosScalar.h.

297 {
298  return left % static_cast<const U &>(right);
299 }

◆ operator*() [1/12]

template<typename T >
KOKKOS_INLINE_FUNCTION Vector3<T> Moose::Kokkos::operator* ( const T &  left,
const Vector3< T > &  right 
)

Definition at line 264 of file KokkosTypes.h.

265 {
266  return {left * right.v[0], left * right.v[1], left * right.v[2]};
267 }

◆ operator*() [2/12]

template<typename T >
KOKKOS_INLINE_FUNCTION Vector3<T> Moose::Kokkos::operator* ( const Vector3< T > &  left,
const T &  right 
)

Definition at line 271 of file KokkosTypes.h.

272 {
273  return {left.v[0] * right, left.v[1] * right, left.v[2] * right};
274 }

◆ operator*() [3/12]

template<typename T >
KOKKOS_INLINE_FUNCTION T Moose::Kokkos::operator* ( const Vector3< T > &  left,
const Vector3< T > &  right 
)

Definition at line 278 of file KokkosTypes.h.

279 {
280  return left.v[0] * right.v[0] + left.v[1] * right.v[1] + left.v[2] * right.v[2];
281 }

◆ operator*() [4/12]

template<typename T , typename U , typename = typename std::enable_if<!is_scalar<typename std::decay<T>::type>::value>::type>
KOKKOS_SCALAR_FUNCTION auto Moose::Kokkos::operator* ( const T &  left,
const Scalar< U > &  right 
) -> decltype(left * static_cast<const U &>(right))

Definition at line 278 of file KokkosScalar.h.

Referenced by UniqueStorage< T >::DereferenceIterator< BaseIterator >::operator*(), and UniqueStorage< T >::DereferenceIterator< BaseIterator >::operator->().

279 {
280  return left * static_cast<const U &>(right);
281 }

◆ operator*() [5/12]

KOKKOS_INLINE_FUNCTION Real3 Moose::Kokkos::operator* ( const Real33  left,
const Real3  right 
)

Definition at line 437 of file KokkosTypes.h.

438 {
439  return {left(0, 0) * right.v[0] + left(0, 1) * right.v[1] + left(0, 2) * right.v[2],
440  left(1, 0) * right.v[0] + left(1, 1) * right.v[1] + left(1, 2) * right.v[2],
441  left(2, 0) * right.v[0] + left(2, 1) * right.v[1] + left(2, 2) * right.v[2]};
442 }

◆ operator*() [6/12]

KOKKOS_INLINE_FUNCTION Real33 Moose::Kokkos::operator* ( const Real33  left,
const Real33  right 
)

Definition at line 445 of file KokkosTypes.h.

446 {
447  Real33 mul;
448 
449  for (unsigned int i = 0; i < 3; ++i)
450  for (unsigned int j = 0; j < 3; ++j)
451  for (unsigned int k = 0; k < 3; ++k)
452  mul(i, j) += left(i, k) * right(k, j);
453 
454  return mul;
455 }

◆ operator*() [7/12]

KOKKOS_INLINE_FUNCTION Real3 Moose::Kokkos::operator* ( const Real  left,
const Real3  right 
)

Definition at line 482 of file KokkosTypes.h.

483 {
484  return {left * right.v[0], left * right.v[1], left * right.v[2]};
485 }

◆ operator*() [8/12]

KOKKOS_INLINE_FUNCTION Real3 Moose::Kokkos::operator* ( const Real3  left,
const Real  right 
)

Definition at line 488 of file KokkosTypes.h.

489 {
490  return {left.v[0] * right, left.v[1] * right, left.v[2] * right};
491 }

◆ operator*() [9/12]

template<typename T , typename = typename std::enable_if< std::is_same<typename std::decay<T>::type, ADReal>::value>::type>
KOKKOS_INLINE_FUNCTION ADReal3 Moose::Kokkos::operator* ( const Real3  left,
const T &  right 
)

Definition at line 497 of file KokkosTypes.h.

498 {
499  return {left(0) * right, left(1) * right, left(2) * right};
500 }

◆ operator*() [10/12]

template<typename T , typename = typename std::enable_if< std::is_same<typename std::decay<T>::type, ADReal>::value>::type>
KOKKOS_INLINE_FUNCTION ADReal3 Moose::Kokkos::operator* ( const T &  left,
const Real3  right 
)

Definition at line 506 of file KokkosTypes.h.

507 {
508  return {left * right(0), left * right(1), left * right(2)};
509 }

◆ operator*() [11/12]

KOKKOS_INLINE_FUNCTION ADReal Moose::Kokkos::operator* ( const Real3  left,
const ADReal3 right 
)

Definition at line 512 of file KokkosTypes.h.

513 {
514  return left(0) * right(0) + left(1) * right(1) + left(2) * right(2);
515 }

◆ operator*() [12/12]

KOKKOS_INLINE_FUNCTION ADReal Moose::Kokkos::operator* ( const ADReal3 left,
const Real3  right 
)

Definition at line 518 of file KokkosTypes.h.

519 {
520  return left(0) * right(0) + left(1) * right(1) + left(2) * right(2);
521 }

◆ operator+() [1/6]

template<typename T >
KOKKOS_INLINE_FUNCTION Vector3<T> Moose::Kokkos::operator+ ( const T &  left,
const Vector3< T > &  right 
)

Definition at line 222 of file KokkosTypes.h.

223 {
224  return {left + right.v[0], left + right.v[1], left + right.v[2]};
225 }

◆ operator+() [2/6]

template<typename T >
KOKKOS_INLINE_FUNCTION Vector3<T> Moose::Kokkos::operator+ ( const Vector3< T > &  left,
const T &  right 
)

Definition at line 229 of file KokkosTypes.h.

230 {
231  return {left.v[0] + right, left.v[1] + right, left.v[2] + right};
232 }

◆ operator+() [3/6]

template<typename T >
KOKKOS_INLINE_FUNCTION Vector3<T> Moose::Kokkos::operator+ ( const Vector3< T > &  left,
const Vector3< T > &  right 
)

Definition at line 236 of file KokkosTypes.h.

237 {
238  return {left.v[0] + right.v[0], left.v[1] + right.v[1], left.v[2] + right.v[2]};
239 }

◆ operator+() [4/6]

template<typename T , typename U , typename = typename std::enable_if<!is_scalar<typename std::decay<T>::type>::value>::type>
KOKKOS_SCALAR_FUNCTION auto Moose::Kokkos::operator+ ( const T &  left,
const Scalar< U > &  right 
) -> decltype(left + static_cast<const U &>(right))

Definition at line 260 of file KokkosScalar.h.

261 {
262  return left + static_cast<const U &>(right);
263 }

◆ operator+() [5/6]

KOKKOS_INLINE_FUNCTION Real3 Moose::Kokkos::operator+ ( const Real  left,
const Real3  right 
)

Definition at line 458 of file KokkosTypes.h.

459 {
460  return {left + right.v[0], left + right.v[1], left + right.v[2]};
461 }

◆ operator+() [6/6]

KOKKOS_INLINE_FUNCTION Real3 Moose::Kokkos::operator+ ( const Real3  left,
const Real  right 
)

Definition at line 464 of file KokkosTypes.h.

465 {
466  return {left.v[0] + right, left.v[1] + right, left.v[2] + right};
467 }

◆ operator-() [1/6]

template<typename T >
KOKKOS_INLINE_FUNCTION Vector3<T> Moose::Kokkos::operator- ( const T &  left,
const Vector3< T > &  right 
)

Definition at line 243 of file KokkosTypes.h.

244 {
245  return {left - right.v[0], left - right.v[1], left - right.v[2]};
246 }

◆ operator-() [2/6]

template<typename T >
KOKKOS_INLINE_FUNCTION Vector3<T> Moose::Kokkos::operator- ( const Vector3< T > &  left,
const T &  right 
)

Definition at line 250 of file KokkosTypes.h.

251 {
252  return {left.v[0] - right, left.v[1] - right, left.v[2] - right};
253 }

◆ operator-() [3/6]

template<typename T >
KOKKOS_INLINE_FUNCTION Vector3<T> Moose::Kokkos::operator- ( const Vector3< T > &  left,
const Vector3< T > &  right 
)

Definition at line 257 of file KokkosTypes.h.

258 {
259  return {left.v[0] - right.v[0], left.v[1] - right.v[1], left.v[2] - right.v[2]};
260 }

◆ operator-() [4/6]

template<typename T , typename U , typename = typename std::enable_if<!is_scalar<typename std::decay<T>::type>::value>::type>
KOKKOS_SCALAR_FUNCTION auto Moose::Kokkos::operator- ( const T &  left,
const Scalar< U > &  right 
) -> decltype(left - static_cast<const U &>(right))

Definition at line 269 of file KokkosScalar.h.

270 {
271  return left - static_cast<const U &>(right);
272 }

◆ operator-() [5/6]

KOKKOS_INLINE_FUNCTION Real3 Moose::Kokkos::operator- ( const Real  left,
const Real3  right 
)

Definition at line 470 of file KokkosTypes.h.

471 {
472  return {left - right.v[0], left - right.v[1], left - right.v[2]};
473 }

◆ operator-() [6/6]

KOKKOS_INLINE_FUNCTION Real3 Moose::Kokkos::operator- ( const Real3  left,
const Real  right 
)

Definition at line 476 of file KokkosTypes.h.

477 {
478  return {left.v[0] - right, left.v[1] - right, left.v[2] - right};
479 }

◆ operator/()

template<typename T , typename U , typename = typename std::enable_if<!is_scalar<typename std::decay<T>::type>::value>::type>
KOKKOS_SCALAR_FUNCTION auto Moose::Kokkos::operator/ ( const T &  left,
const Scalar< U > &  right 
) -> decltype(left / static_cast<const U &>(right))

Definition at line 287 of file KokkosScalar.h.

288 {
289  return left / static_cast<const U &>(right);
290 }

◆ operator<()

template<typename T1 , typename T2 >
bool Moose::Kokkos::operator< ( const Pair< T1, T2 > &  left,
const Pair< T1, T2 > &  right 
)

Definition at line 543 of file KokkosTypes.h.

544 {
545  return std::make_pair(left.first, left.second) < std::make_pair(right.first, right.second);
546 }

◆ propertyLoad()

template<typename T , unsigned int dimension>
void Moose::Kokkos::propertyLoad ( std::istream &  stream,
void prop 
)

Definition at line 174 of file KokkosMaterialProperty.h.

175 {
176  auto property = static_cast<MaterialProperty<T, dimension> *>(prop);
177 
178  dataLoad(stream, property->_data, nullptr);
179 }
void dataLoad(std::istream &stream, PenetrationInfo *&pinfo, void *context)

◆ propertyStore()

template<typename T , unsigned int dimension>
void Moose::Kokkos::propertyStore ( std::ostream &  stream,
void prop 
)

Definition at line 166 of file KokkosMaterialProperty.h.

167 {
168  auto property = static_cast<MaterialProperty<T, dimension> *>(prop);
169 
170  dataStore(stream, property->_data, nullptr);
171 }
void dataStore(std::ostream &stream, PenetrationInfo *&pinfo, void *context)

Variable Documentation

◆ FNV_OFFSET_BASIS

constexpr uint32_t Moose::Kokkos::FNV_OFFSET_BASIS = 0x811C9DC5

Definition at line 22 of file KokkosMap.h.

Referenced by fnv1aHash().

◆ FNV_PRIME

constexpr uint32_t Moose::Kokkos::FNV_PRIME = 0x01000193

Definition at line 21 of file KokkosMap.h.

Referenced by fnv1aHash().

◆ MAX_CACHED_DOF

constexpr unsigned int Moose::Kokkos::MAX_CACHED_DOF = 30

◆ MAX_TAG

constexpr unsigned int Moose::Kokkos::MAX_TAG = 30

Maximum tag ID.

Definition at line 73 of file KokkosHeader.h.