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 {
24class SArena
25 :
26 public Arena
27{
28public:
35 [[nodiscard]] void* alloc (std::size_t sz) final;
42 void free (void* pt) final;
43
44 [[nodiscard]] bool isDeviceAccessible () const final;
45 [[nodiscard]] bool isHostAccessible () const final;
46
47 [[nodiscard]] bool isManaged () const final;
48 [[nodiscard]] bool isDevice () const final;
49 [[nodiscard]] bool isPinned () const final;
50
51#ifdef AMREX_USE_GPU
53 [[nodiscard]] bool isStreamOrderedArena () const final { return true; }
54#endif
55};
56
57}
58
59#endif
A virtual base class for objects that manage their own dynamic memory allocation.
Definition AMReX_Arena.H:105
A STREAM-ordered memory arena.
Definition AMReX_SArena.H:27
bool isDevice() const final
Definition AMReX_SArena.cpp:38
bool isStreamOrderedArena() const final
Is this a GPU stream ordered memory allocator?
Definition AMReX_SArena.H:53
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
Definition AMReX_SArena.cpp:32
bool isPinned() const final
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