COMPASS  5.4.4
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-2023 COMPASS Team <https://github.com/ANR-COMPASS>
5 // All rights reserved.
6 
7 // -----------------------------------------------------------------------------
8 
16 
17 #ifndef _SUTRA_TELEMETRY_H_
18 #define _SUTRA_TELEMETRY_H_
19 
20 #include <carma.h>
21 #include <carma_host_obj.h>
22 #include <carma_obj.h>
23 #include <carma_streams.h>
24 #include <map>
25 
26 typedef std::pair<std::string, int> type_telemetry_pair;
27 
29  protected:
31  std::map<type_telemetry_pair, CarmaHostObj<float> *> objs;
32 
33  public:
36  unsigned int nb_streams);
37  SutraTelemetry(std::string type_obj, int num_obj,
38  CarmaHostObj<float> *host_obj, unsigned int nb_streams);
39  // SutraTelemetry(const SutraTelemetry& src_sutra_telemetry);
41 
42  // const CarmaHostObj<float>& operator[](int idx) const {return
43  // get_sutra_host_obj(idx);} ;
44 
46  int add_stream();
47  int add_stream(int nb);
48  int del_stream();
49  int del_stream(int nb);
51  cudaStream_t get_cuda_stream(int stream);
52 
53  int get_nbObjs();
55  int add_obj(std::string type_obj, int num_obj,
56  CarmaHostObj<float> *host_obj);
58  int del_obj(std::string type_obj, int num_obj);
59  int del_all_objs();
61  CarmaHostObj<float> *get_CarmaHostObj(std::string type_obj, int num_obj);
62  // CarmaHostObj<float>* operator[](int idx) {return
63  // get_CarmaHostObj(idx);} ;
64  int cpy_obj(std::string type_obj, int num_obj, CarmaObj<float> *d_obj,
65  cudaMemcpyKind flag);
66  int wait_obj(std::string type_obj, int num_obj);
67 
68  int wait_stream(int stream);
70 
72  int fill_from(std::string type_obj, int num_obj, float *data);
73  int fill_into(std::string type_obj, int num_obj, float *data);
74 };
75 
76 #endif // _SUTRA_TELEMETRY_H_
this class provides the stream features to CarmaObj
Definition: carma_streams.h:24
this class provides the telemetry features to COMPASS
int fill_from(std::string type_obj, int num_obj, float *data)
int del_obj(std::string type_obj, int num_obj)
int wait_obj(std::string type_obj, int num_obj)
int del_obj(type_telemetry_pair obj)
int add_obj(type_telemetry_pair obj, CarmaHostObj< float > *host_obj)
int get_nb_streams()
int fill_into(std::string type_obj, int num_obj, float *data)
cudaStream_t get_cuda_stream(int stream)
std::map< type_telemetry_pair, CarmaHostObj< float > * > objs
int del_stream(int nb)
int add_stream(int nb)
int del_all_streams()
int add_obj(std::string type_obj, int num_obj, CarmaHostObj< float > *host_obj)
CarmaHostObj< float > * get_CarmaHostObj(std::string type_obj, int num_obj)
int wait_all_streams()
SutraTelemetry(std::string type_obj, int num_obj, CarmaHostObj< float > *host_obj, unsigned int nb_streams)
SutraTelemetry(type_telemetry_pair obj, CarmaHostObj< float > *host_obj, unsigned int nb_streams)
int wait_stream(int stream)
CarmaStreams * streams
int cpy_obj(std::string type_obj, int num_obj, CarmaObj< float > *d_obj, cudaMemcpyKind flag)
CarmaHostObj< float > * get_CarmaHostObj(type_telemetry_pair obj)
std::pair< std::string, int > type_telemetry_pair