isce3  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
gpuLUT2d.h
1 #pragma once
2 
3 #include "forward.h"
4 #include <isce3/core/forward.h>
5 #include <isce3/cuda/core/forward.h>
6 
7 #include <cmath>
8 
9 #include <isce3/core/Common.h>
10 #include <isce3/core/Constants.h>
11 
12 namespace isce3 { namespace cuda { namespace core {
13 
14 template<typename T>
15 class gpuLUT2d {
16 public:
19 
21  gpuLUT2d(const gpuLUT2d<T>&);
22 
24  CUDA_HOSTDEV gpuLUT2d(gpuLUT2d<T>&);
25 
27  CUDA_HOSTDEV gpuLUT2d& operator=(gpuLUT2d<T>&);
28 
30  ~gpuLUT2d();
31 
33  CUDA_HOSTDEV double xStart() const { return _xstart; }
34 
36  CUDA_HOSTDEV double yStart() const { return _ystart; }
37 
39  CUDA_HOSTDEV double xSpacing() const { return _dx; }
40 
42  CUDA_HOSTDEV double ySpacing() const { return _dy; }
43 
45  CUDA_HOSTDEV size_t length() const { return _length; }
46 
48  CUDA_HOSTDEV size_t width() const { return _width; }
49 
51  CUDA_HOSTDEV T refValue() const { return _refValue; }
52 
54  CUDA_HOSTDEV bool haveData() const { return _haveData; }
55 
57  CUDA_HOSTDEV bool boundsError() const { return _boundsError; }
58 
60  CUDA_HOSTDEV
61  isce3::core::dataInterpMethod interpMethod() const { return _interpMethod; }
62 
64  CUDA_HOSTDEV gpuInterpolator<T>** interp() const { return _interp; }
65 
67  CUDA_HOSTDEV T* data() { return _data; }
68 
70  CUDA_HOSTDEV const T* data() const { return _data; }
71 
73  CUDA_HOSTDEV void data(T* v) { _data = v; }
74 
82  CUDA_DEV T eval(double y, double x) const;
83 
85  T eval_h(double y, double x);
86 
87 private:
88  // Flags
89  bool _haveData;
90  bool _boundsError;
91  T _refValue;
92  // Coordinates
93  double _xstart, _ystart, _dx, _dy;
94  // LUT data
95  size_t _length, _width;
96  T* _data;
97  // Interpolator pointer
98  isce3::core::dataInterpMethod _interpMethod;
99  gpuInterpolator<T>** _interp;
100  // Do I own data?
101  bool _owner;
102 
103  // Interpolation pointer handlers
104 
106  void _initInterp();
107 
109  void _finalizeInterp();
110 };
111 
112 }}} // namespace isce3::cuda::core
CUDA_HOSTDEV isce3::core::dataInterpMethod interpMethod() const
Get interp method.
Definition: gpuLUT2d.h:61
T eval_h(double y, double x)
Evaluate the LUT from host (test function)
CUDA_HOSTDEV T refValue() const
Get the reference value.
Definition: gpuLUT2d.h:51
CUDA_HOSTDEV T * data()
Access to data values.
Definition: gpuLUT2d.h:67
CUDA_HOSTDEV gpuLUT2d & operator=(gpuLUT2d< T > &)
Shallow assignment operator on device.
dataInterpMethod
Enumeration type to indicate interpolation method.
Definition: Constants.h:23
CUDA_HOSTDEV double ySpacing() const
Get Y-spacing.
Definition: gpuLUT2d.h:42
CUDA_HOSTDEV gpuInterpolator< T > ** interp() const
Get pointer to interpolator.
Definition: gpuLUT2d.h:64
CUDA_HOSTDEV bool boundsError() const
Get bounds error flag.
Definition: gpuLUT2d.h:57
CUDA_HOSTDEV double xSpacing() const
Get X-spacing.
Definition: gpuLUT2d.h:39
CUDA_HOSTDEV size_t length() const
Get LUT length (number of lines)
Definition: gpuLUT2d.h:45
gpuLUT2d(const isce3::core::LUT2d< T > &)
Deep copy constructor from CPU LUT1d.
Data structure to store 2D Lookup table.
Definition: forward.h:30
CUDA_HOSTDEV bool haveData() const
Get flag for having data.
Definition: gpuLUT2d.h:54
CUDA_HOSTDEV double xStart() const
Get starting X-coordinate.
Definition: gpuLUT2d.h:33
CUDA_HOSTDEV void data(T *v)
Set the data values pointer.
Definition: gpuLUT2d.h:73
CUDA_HOSTDEV const T * data() const
Read-only access to data values.
Definition: gpuLUT2d.h:70
CUDA_HOSTDEV double yStart() const
Get starting Y-coordinate.
Definition: gpuLUT2d.h:36
CUDA_HOSTDEV size_t width() const
Get LUT width (number of samples)
Definition: gpuLUT2d.h:48
CUDA_DEV T eval(double y, double x) const
Evaluate the LUT.

Generated for ISCE3.0 by doxygen 1.8.5.