A temporary object returned by the Kokkos memory pool during memory chunk allocation. More...
#include <KokkosMemoryPool.h>
Public Member Functions | |
KOKKOS_FUNCTION | MemoryChunk (const ::Kokkos::MemoryPool< MemSpace > &pool, dof_id_type size) |
Constructor. More... | |
KOKKOS_FUNCTION | ~MemoryChunk () |
Destructor. More... | |
KOKKOS_FUNCTION T * | get () const |
Get the pointer to the chunk. More... | |
Private Attributes | |
const ::Kokkos::MemoryPool< MemSpace > & | _pool |
Reference of the Kokkos memory pool. More... | |
const dof_id_type | _size |
Memory chunk size in the number of bytes. More... | |
T * | _ptr |
Pointer to the memory chunk. More... | |
A temporary object returned by the Kokkos memory pool during memory chunk allocation.
The instances of this class are expected to be only created by the Kokkos memory pool. This object holds the size and pointer to the memory chunk and allocates and deallocates the memory chunk upon its construction and destruction by interacting with the underlying memory pool. Therefore, the instance of this class returned by the Kokkos memory pool should be alive while the memory chunk is used.
Definition at line 31 of file KokkosMemoryPool.h.
|
inline |
Constructor.
pool | The Kokkos memory pool |
size | The memory chunk size in the number of bytes |
Definition at line 39 of file KokkosMemoryPool.h.
|
inline |
Destructor.
Definition at line 51 of file KokkosMemoryPool.h.
|
inline |
Get the pointer to the chunk.
Definition at line 56 of file KokkosMemoryPool.h.
|
private |
Reference of the Kokkos memory pool.
Definition at line 62 of file KokkosMemoryPool.h.
Referenced by Moose::Kokkos::MemoryChunk< T >::~MemoryChunk().
|
private |
Pointer to the memory chunk.
Definition at line 70 of file KokkosMemoryPool.h.
Referenced by Moose::Kokkos::MemoryChunk< T >::get(), Moose::Kokkos::MemoryChunk< T >::MemoryChunk(), and Moose::Kokkos::MemoryChunk< T >::~MemoryChunk().
|
private |
Memory chunk size in the number of bytes.
Definition at line 66 of file KokkosMemoryPool.h.
Referenced by Moose::Kokkos::MemoryChunk< T >::~MemoryChunk().