COMPASS  5.0.0
End-to-end AO simulation tool using GPU acceleration
sutra_kl.h
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 // This file is part of COMPASS <https://anr-compass.github.io/compass/>
3 //
4 // Copyright (C) 2011-2019 COMPASS Team <https://github.com/ANR-COMPASS>
5 // All rights reserved.
6 // Distributed under GNU - LGPL
7 //
8 // COMPASS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser
9 // General Public License as published by the Free Software Foundation, either version 3 of the License,
10 // or any later version.
11 //
12 // COMPASS: End-to-end AO simulation tool using GPU acceleration
13 // The COMPASS platform was designed to meet the need of high-performance for the simulation of AO systems.
14 //
15 // The final product includes a software package for simulating all the critical subcomponents of AO,
16 // particularly in the context of the ELT and a real-time core based on several control approaches,
17 // with performances consistent with its integration into an instrument. Taking advantage of the specific
18 // hardware architecture of the GPU, the COMPASS tool allows to achieve adequate execution speeds to
19 // conduct large simulation campaigns called to the ELT.
20 //
21 // The COMPASS platform can be used to carry a wide variety of simulations to both testspecific components
22 // of AO of the E-ELT (such as wavefront analysis device with a pyramid or elongated Laser star), and
23 // various systems configurations such as multi-conjugate AO.
24 //
25 // COMPASS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
26 // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
27 // See the GNU Lesser General Public License for more details.
28 //
29 // You should have received a copy of the GNU Lesser General Public License along with COMPASS.
30 // If not, see <https://www.gnu.org/licenses/lgpl-3.0.txt>.
31 // -----------------------------------------------------------------------------
32 
41 
42 #ifndef _SUTRA_KL_H_
43 #define _SUTRA_KL_H_
44 
45 #include <carma.h>
46 #include <carma_host_obj.h>
47 #include <carma_obj.h>
48 
49 class SutraKL {
50  public:
51  int device; // # device
52  long dim; // dim of final array
53  long nr; // # radial points
54  long np; // # of elements
55  long nkl; // # of functions in the basis
56  long nord; // # number of radial orders
57 
58  CarmaObj<float> *d_rabas; // the radial array of the basis
59  CarmaObj<float> *d_azbas; // the azimuthal array of the basis
60  CarmaHostObj<int> *h_ord; // the radial orders of the basis
61  CarmaObj<int> *d_ord; // the radial orders of the basis
64 
65  // Florian features
70 
71  CarmaContext *current_context; // the context in which it has been created
72  public:
73  SutraKL(CarmaContext *context, long dim, long nr, long np, long nkl,
74  long nord, int device);
76 
77  int do_compute(float alpha, float ampli, float *odata, int nkl, int size,
78  int xoff, int yoff);
79  int do_compute(float ampli, float *odata, int nkl, int size, int xoff,
80  int yoff);
81  int do_compute(float *odata, int nkl, int size, int xoff, int yoff);
82  int do_combi(float *com, float *odata, int size, int xoff, int yoff);
83 
84  // Florian features
85  int get_flokl();
86 };
87 int getkl(float alpha, float ampli, float *d_odata, float *rabas, float *azbas,
88  float *cr, float *cp, int nr, int np, int nx, int Nx, int xoff,
89  int yoff);
90 int getkl(float ampli, float *d_odata, float *rabas, float *azbas, float *cr,
91  float *cp, int nr, int np, int nx, int Nx, int xoff, int yoff);
92 int getkl(float *d_odata, float *rabas, float *azbas, float *cr, float *cp,
93  int nr, int np, int nx, int Nx, int xoff, int yoff);
94 int combikl(float *com, int nkl, float *d_odata, float *rabas, int *h_ord,
95  float *azbas, float *cr, float *cp, int nr, int np, int nx, int Nx,
96  int xoff, int yoff);
97 int cget_flokl(long nkl, long dim, float *covmat, float *filter, float *bas);
98 // template <class T> void comp_kl(int threads, int blocks, T *d_idata, T
99 // *d_odata, int N);
100 
101 #endif // _SUTRA_KL_H_
SutraKL::SutraKL
SutraKL(CarmaContext *context, long dim, long nr, long np, long nkl, long nord, int device)
SutraKL::current_context
CarmaContext * current_context
Definition: sutra_kl.h:71
SutraKL::d_cr
CarmaObj< float > * d_cr
Definition: sutra_kl.h:62
SutraKL
this class provides the kl features to COMPASS
Definition: sutra_kl.h:49
SutraKL::h_ord
CarmaHostObj< int > * h_ord
Definition: sutra_kl.h:60
SutraKL::d_bas
CarmaObj< float > * d_bas
Definition: sutra_kl.h:68
SutraKL::~SutraKL
~SutraKL()
SutraKL::nr
long nr
Definition: sutra_kl.h:53
SutraKL::get_flokl
int get_flokl()
SutraKL::dim
long dim
Definition: sutra_kl.h:52
SutraKL::do_combi
int do_combi(float *com, float *odata, int size, int xoff, int yoff)
SutraKL::do_compute
int do_compute(float *odata, int nkl, int size, int xoff, int yoff)
cget_flokl
int cget_flokl(long nkl, long dim, float *covmat, float *filter, float *bas)
SutraKL::device
int device
Definition: sutra_kl.h:51
CarmaObj< float >
carma_obj.h
CarmaContext
this class provides the context in which CarmaObj are created
Definition: carma_context.h:104
SutraKL::d_cp
CarmaObj< float > * d_cp
Definition: sutra_kl.h:63
SutraKL::np
long np
Definition: sutra_kl.h:54
combikl
int combikl(float *com, int nkl, float *d_odata, float *rabas, int *h_ord, float *azbas, float *cr, float *cp, int nr, int np, int nx, int Nx, int xoff, int yoff)
CarmaHostObj< int >
SutraKL::nkl
long nkl
Definition: sutra_kl.h:55
SutraKL::d_evals
CarmaObj< float > * d_evals
Definition: sutra_kl.h:69
getkl
int getkl(float alpha, float ampli, float *d_odata, float *rabas, float *azbas, float *cr, float *cp, int nr, int np, int nx, int Nx, int xoff, int yoff)
SutraKL::do_compute
int do_compute(float alpha, float ampli, float *odata, int nkl, int size, int xoff, int yoff)
SutraKL::do_compute
int do_compute(float ampli, float *odata, int nkl, int size, int xoff, int yoff)
SutraKL::d_filter
CarmaObj< float > * d_filter
Definition: sutra_kl.h:67
SutraKL::d_ord
CarmaObj< int > * d_ord
Definition: sutra_kl.h:61
SutraKL::d_rabas
CarmaObj< float > * d_rabas
Definition: sutra_kl.h:58
SutraKL::d_covmat
CarmaObj< float > * d_covmat
Definition: sutra_kl.h:66
SutraKL::d_azbas
CarmaObj< float > * d_azbas
Definition: sutra_kl.h:59
carma_host_obj.h
SutraKL::nord
long nord
Definition: sutra_kl.h:56