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

The Kokkos thread object that aids in converting the one-dimensional thread index into multi-dimensional thread indices. More...

#include <KokkosThread.h>

Public Member Functions

void resize (std::vector< ThreadID > dims)
 Set the thread pool size and dimension. More...
 
ThreadID size () const
 Get the total thread pool size. More...
 
KOKKOS_FUNCTION ThreadID operator() (ThreadID tid, unsigned int dim) const
 Get the multi-dimensional thread index of a dimension given a one-dimensional thread index. More...
 

Protected Attributes

ThreadID _size = 0
 Total thread pool size. More...
 
unsigned int _dim = 0
 Thread pool dimension. More...
 
ThreadID _dims [10]
 Thread pool size of each dimension. More...
 
ThreadID _strides [10]
 Thread pool stride of each dimension. More...
 

Detailed Description

The Kokkos thread object that aids in converting the one-dimensional thread index into multi-dimensional thread indices.

Definition at line 29 of file KokkosThread.h.

Member Function Documentation

◆ operator()()

KOKKOS_FUNCTION ThreadID Moose::Kokkos::Thread::operator() ( ThreadID  tid,
unsigned int  dim 
) const
inline

Get the multi-dimensional thread index of a dimension given a one-dimensional thread index.

Parameters
tidThe one-dimensional thread index
dimfor which the multi-dimensional thread index is to be returned
Returns
The multi-dimensional thread index of the dimension

Definition at line 49 of file KokkosThread.h.

50  {
51  KOKKOS_ASSERT(dim < _dim);
52 
53  return (tid / _strides[dim]) % _dims[dim];
54  }
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:159
unsigned int _dim
Thread pool dimension.
Definition: KokkosThread.h:65
ThreadID _dims[10]
Thread pool size of each dimension.
Definition: KokkosThread.h:69
ThreadID _strides[10]
Thread pool stride of each dimension.
Definition: KokkosThread.h:73

◆ resize()

void Moose::Kokkos::Thread::resize ( std::vector< ThreadID dims)

Set the thread pool size and dimension.

Parameters
dimsThe vector containing the size of each dimension

◆ size()

ThreadID Moose::Kokkos::Thread::size ( ) const
inline

Get the total thread pool size.

Returns
The total thread pool size

Definition at line 42 of file KokkosThread.h.

42 { return _size; }
ThreadID _size
Total thread pool size.
Definition: KokkosThread.h:61

Member Data Documentation

◆ _dim

unsigned int Moose::Kokkos::Thread::_dim = 0
protected

Thread pool dimension.

Definition at line 65 of file KokkosThread.h.

Referenced by operator()().

◆ _dims

ThreadID Moose::Kokkos::Thread::_dims[10]
protected

Thread pool size of each dimension.

Definition at line 69 of file KokkosThread.h.

Referenced by operator()().

◆ _size

ThreadID Moose::Kokkos::Thread::_size = 0
protected

Total thread pool size.

Definition at line 61 of file KokkosThread.h.

Referenced by size().

◆ _strides

ThreadID Moose::Kokkos::Thread::_strides[10]
protected

Thread pool stride of each dimension.

Definition at line 73 of file KokkosThread.h.

Referenced by operator()().


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