isce3  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
gpuInterpolator.h
1 //
2 // Author: Liang Yu
3 // Copyright 2018
4 //
5 
6 #pragma once
7 
8 #include <stdio.h>
9 #include <complex>
10 #include <isce3/core/forward.h>
11 #include <isce3/core/Common.h>
12 
14 
16 namespace isce3{ namespace cuda{ namespace core{
17 template <class U>
18  class gpuInterpolator {
19  public:
20  CUDA_HOSTDEV gpuInterpolator() {}
21  CUDA_HOSTDEV virtual ~gpuInterpolator() {}
22  CUDA_DEV virtual U interpolate(double, double, const U*, size_t, size_t) = 0;
23  };
24 
25 
27 template <class U>
29  public:
30  CUDA_HOSTDEV gpuBilinearInterpolator(){};
31  CUDA_DEV U interpolate(double, double, const U*, size_t, size_t);
32  CUDA_HOST void interpolate_h(const Matrix<double>&, Matrix<U>&, double, double, U*);
33 };
34 
35 
37 template <class U>
39  public:
40  CUDA_HOSTDEV gpuBicubicInterpolator(){};
41  CUDA_DEV U interpolate(double, double, const U*, size_t, size_t);
42  CUDA_HOST void interpolate_h(const Matrix<double>&, Matrix<U>&, double, double, U*);
43 };
44 
45 
47 template <class U>
49  protected:
50  size_t _order;
51  public:
52  CUDA_HOSTDEV gpuSpline2dInterpolator(size_t order):_order(order){};
53  CUDA_DEV U interpolate(double, double, const U*, size_t, size_t);
54  CUDA_HOST void interpolate_h(const Matrix<double>&, Matrix<U>&, double, double, U*);
55 };
56 
57 
59 template <class U>
61  protected:
62  double *kernel;
63  int kernel_length, kernel_width, sinc_half; // filter dimension idec=length, ilen=width
64  int intpx, intpy; // sub-chip/image bounds? unclear...
65  // True if initialized from host, false if copy-constructed from gpuSinc2dInterpolator on device
66  bool owner;
67  public:
68  CUDA_HOSTDEV gpuSinc2dInterpolator(){};
69  CUDA_HOST gpuSinc2dInterpolator(int sincLen, int sincSub);
70  CUDA_HOSTDEV gpuSinc2dInterpolator(const gpuSinc2dInterpolator &i):
71  kernel(i.kernel), kernel_length(i.kernel_length), kernel_width(i.kernel_width), sinc_half(i.sinc_half),
72  intpx(i.intpx), intpy(i.intpy), owner(false) {};
73  CUDA_HOSTDEV ~gpuSinc2dInterpolator();
74  CUDA_HOST void sinc_coef(double, double, int, double, int, std::valarray<double>&);
75  CUDA_DEV U interpolate(double, double, const U*, size_t, size_t);
76  CUDA_HOST void interpolate_h(const Matrix<double>&, Matrix<U>&, double, double, U*);
77 };
78 }}}
gpuSpline2dInterpolator class derived from abstract gpuInterpolator class
Definition: gpuInterpolator.h:48
Definition: forward.h:11
gpuBicubicInterpolator class derived from abstract gpuInterpolator class
Definition: gpuInterpolator.h:38
gpuBilinearInterpolator class derived from abstract gpuInterpolator class
Definition: gpuInterpolator.h:28
Data structure for a 2D row-major matrix.
Definition: forward.h:31
gpuSinc2dInterpolator class derived from abstract gpuInterpolator class
Definition: forward.h:14

Generated for ISCE3.0 by doxygen 1.8.5.