Block-Structured AMR Software Framework
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
AMReX_EB2_IF_DevicePtr.H
Go to the documentation of this file.
1#ifndef AMREX_EB2_IF_DEVICEPTR_H_
2#define AMREX_EB2_IF_DEVICEPTR_H_
3
4namespace amrex::EB2 {
5
6template <typename T>
8 : public GPUable
9{
10public:
11
12 DevicePtrIF(T* a_p) : p(a_p) {}
13
14 [[nodiscard]] AMREX_GPU_HOST_DEVICE
15 Real operator() (AMREX_D_DECL(Real x, Real y, Real z)) const noexcept
16 {
17 return (*p)(AMREX_D_DECL(x,y,z));
18 }
19
20 [[nodiscard]] Real operator() (const RealArray& a) const noexcept
21 {
22 return this->operator() (AMREX_D_DECL(a[0], a[1], a[2]));
23 }
24
25protected:
26 T* p = nullptr;
27};
28
29}
30
31#endif
#define AMREX_GPU_HOST_DEVICE
Definition AMReX_GpuQualifiers.H:20
Definition AMReX_EB2_IF_DevicePtr.H:9
AMREX_GPU_HOST_DEVICE Real operator()(AMREX_D_DECL(Real x, Real y, Real z)) const noexcept
Definition AMReX_EB2_IF_DevicePtr.H:15
DevicePtrIF(T *a_p)
Definition AMReX_EB2_IF_DevicePtr.H:12
T * p
Definition AMReX_EB2_IF_DevicePtr.H:26
Definition AMReX_FabArrayBase.H:32
Array< Real, AMREX_SPACEDIM > RealArray
Definition AMReX_Array.H:26
Definition AMReX_EB2_IF_Base.H:11