37 KOKKOS_FUNCTION
MemoryChunk(const ::Kokkos::MemoryPool<MemSpace> & pool, dof_id_type size)
44 _ptr =
static_cast<T *
>(ptr);
54 KOKKOS_FUNCTION T *
get()
const {
return _ptr; }
60 const ::Kokkos::MemoryPool<MemSpace> &
_pool;
Base class for MOOSE-based applications.
KOKKOS_FUNCTION index_type size() const
Get the total array size.
A temporary object returned by the Kokkos memory pool during memory chunk allocation.
KOKKOS_FUNCTION ~MemoryChunk()
Destructor.
T * _ptr
Pointer to the memory chunk.
KOKKOS_FUNCTION MemoryChunk(const ::Kokkos::MemoryPool< MemSpace > &pool, dof_id_type size)
Constructor.
const ::Kokkos::MemoryPool< MemSpace > & _pool
Reference of the Kokkos memory pool.
const dof_id_type _size
Memory chunk size in the number of bytes.
KOKKOS_FUNCTION T * get() const
Get the pointer to the chunk.
The Kokkos interface that holds the Kokkos memory pool.
const MooseApp & _app
Reference of the MOOSE app.
MemoryPool _pool
Device copy of the Kokkos memory pool.
MemoryPoolHolder(const MooseApp &app)
Constructor.
MemoryPoolHolder(const MemoryPoolHolder &holder)
Copy constructor.
KOKKOS_FUNCTION const MemoryPool & kokkosMemoryPool() const
Get the const reference of the Kokkos memory pool.
The Kokkos class that manages memory pool for dynamically-sized temporary arrays in Kokkos parallel f...
KOKKOS_FUNCTION MemoryChunk< T > allocate(dof_id_type idx, unsigned int size) const
Allocate a memory chunk The returned object should be alive while the memory chunk is used.
MemoryPool(dof_id_type size, unsigned int ways)
Constructor.
Array<::Kokkos::MemoryPool< MemSpace > > _pools
Kokkos memory pools.