Block-Structured AMR Software Framework
amrex::detail::SingleChunkArena Class Referencefinal

#include <AMReX_FabArrayBase.H>

Inheritance diagram for amrex::detail::SingleChunkArena:
amrex::Arena

Public Member Functions

 SingleChunkArena (Arena *a_arena, std::size_t a_size)
 
 ~SingleChunkArena () override
 
 SingleChunkArena ()=delete
 
 SingleChunkArena (const SingleChunkArena &rhs)=delete
 
 SingleChunkArena (SingleChunkArena &&rhs)=delete
 
SingleChunkArenaoperator= (const SingleChunkArena &rhs)=delete
 
SingleChunkArenaoperator= (SingleChunkArena &&rhs)=delete
 
void * alloc (std::size_t sz) override
 
void free (void *pt) override
 A pure virtual function for deleting the arena pointed to by pt. More...
 
bool isDeviceAccessible () const override
 
bool isHostAccessible () const override
 
bool isManaged () const override
 
bool isDevice () const override
 
bool isPinned () const override
 
void * data () const noexcept
 
- Public Member Functions inherited from amrex::Arena
virtual ~Arena ()=default
 
 Arena () noexcept=default
 
 Arena (const Arena &rhs)=delete
 
 Arena (Arena &&rhs)=delete
 
Arenaoperator= (const Arena &rhs)=delete
 
Arenaoperator= (Arena &&rhs)=delete
 
virtual std::pair< void *, std::size_t > alloc_in_place (void *, std::size_t, std::size_t szmax)
 
virtual void * shrink_in_place (void *, std::size_t sz)
 
virtual std::size_t freeUnused ()
 Free unused memory back to the system. Return value is the amount memory freed. More...
 
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. More...
 
void registerForProfiling (const std::string &memory_name)
 Add this Arena to the list of Arenas that are profiled by TinyProfiler. More...
 
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. More...
 
virtual bool isStreamOrderedArena () const
 Is this GPU stream ordered memory allocator? More...
 
const ArenaInfoarenaInfo () const
 Return the ArenaInfo object for querying. More...
 

Private Attributes

DataAllocator m_dallocator
 
char * m_root = nullptr
 
char * m_free = nullptr
 
std::size_t m_size = 0
 

Additional Inherited Members

- Static Public Member Functions inherited from amrex::Arena
static std::size_t align (std::size_t sz)
 Given a minimum required arena size of sz bytes, this returns the next largest arena size that will align to align_size bytes. More...
 
static void Initialize ()
 
static void PrintUsage ()
 
static void PrintUsageToFiles (std::string const &filename, std::string const &message)
 
static void Finalize ()
 
- Static Public Attributes inherited from amrex::Arena
static const std::size_t align_size = 16
 
- 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)
 
- Protected Attributes inherited from amrex::Arena
ArenaInfo arena_info
 
struct amrex::Arena::ArenaProfiler m_profiler
 

Constructor & Destructor Documentation

◆ SingleChunkArena() [1/4]

amrex::detail::SingleChunkArena::SingleChunkArena ( Arena a_arena,
std::size_t  a_size 
)

◆ ~SingleChunkArena()

amrex::detail::SingleChunkArena::~SingleChunkArena ( )
override

◆ SingleChunkArena() [2/4]

amrex::detail::SingleChunkArena::SingleChunkArena ( )
delete

◆ SingleChunkArena() [3/4]

amrex::detail::SingleChunkArena::SingleChunkArena ( const SingleChunkArena rhs)
delete

◆ SingleChunkArena() [4/4]

amrex::detail::SingleChunkArena::SingleChunkArena ( SingleChunkArena &&  rhs)
delete

Member Function Documentation

◆ alloc()

void* amrex::detail::SingleChunkArena::alloc ( std::size_t  sz)
overridevirtual

Allocate a dynamic memory arena

Parameters
szsize of the memory request
Returns
a pointer to the allocated memory

Implements amrex::Arena.

◆ data()

void* amrex::detail::SingleChunkArena::data ( ) const
inlinenoexcept

◆ free()

void amrex::detail::SingleChunkArena::free ( void *  pt)
overridevirtual

A pure virtual function for deleting the arena pointed to by pt.

Implements amrex::Arena.

◆ isDevice()

bool amrex::detail::SingleChunkArena::isDevice ( ) const
overridevirtual

Reimplemented from amrex::Arena.

◆ isDeviceAccessible()

bool amrex::detail::SingleChunkArena::isDeviceAccessible ( ) const
overridevirtual

Reimplemented from amrex::Arena.

◆ isHostAccessible()

bool amrex::detail::SingleChunkArena::isHostAccessible ( ) const
overridevirtual

Reimplemented from amrex::Arena.

◆ isManaged()

bool amrex::detail::SingleChunkArena::isManaged ( ) const
overridevirtual

Reimplemented from amrex::Arena.

◆ isPinned()

bool amrex::detail::SingleChunkArena::isPinned ( ) const
overridevirtual

Reimplemented from amrex::Arena.

◆ operator=() [1/2]

SingleChunkArena& amrex::detail::SingleChunkArena::operator= ( const SingleChunkArena rhs)
delete

◆ operator=() [2/2]

SingleChunkArena& amrex::detail::SingleChunkArena::operator= ( SingleChunkArena &&  rhs)
delete

Member Data Documentation

◆ m_dallocator

DataAllocator amrex::detail::SingleChunkArena::m_dallocator
private

◆ m_free

char* amrex::detail::SingleChunkArena::m_free = nullptr
private

◆ m_root

char* amrex::detail::SingleChunkArena::m_root = nullptr
private

◆ m_size

std::size_t amrex::detail::SingleChunkArena::m_size = 0
private

The documentation for this class was generated from the following file: