|
FEAT 3
Finite Element Analysis Toolbox
|
Memory management. More...
#include <memory_pool.hpp>
Static Public Member Functions | |
| template<typename DT_ > | |
| static DT_ * | allocate_memory (Index count) |
| allocate new memory More... | |
| static Index | allocated_memory () |
| static Index | allocated_size (void *address) |
| template<typename DT1_ , typename DT2_ > | |
| static void | convert (DT1_ *dest, const DT2_ *src, const Index count) |
| Convert datatype DT2_ from src into DT1_ in dest. More... | |
| template<typename DT_ > | |
| static void | convert (DT_ *dest, const DT_ *src, const Index count) |
| Copy memory area from src to dest. More... | |
| template<typename DT_ > | |
| static void | copy (DT_ *dest, const DT_ *src, const Index count) |
| Copy memory area from src to dest. More... | |
| template<typename DT_ > | |
| static void | download (DT_ *dest, const DT_ *const src, const Index count) |
| download memory chunk to host memory More... | |
| static void | finalize () |
| Shutdown memory pool and clean up allocated memory pools. More... | |
| template<typename DT_ > | |
| static const DT_ & | get_element (const DT_ *data, const Index index) |
| receive element More... | |
| static void | increase_memory (void *address) |
| increase memory counter More... | |
| static void | initialize () |
| Setup memory pools. More... | |
| static void | release_memory (void *address) |
| release memory or decrease reference counter More... | |
| template<typename DT_ > | |
| static void | set_memory (DT_ *address, const DT_ val, const Index count=1) |
| set memory to specific value More... | |
| template<typename DT_ > | |
| static void | set_memory (Random &rng, DT_ min, DT_ max, DT_ *address, const Index count=1) |
| set memory to specific value More... | |
| static NOINLINE void | synchronize () |
| template<typename DT_ > | |
| static void | upload (DT_ *dest, const DT_ *const src, const Index count) |
| upload memory chunk from host memory to device memory More... | |
Static Private Attributes | |
| static std::map< void *, Util::Intern::MemoryInfo > | _pool |
| Map of all memory chunks in use. More... | |
Memory management.
This class manages the used memory chunks and releases them, if necessary.
Definition at line 52 of file memory_pool.hpp.
|
inlinestatic |
|
inlinestatic |
Definition at line 321 of file memory_pool.hpp.
|
inlinestatic |
Definition at line 331 of file memory_pool.hpp.
|
inlinestatic |
Convert datatype DT2_ from src into DT1_ in dest.
Definition at line 287 of file memory_pool.hpp.
References FEAT::cuda, FEAT::generic, and FEAT::Backend::get_preferred_backend().
|
inlinestatic |
Copy memory area from src to dest.
Definition at line 269 of file memory_pool.hpp.
Referenced by FEAT::LAFEM::Container< DT_, IT_ >::assign().
|
inlinestatic |
Copy memory area from src to dest.
Definition at line 236 of file memory_pool.hpp.
References FEAT::cuda, FEAT::generic, and FEAT::Backend::get_preferred_backend().
Referenced by FEAT::LAFEM::SparseMatrixCSCR< DT_, IT_ >::SparseMatrixCSCR(), FEAT::LAFEM::SparseMatrixBanded< DT_, IT_ >::extract_diag(), FEAT::Adjacency::ColoringDataHandler::fill_color(), FEAT::LAFEM::DenseVector< DT_, IT_ >::max_abs_element(), FEAT::LAFEM::SparseMatrixCSR< DT_, IT_ >::max_abs_element(), FEAT::LAFEM::DenseVector< DT_, IT_ >::max_element(), FEAT::LAFEM::SparseMatrixCSR< DT_, IT_ >::max_element(), FEAT::LAFEM::DenseVector< DT_, IT_ >::min_abs_element(), FEAT::LAFEM::SparseMatrixCSR< DT_, IT_ >::min_abs_element(), FEAT::LAFEM::DenseVector< DT_, IT_ >::min_element(), FEAT::LAFEM::SparseMatrixCSR< DT_, IT_ >::min_element(), FEAT::LAFEM::SparseVectorBlocked< DT_, IT_, BlockSize_ >::operator()(), FEAT::LAFEM::SparseVector< DT_, IT_ >::operator()(), FEAT::LAFEM::DenseVector< DT_, IT_ >::read_from(), and FEAT::LAFEM::DenseVector< DT_, IT_ >::write_out().
|
inlinestatic |
download memory chunk to host memory
Definition at line 153 of file memory_pool.hpp.
|
inlinestatic |
Shutdown memory pool and clean up allocated memory pools.
Definition at line 66 of file memory_pool.hpp.
References _pool.
Referenced by FEAT::Runtime::finalize().
|
inlinestatic |
receive element
Definition at line 175 of file memory_pool.hpp.
|
inlinestatic |
increase memory counter
Definition at line 108 of file memory_pool.hpp.
References _pool, XABORTM, and XASSERT.
Referenced by FEAT::LAFEM::DenseVector< DT_, IT_ >::DenseVector(), FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::DenseVectorBlocked(), FEAT::LAFEM::MatrixMirrorBuffer< DT_, IT_ >::MatrixMirrorBuffer(), FEAT::LAFEM::SparseMatrixBanded< DT_, IT_ >::SparseMatrixBanded(), FEAT::LAFEM::SparseMatrixBCSR< DT_, IT_, BlockHeight_, BlockWidth_ >::SparseMatrixBCSR(), FEAT::LAFEM::SparseMatrixCSCR< DT_, IT_ >::SparseMatrixCSCR(), FEAT::LAFEM::SparseMatrixCSR< DT_, IT_ >::SparseMatrixCSR(), FEAT::LAFEM::SparseVector< DT_, IT_ >::SparseVector(), FEAT::LAFEM::SparseVectorBlocked< DT_, IT_, BlockSize_ >::SparseVectorBlocked(), FEAT::LAFEM::Container< DT_, IT_ >::assign(), FEAT::LAFEM::Container< DT_, IT_ >::clone(), FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::convert(), FEAT::LAFEM::DenseVector< DT_, IT_ >::convert(), FEAT::LAFEM::SparseMatrixBanded< DT_, IT_ >::operator=(), FEAT::LAFEM::SparseMatrixBCSR< DT_, IT_, BlockHeight_, BlockWidth_ >::operator=(), FEAT::LAFEM::SparseMatrixCSCR< DT_, IT_ >::operator=(), and FEAT::LAFEM::SparseMatrixCSR< DT_, IT_ >::operator=().
|
inlinestatic |
Setup memory pools.
Definition at line 61 of file memory_pool.hpp.
Referenced by FEAT::Runtime::initialize().
|
inlinestatic |
release memory or decrease reference counter
Definition at line 123 of file memory_pool.hpp.
References _pool, and XABORTM.
Referenced by FEAT::LAFEM::Container< DT_, IT_ >::~Container(), FEAT::LAFEM::SparseLayout< IT_, Layout_ >::~SparseLayout(), FEAT::LAFEM::Container< DT_, IT_ >::assign(), FEAT::LAFEM::Container< DT_, IT_ >::clear(), FEAT::LAFEM::Container< DT_, IT_ >::move(), FEAT::LAFEM::SparseVectorBlocked< DT_, IT_, BlockSize_ >::operator()(), FEAT::LAFEM::SparseVector< DT_, IT_ >::operator()(), FEAT::LAFEM::SparseMatrixBanded< DT_, IT_ >::operator=(), FEAT::LAFEM::SparseMatrixBCSR< DT_, IT_, BlockHeight_, BlockWidth_ >::operator=(), FEAT::LAFEM::SparseMatrixCSCR< DT_, IT_ >::operator=(), FEAT::LAFEM::SparseMatrixCSR< DT_, IT_ >::operator=(), FEAT::LAFEM::DenseVector< DT_, IT_ >::write_out(), and FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::write_out().
|
inlinestatic |
set memory to specific value
Definition at line 182 of file memory_pool.hpp.
References FEAT::cuda, FEAT::generic, and FEAT::Backend::get_preferred_backend().
Referenced by FEAT::LAFEM::DenseMatrix< DT_, IT_ >::DenseMatrix(), FEAT::LAFEM::DenseVector< DT_, IT_ >::DenseVector(), FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::DenseVectorBlocked(), FEAT::LAFEM::SparseMatrixCSCR< DT_, IT_ >::SparseMatrixCSCR(), FEAT::LAFEM::Container< DT_, IT_ >::format(), FEAT::LAFEM::SparseVectorBlocked< DT_, IT_, BlockSize_ >::operator()(), and FEAT::LAFEM::DenseMatrix< DT_, IT_ >::operator()().
|
inlinestatic |
set memory to specific value
Definition at line 208 of file memory_pool.hpp.
References FEAT::cuda, FEAT::generic, and FEAT::Backend::get_preferred_backend().
|
inlinestatic |
Definition at line 312 of file memory_pool.hpp.
|
inlinestatic |
upload memory chunk from host memory to device memory
Definition at line 164 of file memory_pool.hpp.
|
staticprivate |
Map of all memory chunks in use.
Definition at line 56 of file memory_pool.hpp.
Referenced by allocate_memory(), finalize(), increase_memory(), and release_memory().