![]() |
Block-Structured AMR Software Framework
|
Basic Arena that allocates aligned memory on the host heap. More...
#include <AMReX_BArena.H>
Public Member Functions | |
| void * | alloc (std::size_t sz) final |
| Allocate host memory. | |
| void | free (void *pt) final |
| Free memory previously returned by alloc(). | |
| bool | isDeviceAccessible () const final |
| Return false; BArena allocations are not device accessible. | |
| bool | isHostAccessible () const final |
| Return true; BArena allocations reside on the host. | |
| bool | isManaged () const final |
| Return false; BArena memory is not managed/unified. | |
| bool | isDevice () const final |
| Return false; BArena operates on the host. | |
| bool | isPinned () const final |
| Return false; BArena does not allocate pinned memory. | |
Public Member Functions inherited from amrex::Arena | |
| virtual | ~Arena ()=default |
| Arena () noexcept=default | |
| Arena (const Arena &rhs)=delete | |
| Arena (Arena &&rhs)=delete | |
| Arena & | operator= (const Arena &rhs)=delete |
| Arena & | operator= (Arena &&rhs)=delete |
| virtual std::pair< void *, std::size_t > | alloc_in_place (void *pt, std::size_t szmin, std::size_t szmax) |
| Allocate memory in-place if possible. | |
| virtual void * | shrink_in_place (void *pt, std::size_t sz) |
| Shrink allocation size in-place. | |
| virtual std::size_t | freeUnused () |
| Release unused cached memory back to the system. | |
| virtual std::size_t | largestFreeBlock () const |
| Return the largest free memory block already held by this Arena. | |
| virtual bool | hasFreeDeviceMemory (std::size_t sz) |
| Does the device have enough free memory for allocating this much memory? For CPU builds, this always return true. This is not a const function because it may attempt to release memory back to the system. | |
| void | registerForProfiling (const std::string &memory_name) |
| Add this Arena to the list of Arenas that are profiled by TinyProfiler. | |
| void | deregisterFromProfiling () |
| Remove this Arena from the list of Arenas that are profiled by TinyProfiler. This is equivalent to destructing and re-constructing the Arena. | |
| virtual bool | isStreamOrderedArena () const |
| Is this GPU stream ordered memory allocator? | |
| virtual void | streamOrderedFree (void *pt, gpuStream_t stream) |
| const ArenaInfo & | arenaInfo () const |
| Return the ArenaInfo object for querying. | |
| virtual void | ResetMaxUsageCounter () |
Additional Inherited Members | |
Static Public Member Functions inherited from amrex::Arena | |
| static std::size_t | align (std::size_t sz) |
Return the smallest multiple of Arena::align_size that is >= sz bytes. | |
| static void | Initialize (bool minimal) |
| Initialize the Arena subsystem (used internally by AMReX). | |
| static void | PrintUsage (bool print_max_usage=false) |
| Print memory usage information of all arenas. | |
| static void | PrintUsageToStream (std::ostream &os, std::string const &space) |
| Print memory usage information of all arenas to a given output stream. | |
| static void | PrintUsageToFiles (std::string const &filename, std::string const &message) |
| Print memory usage information of all arenas to given file. | |
| static void | Finalize () |
| Used internally by amrex. | |
| static bool | IsInitialized () |
Static Public Attributes inherited from amrex::Arena | |
| static const std::size_t | align_size = 256 |
Protected Member Functions inherited from amrex::Arena | |
| virtual std::size_t | freeUnused_protected () |
| void * | allocate_system (std::size_t nbytes) |
| void | deallocate_system (void *p, std::size_t nbytes) |
Static Protected Member Functions inherited from amrex::Arena | |
| static void | out_of_memory_abort (std::string const &memory_type, std::size_t nbytes, std::string const &error_msg) |
Protected Attributes inherited from amrex::Arena | |
| ArenaInfo | arena_info |
Basic Arena that allocates aligned memory on the host heap.
|
finalvirtual |
Allocate host memory.
| sz | Number of bytes to allocate. |
Implements amrex::Arena.
|
finalvirtual |
Free memory previously returned by alloc().
| pt | Pointer to the allocation to release. |
Implements amrex::Arena.
|
finalvirtual |
Return false; BArena operates on the host.
Reimplemented from amrex::Arena.
|
finalvirtual |
Return false; BArena allocations are not device accessible.
Reimplemented from amrex::Arena.
|
finalvirtual |
Return true; BArena allocations reside on the host.
Reimplemented from amrex::Arena.
|
finalvirtual |
Return false; BArena memory is not managed/unified.
Reimplemented from amrex::Arena.
|
finalvirtual |
Return false; BArena does not allocate pinned memory.
Reimplemented from amrex::Arena.