Block-Structured AMR Software Framework
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
10namespace amrex::EB2 {
11
13template <typename T>
15 : public GPUable
16{
17public:
18
20 DevicePtrIF(T* a_p) : p(a_p) {}
21
23 [[nodiscard]] AMREX_GPU_HOST_DEVICE
25 {
26 return (*p)(AMREX_D_DECL(x,y,z));
27 }
28
30 [[nodiscard]] Real operator() (const RealArray& a) const noexcept
31 {
32 return this->operator() (AMREX_D_DECL(a[0], a[1], a[2]));
33 }
34
35protected:
36 T* p = nullptr;
37};
38
39}
40
41#endif
#define AMREX_GPU_HOST_DEVICE
Definition AMReX_GpuQualifiers.H:20
#define AMREX_D_DECL(a, b, c)
Definition AMReX_SPACE.H:171
Wrapper that forwards operator() calls to an implicit function pointer.
Definition AMReX_EB2_IF_DevicePtr.H:16
AMREX_GPU_HOST_DEVICE Real operator()(AMREX_D_DECL(Real x, Real y, Real z)) const noexcept
Device-friendly overload dispatching to the pointee.
Definition AMReX_EB2_IF_DevicePtr.H:24
DevicePtrIF(T *a_p)
Store the pointer that owns the actual implicit-function operator.
Definition AMReX_EB2_IF_DevicePtr.H:20
T * p
Definition AMReX_EB2_IF_DevicePtr.H:36
amrex_real Real
Floating Point Type for Fields.
Definition AMReX_REAL.H:79
Definition AMReX_FabArrayBase.H:33
Array< Real, 3 > RealArray
Definition AMReX_Array.H:28
Marker base that denotes an implicit function callable on device kernels.
Definition AMReX_EB2_IF_Base.H:19