Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
amrex::ArenaInfo Struct Reference

Configuration options for constructing an Arena. More...

#include <AMReX_Arena.H>

Public Member Functions

ArenaInfoSetReleaseThreshold (Long rt) noexcept
 Set the usage threshold that triggers release of cached unused blocks before growing.
 
ArenaInfoSetDeviceMemory () noexcept
 Configure the arena to use non-managed GPU device memory.
 
ArenaInfoSetReadOnly () noexcept
 Advise the runtime that the managed memory will be read-only on the device.
 
ArenaInfoSetPreferred () noexcept
 Advise the runtime to prefer device residence for the managed memory.
 
ArenaInfoSetHostAlloc () noexcept
 Configure the arena to use host-pinned memory.
 
ArenaInfoSetCpuMemory () noexcept
 Configure the arena to use CPU (host) memory.
 
ArenaInfoSetDefragmentation (bool b) noexcept
 Enable or disable defragmentation in the arena.
 

Public Attributes

Long release_threshold = std::numeric_limits<Long>::max()
 When usage would exceed this, cached unused blocks are released first.
 
bool use_cpu_memory = false
 Allocate CPU (host) memory instead of GPU memory.
 
bool device_use_managed_memory = true
 Use CUDA/HIP managed (unified) memory for GPU allocations.
 
bool device_set_readonly = false
 Advise the runtime that the managed memory is read-only on the device.
 
bool device_set_preferred = false
 Advise the runtime to prefer the device for managed memory.
 
bool device_use_hostalloc = false
 Use host-pinned memory (cudaMallocHost/hipHostMalloc).
 
bool defragmentation = false
 

Detailed Description

Configuration options for constructing an Arena.

Uses a builder pattern: each setter returns *this to allow chaining.

Member Function Documentation

◆ SetCpuMemory()

ArenaInfo & amrex::ArenaInfo::SetCpuMemory ( )
inlinenoexcept

Configure the arena to use CPU (host) memory.

◆ SetDefragmentation()

ArenaInfo & amrex::ArenaInfo::SetDefragmentation ( bool  b)
inlinenoexcept

Enable or disable defragmentation in the arena.

◆ SetDeviceMemory()

ArenaInfo & amrex::ArenaInfo::SetDeviceMemory ( )
inlinenoexcept

Configure the arena to use non-managed GPU device memory.

◆ SetHostAlloc()

ArenaInfo & amrex::ArenaInfo::SetHostAlloc ( )
inlinenoexcept

Configure the arena to use host-pinned memory.

◆ SetPreferred()

ArenaInfo & amrex::ArenaInfo::SetPreferred ( )
inlinenoexcept

Advise the runtime to prefer device residence for the managed memory.

◆ SetReadOnly()

ArenaInfo & amrex::ArenaInfo::SetReadOnly ( )
inlinenoexcept

Advise the runtime that the managed memory will be read-only on the device.

◆ SetReleaseThreshold()

ArenaInfo & amrex::ArenaInfo::SetReleaseThreshold ( Long  rt)
inlinenoexcept

Set the usage threshold that triggers release of cached unused blocks before growing.

Member Data Documentation

◆ defragmentation

bool amrex::ArenaInfo::defragmentation = false

Enable defragmentation in the arena.

◆ device_set_preferred

bool amrex::ArenaInfo::device_set_preferred = false

Advise the runtime to prefer the device for managed memory.

◆ device_set_readonly

bool amrex::ArenaInfo::device_set_readonly = false

Advise the runtime that the managed memory is read-only on the device.

◆ device_use_hostalloc

bool amrex::ArenaInfo::device_use_hostalloc = false

Use host-pinned memory (cudaMallocHost/hipHostMalloc).

◆ device_use_managed_memory

bool amrex::ArenaInfo::device_use_managed_memory = true

Use CUDA/HIP managed (unified) memory for GPU allocations.

◆ release_threshold

Long amrex::ArenaInfo::release_threshold = std::numeric_limits<Long>::max()

When usage would exceed this, cached unused blocks are released first.

◆ use_cpu_memory

bool amrex::ArenaInfo::use_cpu_memory = false

Allocate CPU (host) memory instead of GPU memory.


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