Block-Structured AMR Software Framework
amrex::PArena Class Reference

This arena uses CUDA stream-ordered memory allocator if available. If not, use The_Arena(). More...

#include <AMReX_PArena.H>

Inheritance diagram for amrex::PArena:
amrex::Arena

Public Member Functions

 PArena (Long release_threshold)
 
 PArena (const PArena &rhs)=delete
 
 PArena (PArena &&rhs)=delete
 
PArenaoperator= (const PArena &rhs)=delete
 
PArenaoperator= (PArena &&rhs)=delete
 
 ~PArena () override
 
void * alloc (std::size_t nbytes) final
 
void free (void *p) final
 A pure virtual function for deleting the arena pointed to by pt. More...
 
bool isDeviceAccessible () const final
 
bool isHostAccessible () const final
 
bool isManaged () const final
 
bool isDevice () const final
 
bool isPinned () const final
 
bool isStreamOrderedArena () const final
 Is this CUDA stream ordered memory allocator? More...
 
- 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...
 
const ArenaInfoarenaInfo () const
 Return the ArenaInfo object for querying. More...
 

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
 

Detailed Description

This arena uses CUDA stream-ordered memory allocator if available. If not, use The_Arena().

Constructor & Destructor Documentation

◆ PArena() [1/3]

amrex::PArena::PArena ( Long  release_threshold)

◆ PArena() [2/3]

amrex::PArena::PArena ( const PArena rhs)
delete

◆ PArena() [3/3]

amrex::PArena::PArena ( PArena &&  rhs)
delete

◆ ~PArena()

amrex::PArena::~PArena ( )
override

Member Function Documentation

◆ alloc()

void * amrex::PArena::alloc ( std::size_t  sz)
finalvirtual

Allocate a dynamic memory arena

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

Implements amrex::Arena.

◆ free()

void amrex::PArena::free ( void *  pt)
finalvirtual

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

Implements amrex::Arena.

◆ isDevice()

bool amrex::PArena::isDevice ( ) const
finalvirtual

Reimplemented from amrex::Arena.

◆ isDeviceAccessible()

bool amrex::PArena::isDeviceAccessible ( ) const
finalvirtual

Reimplemented from amrex::Arena.

◆ isHostAccessible()

bool amrex::PArena::isHostAccessible ( ) const
finalvirtual

Reimplemented from amrex::Arena.

◆ isManaged()

bool amrex::PArena::isManaged ( ) const
finalvirtual

Reimplemented from amrex::Arena.

◆ isPinned()

bool amrex::PArena::isPinned ( ) const
finalvirtual

Reimplemented from amrex::Arena.

◆ isStreamOrderedArena()

bool amrex::PArena::isStreamOrderedArena ( ) const
inlinefinalvirtual

Is this CUDA stream ordered memory allocator?

Reimplemented from amrex::Arena.

◆ operator=() [1/2]

PArena& amrex::PArena::operator= ( const PArena rhs)
delete

◆ operator=() [2/2]

PArena& amrex::PArena::operator= ( PArena &&  rhs)
delete

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