isce3 0.25.0
Loading...
Searching...
No Matches
gpuTopoLayers.h
1//
2// Author: Bryan Riel
3// Copyright 2018
4//
5
6#pragma once
7
8#include "forward.h"
9
10#include <iostream>
11#include <isce3/core/Common.h>
12#include <isce3/geometry/forward.h>
13
14// DEMInterpolator declaration
16
17 public:
18 // Constructor for host only - allocate memory on device
19 CUDA_HOST gpuTopoLayers(const isce3::geometry::TopoLayers & layers);
20
21 // Copy constructor on device (these should nominally be CUDA_HOSTDEV)
22 CUDA_HOSTDEV
23 gpuTopoLayers(const gpuTopoLayers & layers) :
24 _x(layers._x),
25 _y(layers._y),
26 _z(layers._z),
27 _inc(layers._inc),
28 _hdg(layers._hdg),
29 _localInc(layers._localInc),
30 _localPsi(layers._localPsi),
31 _sim(layers._sim),
32 _crossTrack(layers._crossTrack),
33 _groundToSatEast(layers._groundToSatEast),
34 _groundToSatNorth(layers._groundToSatNorth),
35 _length(layers.length()),
36 _width(layers.width()),
37 _nbytes_double(layers.nbytes_double()),
38 _nbytes_float(layers.nbytes_float()),
39 _owner(false)
40 {}
41
42 // Destructor
43 CUDA_HOST ~gpuTopoLayers();
44
45 // Set values for a single index; on GPU, all arrays are flattened
46 CUDA_DEV inline void x(size_t index, double value) {
47 _x[index] = value;
48 }
49
50 CUDA_DEV inline void y(size_t index, double value) {
51 _y[index] = value;
52 }
53
54 CUDA_DEV inline void z(size_t index, double value) {
55 _z[index] = value;
56 }
57
58 CUDA_DEV inline void inc(size_t index, float value) {
59 _inc[index] = value;
60 }
61
62 CUDA_DEV inline void hdg(size_t index, float value) {
63 _hdg[index] = value;
64 }
65
66 CUDA_DEV inline void localInc(size_t index, float value) {
67 _localInc[index] = value;
68 }
69
70 CUDA_DEV inline void localPsi(size_t index, float value) {
71 _localPsi[index] = value;
72 }
73
74 CUDA_DEV inline void sim(size_t index, float value) {
75 _sim[index] = value;
76 }
77
78 CUDA_DEV inline void crossTrack(size_t index, double value) {
79 _crossTrack[index] = value;
80 }
81
82 CUDA_DEV inline void groundToSatEast(size_t index, float value) {
83 _groundToSatEast[index] = value;
84 }
85
86 CUDA_DEV inline void groundToSatNorth(size_t index, float value) {
87 _groundToSatNorth[index] = value;
88 }
89
90 // Get sizes on host or device
91 CUDA_HOSTDEV inline size_t length() const { return _length; }
92 CUDA_HOSTDEV inline size_t width() const { return _width; }
93 CUDA_HOSTDEV inline size_t nbytes_double() const { return _nbytes_double; }
94 CUDA_HOSTDEV inline size_t nbytes_float() const { return _nbytes_float; }
95
96 // Copy results to host TopoLayers
97 CUDA_HOST void copyToHost(isce3::geometry::TopoLayers & layers);
98
99 // Unlike CPU version, make the data pointers public to allow for easy
100 // copy construction on the device; still use the underbar convention to discourage
101 // interfacing with pointers directly
102 double * _x;
103 double * _y;
104 double * _z;
105 float * _inc;
106 float * _hdg;
107 float * _localInc;
108 float * _localPsi;
109 float * _sim;
110 double * _crossTrack;
111 float * _groundToSatEast;
112 float * _groundToSatNorth;
113
114 private:
115 size_t _length;
116 size_t _width;
117 size_t _nbytes_double, _nbytes_float;
118 bool _owner;
119};
Definition gpuTopoLayers.h:15
Definition TopoLayers.h:10

Generated for ISCE3.0 by doxygen 1.13.2.