Class TempLat::MemoryBlock
template <typename T, size_t NDim>
ClassList > TempLat > MemoryBlock
A class which holds a block of memory. Feel free to pass it around and copy: the pointer is itself kept inside a shared pointer. Only when the last owner is destructed, the memory is freed. More...
#include <memoryblock.h>
Public Functions
| Type | Name |
|---|---|
| MemoryBlock () Default constructor: empty. |
|
| MemoryBlock (size_t size) Constructor with a size to allocate. |
|
| MemoryBlock (const MemoryBlock &) = delete |
|
| void | allocate (size_t size) |
| DEVICE_INLINE_FUNCTION T * | data () const |
| void | deallocateHostView () |
| void | fill (const T & value) |
| void | flagHostMirrorOutdated () const |
| auto | getNDHostView (const device::IdxArray< NDim > & localSizes) const |
| auto | getNDView (const device::IdxArray< NDim > & localSizes) const |
| auto | getRawHostView () const |
| auto | getRawView () const |
| bool | isHostViewAllocated () const |
| DEVICE_INLINE_FUNCTION | operator T* () const |
| MemoryBlock & | operator= (const MemoryBlock &) = delete |
| DEVICE_INLINE_FUNCTION T & | operator[] (device::Idx i) const access |
| void | pullHostView () const |
| void | pushHostView () |
| size_t | size () const |
| void | zero () state modify: zero out |
Detailed Description
Templated for double / float.
Unit test: ctest -R test-memoryblock
Public Functions Documentation
function MemoryBlock [1/3]
Default constructor: empty.
function MemoryBlock [2/3]
Constructor with a size to allocate.
function MemoryBlock [3/3]
function allocate
function data
function deallocateHostView
function fill
function flagHostMirrorOutdated
function getNDHostView
template<typename R>
inline auto TempLat::MemoryBlock::getNDHostView (
const device::IdxArray< NDim > & localSizes
) const
function getNDView
template<typename R>
inline auto TempLat::MemoryBlock::getNDView (
const device::IdxArray< NDim > & localSizes
) const
function getRawHostView
function getRawView
function isHostViewAllocated
function operator T*
function operator=
function operator[]
access
function pullHostView
function pushHostView
function size
getter
function zero
state modify: zero out
Friends Documentation
friend operator<<
inline std::ostream & TempLat::MemoryBlock::operator<< (
std::ostream & ostream,
const MemoryBlock & mb
)
friend operator==
The documentation for this class was generated from the following file cosmolatticeweb/tmp/code_source/templat/include/TempLat/lattice/memory/memoryblock.h