diff options
| author | WilliamMTK <[email protected]> | 2025-03-06 14:06:03 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-03-06 19:06:03 +0000 |
| commit | 6ab2ca48f7f3f97052ae31f56fa93fa7eed84f2c (patch) | |
| tree | fd00ddc4944164e7bacca5ae35fce44788792c25 /src/stream_manager.h | |
| parent | 63e254873770365f60e143be1fb60642e8303fc0 (diff) | |
sst-integration-stream: make SST integration works with streams (#103)
* sst-integration-stream: add apis to make SST integration works with stream
* Add dev container specs
Diffstat (limited to 'src/stream_manager.h')
| -rw-r--r-- | src/stream_manager.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/stream_manager.h b/src/stream_manager.h index c1b76d0..55cfb8d 100644 --- a/src/stream_manager.h +++ b/src/stream_manager.h @@ -69,6 +69,11 @@ struct CUevent_st { void issue() { m_issued++; } unsigned int num_issued() const { return m_issued; } + // SST related, stating this event is requested to synchronize + void set_request_synchronize() { m_requested_synchronize = true; } + void reset_request_synchronize() { m_requested_synchronize = false; } + bool requested_synchronize() const { return m_requested_synchronize; } + private: int m_uid; bool m_blocking; @@ -77,6 +82,9 @@ struct CUevent_st { unsigned int m_issued; time_t m_wallclock; double m_gpu_tot_sim_cycle; + + // SST related + bool m_requested_synchronize = false; static int m_next_event_uid; }; @@ -226,6 +234,7 @@ struct CUstream_st { bool empty(); bool busy(); void synchronize(); + bool synchronize_check(); void push(const stream_operation &op); void record_next_done(); stream_operation next(); @@ -233,6 +242,12 @@ struct CUstream_st { stream_operation &front() { return m_operations.front(); } void print(FILE *fp); unsigned get_uid() const { return m_uid; } + void set_request_synchronize() { m_requested_synchronize = true; } + void reset_request_synchronize() { m_requested_synchronize = false; } + bool requested_synchronize() const { return m_requested_synchronize; } + void set_stream_zero() { is_stream_zero = true; } + bool is_stream_zero_stream() { return is_stream_zero; } + void reset_stream_zero() { is_stream_zero = false; } private: unsigned m_uid; @@ -243,6 +258,11 @@ struct CUstream_st { pthread_mutex_t m_lock; // ensure only one host or gpu manipulates stream // operation at one time + + // SST related, use to record the stream is requested to synchronize + bool m_requested_synchronize = false; + // Whether this is the default stream + bool is_stream_zero = false; }; class stream_manager { @@ -263,6 +283,8 @@ class stream_manager { void stop_all_running_kernels(); unsigned size() { return m_streams.size(); }; bool is_blocking() { return m_cuda_launch_blocking; }; + CUstream_st *get_stream_zero() { return &m_stream_zero; }; + std::list<CUstream_st *>& get_concurrent_streams() { return m_streams; }; private: void print_impl(FILE *fp); |
