42 auto ptr = pool.allocate(size);
46 _ptr =
static_cast<T *
>(ptr);
56 KOKKOS_FUNCTION T *
get()
const {
return _ptr; }
62 const ::Kokkos::MemoryPool<MemSpace> &
_pool;
const MooseApp & _app
Reference of the MOOSE app.
T * _ptr
Pointer to the memory chunk.
A temporary object returned by the Kokkos memory pool during memory chunk allocation.
KOKKOS_FUNCTION MemoryChunk(const ::Kokkos::MemoryPool< MemSpace > &pool, dof_id_type size)
Constructor.
KOKKOS_FUNCTION const MemoryPool & kokkosMemoryPool() const
Get the const reference of the Kokkos memory pool.
The Kokkos interface that holds the Kokkos memory pool.
Base class for MOOSE-based applications.
MemoryPoolHolder(const MemoryPoolHolder &holder)
Copy constructor.
The Kokkos class that manages memory pool for dynamically-sized temporary arrays in Kokkos parallel f...
MemoryPool _pool
Device copy of the Kokkos memory pool.
Array<::Kokkos::MemoryPool< MemSpace > > _pools
Kokkos memory pools.
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...
const ::Kokkos::MemoryPool< MemSpace > & _pool
Reference of the Kokkos memory pool.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
KOKKOS_FUNCTION ~MemoryChunk()
Destructor.
MemoryPool(dof_id_type size, unsigned int ways)
Constructor.
MemoryPoolHolder(const MooseApp &app)
Constructor.
const dof_id_type _size
Memory chunk size in the number of bytes.