COMPASS  5.0.0
End-to-end AO simulation tool using GPU acceleration
carma_streams.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 _CARMA_STREAM_H_
43 #define _CARMA_STREAM_H_
44 
45 #include <carma_utils.h>
46 #include <driver_types.h>
47 #include <vector>
48 
49 class CarmaStreams {
50  protected:
51  std::vector<cudaStream_t> streams;
52  std::vector<cudaEvent_t> events;
54 
55  public:
57  CarmaStreams(unsigned int nb_streams);
58  // carma_stream(const carma_stream& src_carma_stream);
60 
61  cudaStream_t get_stream(int stream);
62  cudaEvent_t get_event(int stream);
63  cudaStream_t operator[](int idx) { return get_stream(idx); }
64 
66  int add_stream();
67  int add_stream(int nb);
68  int del_stream();
69  int del_stream(int nb);
71  int wait_event(int stream);
72  int wait_stream(int stream);
74 };
75 
76 #endif // _CARMA_STREAM_H_
CarmaStreams::operator[]
cudaStream_t operator[](int idx)
Definition: carma_streams.h:63
CarmaStreams::add_stream
int add_stream(int nb)
CarmaStreams::CarmaStreams
CarmaStreams(unsigned int nb_streams)
carma_utils.h
this file provides tools to CarmaObj
CarmaStreams::del_all_streams
int del_all_streams()
CarmaStreams::del_stream
int del_stream()
CarmaStreams::add_stream
int add_stream()
CarmaStreams::wait_all_streams
int wait_all_streams()
CarmaStreams::events
std::vector< cudaEvent_t > events
Definition: carma_streams.h:52
CarmaStreams
this class provides the stream features to CarmaObj
Definition: carma_streams.h:49
CarmaStreams::get_nb_streams
int get_nb_streams()
CarmaStreams::CarmaStreams
CarmaStreams()
CarmaStreams::~CarmaStreams
~CarmaStreams()
CarmaStreams::del_stream
int del_stream(int nb)
CarmaStreams::get_event
cudaEvent_t get_event(int stream)
CarmaStreams::wait_event
int wait_event(int stream)
CarmaStreams::eventflags
int eventflags
Definition: carma_streams.h:53
CarmaStreams::get_stream
cudaStream_t get_stream(int stream)
CarmaStreams::wait_stream
int wait_stream(int stream)
CarmaStreams::streams
std::vector< cudaStream_t > streams
Definition: carma_streams.h:51