/home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/physics/interpolation/linear_interpolator_2d.hh Source File#
|
DiFfRG
|
linear_interpolator_2d.hh
Go to the documentation of this file.
15 template <typename NT, typename Coordinates, typename DefaultMemorySpace = CPU_memory> class LinearInterpolator2D
102 NT KOKKOS_FUNCTION operator()(const typename Coordinates::ctype x, const typename Coordinates::ctype y) const
106 idx_x = max(static_cast<decltype(idx_x)>(0), min(idx_x, static_cast<decltype(idx_x)>(sizes[0] - 1)));
107 idx_y = max(static_cast<decltype(idx_y)>(0), min(idx_y, static_cast<decltype(idx_y)>(sizes[1] - 1)));
A linear interpolator for 2D data, both on GPU and CPU.
Definition linear_interpolator_2d.hh:16
bool owns_other_instance
Definition linear_interpolator_2d.hh:189
const Coordinates & get_coordinates() const
Get the coordinate system of the data.
Definition linear_interpolator_2d.hh:164
NT KOKKOS_FUNCTION operator()(const typename Coordinates::ctype x, const typename Coordinates::ctype y) const
Interpolate the data at a given point.
Definition linear_interpolator_2d.hh:102
void update(const NT2 *in_data)
Definition linear_interpolator_2d.hh:58
KOKKOS_FUNCTION ~LinearInterpolator2D()
Definition linear_interpolator_2d.hh:53
NT operator[](size_t i) const
Definition linear_interpolator_2d.hh:86
DefaultMemorySpace memory_space
Definition linear_interpolator_2d.hh:20
HostViewType host_data
Definition linear_interpolator_2d.hh:186
const size_t total_size
Definition linear_interpolator_2d.hh:180
const Coordinates coordinates
Definition linear_interpolator_2d.hh:178
other_memory_space_t< DefaultMemorySpace > other_memory_space
Definition linear_interpolator_2d.hh:21
const device::array< size_t, 2 > sizes
Definition linear_interpolator_2d.hh:179
void update(const View &view)
Definition linear_interpolator_2d.hh:73
typename ViewType::host_mirror_type HostViewType
Definition linear_interpolator_2d.hh:183
LinearInterpolator2D(const Coordinates &coordinates)
Construct a LinearInterpolator2D with internal, zeroed data and a coordinate system.
Definition linear_interpolator_2d.hh:32
Kokkos::View< NT **, DefaultMemorySpace, Kokkos::MemoryTraits< Kokkos::RandomAccess > > ViewType
Definition linear_interpolator_2d.hh:182
typename Coordinates::ctype ctype
Definition linear_interpolator_2d.hh:22
ViewType device_data
Definition linear_interpolator_2d.hh:185
KOKKOS_FUNCTION LinearInterpolator2D(const LinearInterpolator2D &other)
Copy constructor for LinearInterpolator2D. This is ONLY for usage inside Kokkos parallel loops.
Definition linear_interpolator_2d.hh:46
LinearInterpolator2D< NT, Coordinates, other_memory_space > * other_instance
Definition linear_interpolator_2d.hh:188
Definition complex_math.hh:10
std::conditional_t< std::is_same_v< MemorySpace, GPU_memory >, CPU_memory, GPU_memory > other_memory_space_t
Definition kokkos.hh:58
Generated by