LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace > Class Template Reference#

DiFfRG: DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace > Class Template Reference
DiFfRG
DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace > Class Template Reference

A linear interpolator for 1D data, both on GPU and CPU. More...

#include <linear_interpolator_1d.hh>

Public Types

using memory_space = DefaultMemorySpace
 
using other_memory_space = other_memory_space_t<DefaultMemorySpace>
 
using ctype = typename Coordinates::ctype
 
using value_type = NT
 

Public Member Functions

 LinearInterpolator1D (const Coordinates &coordinates)
 Construct a LinearInterpolator1D with internal, zeroed data and a coordinate system.
 
KOKKOS_FUNCTION LinearInterpolator1D (const LinearInterpolator1D &other)
 Copy constructor for LinearInterpolator1D. This is ONLY for usage inside Kokkos parallel loops.
 
KOKKOS_FUNCTION ~LinearInterpolator1D ()
 
template<typename NT2 >
void update (const NT2 *in_data)
 
template<typename View >
requires Kokkos::is_view<View>::value
void update (const View &view)
 
NT operator[] (size_t i) const
 
NT KOKKOS_FUNCTION operator() (const typename Coordinates::ctype x) const
 Interpolate the data at a given point.
 
const Coordinates & get_coordinates () const
 Get the coordinate system of the data.
 
auto & CPU () const
 
auto & GPU () const
 
template<typename MemorySpace >
auto & get_on () const
 
NT * data ()
 

Static Public Attributes

static constexpr size_t dim = 1
 

Private Types

using ViewType = Kokkos::View<NT *, DefaultMemorySpace, Kokkos::MemoryTraits<Kokkos::RandomAccess>>
 
using HostViewType = typename ViewType::host_mirror_type
 

Private Attributes

const Coordinates coordinates
 
const size_t size
 
ViewType device_data
 
HostViewType host_data
 
LinearInterpolator1D< NT, Coordinates, other_memory_space > * other_instance = nullptr
 
bool owns_other_instance = false
 

Friends

class LinearInterpolator1D< NT, Coordinates, other_memory_space >
 

Detailed Description

template<typename NT, typename Coordinates, typename DefaultMemorySpace = CPU_memory>
class DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace >

A linear interpolator for 1D data, both on GPU and CPU.

Template Parameters
NTinput data type
Coordinatescoordinate system of the input data

Member Typedef Documentation

◆ ctype

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
using DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace >::ctype = typename Coordinates::ctype

◆ HostViewType

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
using DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace >::HostViewType = typename ViewType::host_mirror_type
private

◆ memory_space

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
using DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace >::memory_space = DefaultMemorySpace

◆ other_memory_space

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
using DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace >::other_memory_space = other_memory_space_t<DefaultMemorySpace>

◆ value_type

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
using DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace >::value_type = NT

◆ ViewType

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
using DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace >::ViewType = Kokkos::View<NT *, DefaultMemorySpace, Kokkos::MemoryTraits<Kokkos::RandomAccess>>
private

Constructor & Destructor Documentation

◆ LinearInterpolator1D() [1/2]

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace >::LinearInterpolator1D ( const Coordinates & coordinates)
inline

Construct a LinearInterpolator1D with internal, zeroed data and a coordinate system.

Parameters
sizesize of the internal data
coordinatescoordinate system of the data

◆ LinearInterpolator1D() [2/2]

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
KOKKOS_FUNCTION DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace >::LinearInterpolator1D ( const LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace > & other)
inline

Copy constructor for LinearInterpolator1D. This is ONLY for usage inside Kokkos parallel loops.

◆ ~LinearInterpolator1D()

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
KOKKOS_FUNCTION DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace >::~LinearInterpolator1D ( )
inline

Member Function Documentation

◆ CPU()

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
auto & DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace >::CPU ( ) const
inline

◆ data()

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
NT * DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace >::data ( )
inline

◆ get_coordinates()

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
const Coordinates & DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace >::get_coordinates ( ) const
inline

Get the coordinate system of the data.

Returns
const Coordinates& the coordinate system

◆ get_on()

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
template<typename MemorySpace >
auto & DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace >::get_on ( ) const
inline

◆ GPU()

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
auto & DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace >::GPU ( ) const
inline

◆ operator()()

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
NT KOKKOS_FUNCTION DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace >::operator() ( const typename Coordinates::ctype x) const
inline

Interpolate the data at a given point.

Parameters
xthe point at which to interpolate
Returns
NT the interpolated value

◆ operator[]()

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
NT DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace >::operator[] ( size_t i) const
inline

◆ update() [1/2]

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
template<typename NT2 >
void DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace >::update ( const NT2 * in_data)
inline

◆ update() [2/2]

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
template<typename View >
requires Kokkos::is_view<View>::value
void DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace >::update ( const View & view)
inline

Friends And Related Symbol Documentation

◆ LinearInterpolator1D< NT, Coordinates, other_memory_space >

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
friend class LinearInterpolator1D< NT, Coordinates, other_memory_space >
friend

Member Data Documentation

◆ coordinates

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
const Coordinates DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace >::coordinates
private

◆ device_data

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
ViewType DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace >::device_data
private

◆ dim

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
size_t DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace >::dim = 1
staticconstexpr

◆ host_data

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
HostViewType DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace >::host_data
private

◆ other_instance

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
LinearInterpolator1D<NT, Coordinates, other_memory_space>* DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace >::other_instance = nullptr
mutableprivate

◆ owns_other_instance

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
bool DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace >::owns_other_instance = false
mutableprivate

◆ size

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
const size_t DiFfRG::LinearInterpolator1D< NT, Coordinates, DefaultMemorySpace >::size
private

The documentation for this class was generated from the following file: