The fundamental concept for accessing memory through Umpire is the umpire::Allocator
. An umpire::Allocator
is a C++ object that can be used to allocate and deallocate memory, as well as query a pointer to get some extra information about it.
All umpire::Allocator
s are created and managed by Umpire's umpire::ResourceManager
. To get an Allocator, you need to ask for one:
../../../examples/tutorial/tut_allocator.cpp
You can also use an existing allocator to build a new allocator from it:
../../../examples/tutorial/tut_allocator.cpp
This new allocator will also be built with the same memory resource. More information on memory resources is provided in the next section. Additionally, once you have an umpire::Allocator
you can use it to allocate and deallocate memory:
../../../examples/tutorial/tut_allocator.cpp
../../../examples/tutorial/tut_allocator.cpp
In the next section, we will see how to allocate memory using different resources.
../../../examples/tutorial/tut_allocator.cpp