isce3 0.25.0
Loading...
Searching...
No Matches
gpuInterpolator.h
1#pragma once
2
3#include <isce3/core/forward.h>
4#include <isce3/core/Common.h>
5
6#include <thrust/host_vector.h>
7
9
11namespace isce3{ namespace cuda{ namespace core{
12template <class U>
13 class gpuInterpolator {
14 public:
15 CUDA_HOSTDEV gpuInterpolator() {}
16 CUDA_HOSTDEV virtual ~gpuInterpolator() {}
17 CUDA_DEV virtual U interpolate(double, double, const U*, size_t, size_t) = 0;
18 };
19
20
22template <class U>
23class gpuBilinearInterpolator : public isce3::cuda::core::gpuInterpolator<U> {
24 public:
25 CUDA_HOSTDEV gpuBilinearInterpolator(){};
26 CUDA_DEV U interpolate(double, double, const U*, size_t, size_t);
27 CUDA_HOST void interpolate_h(const Matrix<double>&, Matrix<U>&, double, double, U*);
28};
29
30
32template <class U>
33class gpuBicubicInterpolator : public isce3::cuda::core::gpuInterpolator<U> {
34 public:
35 CUDA_HOSTDEV gpuBicubicInterpolator(){};
36 CUDA_DEV U interpolate(double, double, const U*, size_t, size_t);
37 CUDA_HOST void interpolate_h(const Matrix<double>&, Matrix<U>&, double, double, U*);
38};
39
40
42template <class U>
43class gpuSpline2dInterpolator : public isce3::cuda::core::gpuInterpolator<U> {
44 protected:
45 size_t _order;
46 public:
47 CUDA_HOSTDEV gpuSpline2dInterpolator(size_t order):_order(order){};
48 CUDA_DEV U interpolate(double, double, const U*, size_t, size_t);
49 CUDA_HOST void interpolate_h(const Matrix<double>&, Matrix<U>&, double, double, U*);
50};
51
52
54template <class U>
55class gpuSinc2dInterpolator : public isce3::cuda::core::gpuInterpolator<U> {
56 protected:
57 double *_kernel;
58 // Number of divisions per sample (total number samples in the lookup
59 // table is kernel length * decimation factor)
60 int _decimationFactor;
61 // size of kernel
62 int _kernelLength;
63 // size of half kernel
64 int _halfKernelLength;
65 // True if initialized from host,
66 // False if copy-constructed from gpuSinc2dInterpolator on device
67 bool _owner;
68 public:
69 CUDA_HOSTDEV gpuSinc2dInterpolator(){};
70
80 CUDA_HOST gpuSinc2dInterpolator(
81 const int kernelLength, const int decimationFactor,
82 const double beta = 1.0, const double pedestal = 0.0);
83
95 CUDA_DEV gpuSinc2dInterpolator(double *device_filter, int kernelLength,
96 int decimationFactor) :
97 _kernel(device_filter),
98 _decimationFactor(decimationFactor),
99 _kernelLength(kernelLength),
100 _halfKernelLength(kernelLength / 2),
101 _owner(false) {};
102
103 CUDA_HOSTDEV gpuSinc2dInterpolator(const gpuSinc2dInterpolator &i):
104 _kernel(i._kernel),
105 _decimationFactor(i._decimationFactor),
106 _kernelLength(i._kernelLength),
107 _halfKernelLength(i._halfKernelLength),
108 _owner(false) {};
109
110 CUDA_HOSTDEV ~gpuSinc2dInterpolator();
111 CUDA_DEV U interpolate(double, double, const U*, size_t, size_t);
112 CUDA_HOST void interpolate_h(const Matrix<double>&, Matrix<U>&, double, double, U*);
113};
114
124CUDA_HOST void compute_normalized_coefficients(
125 const double beta, const int relfiltlen, const int decfactor,
126 const double pedestal, thrust::host_vector<double>& filter);
127
128
130template <class T>
131class gpuNearestNeighborInterpolator : public isce3::cuda::core::gpuInterpolator<T> {
132 public:
133 CUDA_HOSTDEV gpuNearestNeighborInterpolator(){};
134 CUDA_DEV T interpolate(double x, double y, const T* z, size_t nx, size_t ny = 0);
135};
136
137}}}
Data structure for a 2D row-major matrix.
Definition Matrix.h:23
Definition gpuInterpolator.h:13
gpuSinc2dInterpolator class derived from abstract gpuInterpolator class
Definition gpuInterpolator.h:55
CUDA_DEV gpuSinc2dInterpolator(double *device_filter, int kernelLength, int decimationFactor)
Device constructor where filter construction is performed on host and the result is passed to constru...
Definition gpuInterpolator.h:95
base interpolator is an abstract base class
Definition BinarySearchFunc.cpp:5

Generated for ISCE3.0 by doxygen 1.13.2.