COMPASS  5.0.0
End-to-end AO simulation tool using GPU acceleration
sutra_telemetry.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_TELEMETRY_H_
43 #define _SUTRA_TELEMETRY_H_
44 
45 #include <carma.h>
46 #include <carma_host_obj.h>
47 #include <carma_obj.h>
48 #include <carma_streams.h>
49 #include <map>
50 
51 typedef std::pair<std::string, int> type_telemetry_pair;
52 
54  protected:
56  std::map<type_telemetry_pair, CarmaHostObj<float> *> objs;
57 
58  public:
61  unsigned int nb_streams);
62  SutraTelemetry(std::string type_obj, int num_obj,
63  CarmaHostObj<float> *host_obj, unsigned int nb_streams);
64  // SutraTelemetry(const SutraTelemetry& src_sutra_telemetry);
66 
67  // const CarmaHostObj<float>& operator[](int idx) const {return
68  // get_sutra_host_obj(idx);} ;
69 
71  int add_stream();
72  int add_stream(int nb);
73  int del_stream();
74  int del_stream(int nb);
76  cudaStream_t get_cuda_stream(int stream);
77 
78  int get_nbObjs();
80  int add_obj(std::string type_obj, int num_obj,
81  CarmaHostObj<float> *host_obj);
83  int del_obj(std::string type_obj, int num_obj);
84  int del_all_objs();
86  CarmaHostObj<float> *get_CarmaHostObj(std::string type_obj, int num_obj);
87  // CarmaHostObj<float>* operator[](int idx) {return
88  // get_CarmaHostObj(idx);} ;
89  int cpy_obj(std::string type_obj, int num_obj, CarmaObj<float> *d_obj,
90  cudaMemcpyKind flag);
91  int wait_obj(std::string type_obj, int num_obj);
92 
93  int wait_stream(int stream);
95 
97  int fill_from(std::string type_obj, int num_obj, float *data);
98  int fill_into(std::string type_obj, int num_obj, float *data);
99 };
100 
101 #endif // _SUTRA_TELEMETRY_H_
SutraTelemetry::get_nb_streams
int get_nb_streams()
SutraTelemetry::SutraTelemetry
SutraTelemetry(std::string type_obj, int num_obj, CarmaHostObj< float > *host_obj, unsigned int nb_streams)
type_telemetry_pair
std::pair< std::string, int > type_telemetry_pair
Definition: sutra_telemetry.h:51
SutraTelemetry::wait_obj
int wait_obj(std::string type_obj, int num_obj)
SutraTelemetry::SutraTelemetry
SutraTelemetry()
SutraTelemetry::del_stream
int del_stream()
SutraTelemetry::add_obj
int add_obj(std::string type_obj, int num_obj, CarmaHostObj< float > *host_obj)
SutraTelemetry::add_stream
int add_stream()
SutraTelemetry::del_all_streams
int del_all_streams()
SutraTelemetry::get_CarmaHostObj
CarmaHostObj< float > * get_CarmaHostObj(std::string type_obj, int num_obj)
carma_streams.h
SutraTelemetry::~SutraTelemetry
~SutraTelemetry()
SutraTelemetry::del_all_objs
int del_all_objs()
SutraTelemetry::add_obj
int add_obj(type_telemetry_pair obj, CarmaHostObj< float > *host_obj)
SutraTelemetry::get_CarmaHostObj
CarmaHostObj< float > * get_CarmaHostObj(type_telemetry_pair obj)
SutraTelemetry::cpy_obj
int cpy_obj(std::string type_obj, int num_obj, CarmaObj< float > *d_obj, cudaMemcpyKind flag)
CarmaStreams
this class provides the stream features to CarmaObj
Definition: carma_streams.h:49
SutraTelemetry::add_stream
int add_stream(int nb)
CarmaObj< float >
SutraTelemetry::wait_stream
int wait_stream(int stream)
carma_obj.h
SutraTelemetry::del_obj
int del_obj(type_telemetry_pair obj)
SutraTelemetry::SutraTelemetry
SutraTelemetry(type_telemetry_pair obj, CarmaHostObj< float > *host_obj, unsigned int nb_streams)
SutraTelemetry::fill_into
int fill_into(std::string type_obj, int num_obj, float *data)
SutraTelemetry::get_cuda_stream
cudaStream_t get_cuda_stream(int stream)
SutraTelemetry::wait_all_streams
int wait_all_streams()
SutraTelemetry::get_nbObjs
int get_nbObjs()
CarmaHostObj< float >
SutraTelemetry::fill_from
int fill_from(std::string type_obj, int num_obj, float *data)
SutraTelemetry
this class provides the telemetry features to COMPASS
Definition: sutra_telemetry.h:53
SutraTelemetry::del_stream
int del_stream(int nb)
SutraTelemetry::streams
CarmaStreams * streams
Definition: sutra_telemetry.h:55
SutraTelemetry::del_obj
int del_obj(std::string type_obj, int num_obj)
carma_host_obj.h
SutraTelemetry::objs
std::map< type_telemetry_pair, CarmaHostObj< float > * > objs
Definition: sutra_telemetry.h:56