This object is siimilar to a memory pool in that allows for reuse of view allocations across the DAG and in other DataContainers and FieldManagers. More...
#include <Phalanx_MemoryManager.hpp>
Public Member Functions | |
MemoryManager (const MemoryManager &mp) | |
Allocate a new memory pool re-using allocations from other linked MemoryManagers. | |
std::shared_ptr < PHX::MemoryManager > | clone () const |
Clones MemoryManager to reuse tracker allocations with a separate FieldManager. | |
template<class View > | |
void | bindViewMemory (const PHX::FieldTag &tag, View &view) |
Assigns memory to a view, allocates new memory if needed. | |
void | insertTracker (Kokkos::Impl::SharedAllocationTracker &t) |
Inserts tracker. | |
This object is siimilar to a memory pool in that allows for reuse of view allocations across the DAG and in other DataContainers and FieldManagers.
A field may only be used in a small section of the DAG. After topological sorting, we can find the span of evaluators in the sorted list that the field must exist over. Outside of this range, the view memory can be reused by other views that don't overlap within the same DAG.
An additional feature is that since only one evaluation type of one FieldManager is run at a time, phalanx can also reuse view allocations for different evaluation types in the same FieldManager and over all evaluation types in other FieldManagers. A special clone method exists that creates a new MemoryManager, pointing to the same allocations, but resetting the tracker objects for a new FieldManager or DataContainer.