Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
AMReX_SArena.H
Go to the documentation of this file.
1#ifndef AMREX_SARENA_H_
2#define AMREX_SARENA_H_
3#include <AMReX_Config.H>
4
5#include <AMReX_Arena.H>
6
7
8namespace amrex {
25class SArena
26 :
27 public Arena
28{
29public:
36 [[nodiscard]] void* alloc (std::size_t sz) final;
43 void free (void* pt) final;
44
45 [[nodiscard]] bool isDeviceAccessible () const final;
46 [[nodiscard]] bool isHostAccessible () const final;
47
48 [[nodiscard]] bool isManaged () const final;
49 [[nodiscard]] bool isDevice () const final;
50 [[nodiscard]] bool isPinned () const final;
51
52#ifdef AMREX_USE_GPU
54 [[nodiscard]] bool isStreamOrderedArena () const final { return true; }
55#endif
56};
57
58}
59
60#endif
A virtual base class for objects that manage their own dynamic memory allocation.
Definition AMReX_Arena.H:124
A STREAM-ordered memory arena.
Definition AMReX_SArena.H:28
bool isDevice() const final
Check whether it is non-managed GPU device memory.
Definition AMReX_SArena.cpp:38
bool isStreamOrderedArena() const final
Is this a GPU stream ordered memory allocator?
Definition AMReX_SArena.H:54
void * alloc(std::size_t sz) final
Allocates dynamic memory from the arena of size sz. Returns a pointer to this memory....
Definition AMReX_SArena.cpp:5
bool isManaged() const final
Check whether it is managed GPU memory.
Definition AMReX_SArena.cpp:32
bool isPinned() const final
Check whether it is pinned host memory.
Definition AMReX_SArena.cpp:44
bool isDeviceAccessible() const final
Definition AMReX_SArena.cpp:20
void free(void *pt) final
Deletes the arena pointed to by pt. After this function is called, the memory can still be used by al...
Definition AMReX_SArena.cpp:13
bool isHostAccessible() const final
Definition AMReX_SArena.cpp:26
Definition AMReX_Amr.cpp:49