isce3 0.25.0
Loading...
Searching...
No Matches
gpuPoly2d.h
1#pragma once
2
3#include <isce3/core/forward.h>
4#include <isce3/core/Common.h>
5
6#include <cmath>
7
8namespace isce3 { namespace cuda { namespace core {
9 struct gpuPoly2d{
10 int xOrder;
11 int yOrder;
12 double xMean;
13 double yMean;
14 double xNorm;
15 double yNorm;
16 double *coeffs;
17 // True if copy-constructed from Orbit (on host),
18 // False if copy-constructed from gpuOrbit (on device)
19 bool owner;
20
21 // Shallow-copy copy constructor only allowed on device, not host, but not allowed to free
22 // own memory (host copy of gpuPoly2d is only one allowed)
23 CUDA_DEV gpuPoly2d(int xo, int yo, double xm, double ym, double xn, double yn) : xOrder(xo),
24 yOrder(yo),
25 xMean(xm),
26 yMean(ym),
27 xNorm(xn),
28 yNorm(yn),
29 owner(false)
30 {}
31 CUDA_HOSTDEV gpuPoly2d() : gpuPoly2d(-1,-1,0.,0.,1.,1.) {}
32 // Advanced "copy constructor only allowed on host (manages deep copies from host to device)
33 CUDA_DEV gpuPoly2d(const gpuPoly2d &p) : xOrder(p.xOrder), yOrder(p.yOrder),
34 xMean(p.xMean), yMean(p.yMean),
35 xNorm(p.xNorm), yNorm(p.yNorm),
36 coeffs(p.coeffs), owner(false) {}
37 CUDA_HOST gpuPoly2d(const isce3::core::Poly2d&);
38 ~gpuPoly2d();
39
40 CUDA_HOSTDEV inline gpuPoly2d& operator=(const gpuPoly2d&);
41
42 CUDA_DEV double eval(double, double) const;
43
44 // Host function to test underlying device function in a single-threaded context
45 CUDA_HOST double eval_h(double, double);
46 };
47
48
49 CUDA_HOSTDEV inline gpuPoly2d& gpuPoly2d::operator=(const gpuPoly2d &rhs)
50 {
51 xOrder = rhs.xOrder;
52 yOrder = rhs.yOrder;
53 xMean = rhs.xMean;
54 yMean = rhs.yMean;
55 xNorm = rhs.xNorm;
56 yNorm = rhs.yNorm;
57 coeffs = rhs.coeffs;
58 return *this;
59 }
60
61
62}}}
Data structure for representing 2D polynomials.
Definition Poly2d.h:20
base interpolator is an abstract base class
Definition BinarySearchFunc.cpp:5
Definition gpuPoly2d.h:9

Generated for ISCE3.0 by doxygen 1.13.2.