Block-Structured AMR Software Framework
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
AMReX_SUNMemory.H
Go to the documentation of this file.
1#ifndef AMREX_SUNMEMORY_H_
2#define AMREX_SUNMEMORY_H_
3
4#include <AMReX_Arena.H>
6#include <sundials/sundials_context.h>
7#include <sundials/sundials_memory.h>
8
9namespace amrex::sundials {
10
17public:
18 MemoryHelper(::sundials::Context* sunctx);
20 MemoryHelper(const MemoryHelper& rhs);
21 MemoryHelper(MemoryHelper&& rhs) noexcept;
22 MemoryHelper& operator=(MemoryHelper const& rhs) = delete;
23 MemoryHelper& operator=(MemoryHelper&& rhs) noexcept;
24 operator SUNMemoryHelper() const { return helper; }
25
26 static void Initialize(int nthreads);
27 static void Finalize();
28private:
29 SUNMemoryHelper helper;
30 ::sundials::Context* sunctx;
31};
32
33
43
50amrex::Arena* getArena (SUNMemoryType type);
51
52}//amrex::sundials
53
54#endif
A virtual base class for objects that manage their own dynamic memory allocation.
Definition AMReX_Arena.H:100
A SUNDIALS SUNMemoryHelper interface to the amrex::Arena.
Definition AMReX_SUNMemory.H:16
~MemoryHelper()
Definition AMReX_SUNMemory.cpp:142
SUNMemoryHelper helper
Definition AMReX_SUNMemory.H:29
static void Initialize(int nthreads)
Definition AMReX_SUNMemory.cpp:174
::sundials::Context * sunctx
Definition AMReX_SUNMemory.H:30
static void Finalize()
Definition AMReX_SUNMemory.cpp:190
MemoryHelper & operator=(MemoryHelper const &rhs)=delete
constexpr int get_thread_num()
Definition AMReX_OpenMP.H:37
Definition AMReX_NVector_MultiFab.cpp:15
amrex::Arena * getArena(SUNMemoryType type)
Get the proper amrex::Arena based on the SUNMemoryType.
MemoryHelper * The_SUNMemory_Helper(int i)
Get the i-th SUNMemoryHelper instance.
Definition AMReX_SUNMemory.cpp:199