LinearInterpolator3D< NT, Coordinates > Class Template Reference#
|
DiFfRG
Discretization Framework for functional Renormalization Group flows
|
A linear interpolator for 3D data, callable from host AND device code. More...
#include <linear_interpolator_3d.hh>
Public Types | |
| using | ctype = typename Coordinates::ctype |
| using | value_type = NT |
Public Member Functions | |
| LinearInterpolator3D (const Coordinates &coordinates) | |
| Construct a LinearInterpolator3D with internal, zeroed data and a coordinate system. | |
| KOKKOS_DEFAULTED_FUNCTION | LinearInterpolator3D (const LinearInterpolator3D &)=default |
| Shallow copy of BOTH views, valid in host and in device code. See LinearInterpolator1D. | |
| template<typename NT2 > | |
| void | update (const NT2 *in_data) |
| Replace the data, leaving host AND device current. The only mutator. | |
| NT | operator[] (size_t i) const |
| Host-side element access, in the row-major order update() takes its input in. | |
| device::array< ctype, 3 > KOKKOS_FUNCTION | index (const ctype &x, const ctype &y, const ctype &z) const |
| Map physical coordinates onto grid indices. | |
| NT KOKKOS_FUNCTION | at (const device::array< ctype, 3 > &idx) const |
| Interpolate at grid indices previously obtained from index(). | |
| NT KOKKOS_FUNCTION | operator() (const ctype &x, const ctype &y, const ctype &z) const |
| Interpolate the data at a given point. | |
| const Coordinates & | get_coordinates () const |
| Get the coordinate system of the data. | |
| const NT * | data () const |
| Read-only handle to the host values, in the mirror's storage order. | |
Static Public Attributes | |
| static constexpr size_t | dim = 3 |
Private Types | |
| using | ViewType = Kokkos::View<NT ***, GPU_memory, Kokkos::MemoryTraits<Kokkos::RandomAccess>> |
| using | HostViewType = typename ViewType::host_mirror_type |
Private Member Functions | |
| KOKKOS_FORCEINLINE_FUNCTION NT | value (const size_t i, const size_t j, const size_t k) const |
| Read one element from whichever buffer belongs to the executing side. | |
Private Attributes | |
| const Coordinates | coordinates |
| const device::array< size_t, 3 > | sizes |
| ViewType | device_data |
| HostViewType | host_data |
Static Private Attributes | |
| static constexpr bool | periodic_x = is_periodic_axis_v<Coordinates, 0> |
| static constexpr bool | periodic_y = is_periodic_axis_v<Coordinates, 1> |
| static constexpr bool | periodic_z = is_periodic_axis_v<Coordinates, 2> |
| static constexpr bool | has_separate_device |
Detailed Description
class DiFfRG::LinearInterpolator3D< NT, Coordinates >
A linear interpolator for 3D data, callable from host AND device code.
See LinearInterpolator1D for the host/device dispatch rationale.
- Template Parameters
-
NT input data type Coordinates coordinate system of the input data
Member Typedef Documentation
◆ ctype
| using DiFfRG::LinearInterpolator3D< NT, Coordinates >::ctype = typename Coordinates::ctype |
◆ HostViewType
|
private |
◆ value_type
| using DiFfRG::LinearInterpolator3D< NT, Coordinates >::value_type = NT |
◆ ViewType
|
private |
Constructor & Destructor Documentation
◆ LinearInterpolator3D() [1/2]
|
inline |
Construct a LinearInterpolator3D with internal, zeroed data and a coordinate system.
- Parameters
-
coordinates coordinate system of the data
◆ LinearInterpolator3D() [2/2]
|
default |
Shallow copy of BOTH views, valid in host and in device code. See LinearInterpolator1D.
Member Function Documentation
◆ at()
|
inline |
Interpolate at grid indices previously obtained from index().
◆ data()
|
inline |
Read-only handle to the host values, in the mirror's storage order.
NOTE the storage order is NOT the row-major order update() takes; see LinearInterpolator2D.
◆ get_coordinates()
|
inline |
Get the coordinate system of the data.
- Returns
- const Coordinates& the coordinate system
◆ index()
|
inline |
Map physical coordinates onto grid indices.
Split out of operator() because it is the expensive half: Coordinates::backward is a fp64 log/log1p per logarithmic axis, ~200 fp64 instructions each on current NVIDIA parts against ~10 for the interpolation. A generated kernel evaluating several dressings at the SAME point otherwise pays it once per dressing – the compiler cannot CSE it, because each interpolator owns its own coordinates members and cannot be proven to agree with another's.
Depends only on the coordinate system, so the result may be shared across interpolators that share one. Clamping and stencil resolution stay in at(), since they are size dependent and would otherwise make an index untransferable between interpolators of different extent.
The return type is spelled out rather than deduced: nvcc loses decltype(var) when the initializer has a deduced return type inside a class-template member, and the consumer stores this in a const auto.
◆ operator()()
|
inline |
Interpolate the data at a given point.
◆ operator[]()
|
inline |
Host-side element access, in the row-major order update() takes its input in.
◆ update()
|
inline |
Replace the data, leaving host AND device current. The only mutator.
in_data is row-major; see LinearInterpolator2D::update() for why the fill indexes the mirror through operator() instead of copying flat, and LinearInterpolator1D::update() for why the single trailing fence is not optional.
◆ value()
|
inlineprivate |
Read one element from whichever buffer belongs to the executing side.
Member Data Documentation
◆ coordinates
|
private |
◆ device_data
|
private |
◆ dim
|
staticconstexpr |
◆ has_separate_device
|
staticconstexprprivate |
◆ host_data
|
private |
◆ periodic_x
|
staticconstexprprivate |
◆ periodic_y
|
staticconstexprprivate |
◆ periodic_z
|
staticconstexprprivate |
◆ sizes
|
private |
The documentation for this class was generated from the following file:
- /home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/physics/interpolation/linear_interpolator_3d.hh
Generated by