COMPASS  5.4.4
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-2023 COMPASS Team <https://github.com/ANR-COMPASS>
5 // All rights reserved.
6 
7 // -----------------------------------------------------------------------------
8 
16 
17 #ifndef _CARMA_STREAM_H_
18 #define _CARMA_STREAM_H_
19 
20 #include <carma_utils.h>
21 #include <driver_types.h>
22 #include <vector>
23 
24 class CarmaStreams {
25  protected:
26  std::vector<cudaStream_t> streams;
27  std::vector<cudaEvent_t> events;
29 
30  public:
32  CarmaStreams(unsigned int nb_streams);
33  // carma_stream(const carma_stream& src_carma_stream);
35 
36  cudaStream_t get_stream(int stream);
37  cudaEvent_t get_event(int stream);
38  cudaStream_t operator[](int idx) { return get_stream(idx); }
39 
41  int add_stream();
42  int add_stream(int nb);
43  int del_stream();
44  int del_stream(int nb);
46  int wait_event(int stream);
47  int wait_stream(int stream);
49 };
50 
51 #endif // _CARMA_STREAM_H_
this file provides tools to CarmaObj
this class provides the stream features to CarmaObj
Definition: carma_streams.h:24
int wait_stream(int stream)
int add_stream(int nb)
cudaStream_t operator[](int idx)
Definition: carma_streams.h:38
int wait_event(int stream)
cudaEvent_t get_event(int stream)
int get_nb_streams()
int wait_all_streams()
int del_all_streams()
int del_stream(int nb)
std::vector< cudaEvent_t > events
Definition: carma_streams.h:27
int add_stream()
CarmaStreams(unsigned int nb_streams)
int del_stream()
std::vector< cudaStream_t > streams
Definition: carma_streams.h:26
cudaStream_t get_stream(int stream)