isce3  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
gpuBasis.h
1 //
2 // Author: Bryan V. Riel
3 // Copyright 2017-2018
4 //
5 
6 #pragma once
7 
8 // isce3::core
9 #include <isce3/core/Basis.h>
10 
11 // isce3::cuda::core
12 #include <isce3/cuda/core/Common.h>
13 
16 
17  public:
19  CUDA_HOSTDEV inline gpuBasis() {
20  for (int i = 0; i < 3; ++i) {
21  x0[i] = 0.0;
22  x1[i] = 0.0;
23  x2[i] = 0.0;
24  }
25  }
26 
28  CUDA_HOSTDEV inline gpuBasis(double * x0, double * x1, double * x2) {
29  for (int i = 0; i < 3; ++i) {
30  this->x0[i] = x0[i];
31  this->x1[i] = x1[i];
32  this->x2[i] = x2[i];
33  }
34  }
35 
37  CUDA_HOST inline gpuBasis(const isce3::core::Basis & basis) {
38  for (int i = 0; i < 3; ++i) {
39  x0[i] = basis.x0()[i];
40  x1[i] = basis.x1()[i];
41  x2[i] = basis.x2()[i];
42  }
43  }
44 
53  CUDA_DEV inline void combine(double * vec, double * res) {
54  for (int ii = 0; ii < 3; ++ii) {
55  res[ii] = vec[0] * x0[ii] + vec[1] * x1[ii] + vec[2] * x2[ii];
56  }
57  };
58 
59  // Make data public to simplify access and to reduce use of temp variables
60  // in device code
61  double x0[3];
62  double x1[3];
63  double x2[3];
64 };
CUDA_HOSTDEV const Vec3 & x1() const
Return second basis vector.
Definition: Basis.h:43
CUDA_DEV void combine(double *vec, double *res)
Combine the basis with given weights.
Definition: gpuBasis.h:53
CUDA_HOSTDEV const Vec3 & x0() const
Return first basis vector.
Definition: Basis.h:40
CUDA_HOSTDEV gpuBasis(double *x0, double *x1, double *x2)
Constructor with basis vectors.
Definition: gpuBasis.h:28
CUDA_HOST gpuBasis(const isce3::core::Basis &basis)
Constructor from CPU Basis.
Definition: gpuBasis.h:37
CUDA_HOSTDEV gpuBasis()
Default constructor.
Definition: gpuBasis.h:19
Simple class to store three-dimensional basis vectors.
Definition: gpuBasis.h:15
Simple class to store three-dimensional basis vectors.
Definition: Basis.h:15
CUDA_HOSTDEV const Vec3 & x2() const
Return third basis vector.
Definition: Basis.h:46

Generated for ISCE3.0 by doxygen 1.8.5.