summaryrefslogtreecommitdiff
path: root/src/stream_manager.h
diff options
context:
space:
mode:
authortgrogers <[email protected]>2020-04-07 13:34:21 -0400
committertgrogers <[email protected]>2020-04-07 13:34:21 -0400
commitbeed0538ca94585475374690291a03fafba1e1f2 (patch)
tree556879d5dc6c2498ca329aa4a19693f5ed4900e3 /src/stream_manager.h
parent75afd00f516bf8298cdce1f8653e98c677c03b22 (diff)
parente7fbfaa347c0acf8a6702c1e684a8e2ad8d3f733 (diff)
Merge remote-tracking branch 'localpub/dev' into dev
Diffstat (limited to 'src/stream_manager.h')
-rw-r--r--src/stream_manager.h73
1 files changed, 39 insertions, 34 deletions
diff --git a/src/stream_manager.h b/src/stream_manager.h
index d543e68..afcbb0e 100644
--- a/src/stream_manager.h
+++ b/src/stream_manager.h
@@ -44,6 +44,43 @@
// unsigned m_pending_streams;
//};
+struct CUevent_st {
+ public:
+ CUevent_st(bool blocking) {
+ m_uid = ++m_next_event_uid;
+ m_blocking = blocking;
+ m_updates = 0;
+ m_wallclock = 0;
+ m_gpu_tot_sim_cycle = 0;
+ m_issued = 0;
+ m_done = false;
+ }
+ void update(double cycle, time_t clk) {
+ m_updates++;
+ m_wallclock = clk;
+ m_gpu_tot_sim_cycle = cycle;
+ m_done = true;
+ }
+ // void set_done() { assert(!m_done); m_done=true; }
+ int get_uid() const { return m_uid; }
+ unsigned num_updates() const { return m_updates; }
+ bool done() const { return m_updates == m_issued; }
+ time_t clock() const { return m_wallclock; }
+ void issue() { m_issued++; }
+ unsigned int num_issued() const { return m_issued; }
+
+ private:
+ int m_uid;
+ bool m_blocking;
+ bool m_done;
+ int m_updates;
+ unsigned int m_issued;
+ time_t m_wallclock;
+ double m_gpu_tot_sim_cycle;
+
+ static int m_next_event_uid;
+};
+
enum stream_operation_type {
stream_no_op,
stream_memcpy_host_to_device,
@@ -106,6 +143,7 @@ class stream_operation {
m_kernel = NULL;
m_type = stream_wait_event;
m_event = e;
+ m_cnt = m_event->num_issued();
m_stream = stream;
m_done = false;
}
@@ -184,40 +222,6 @@ class stream_operation {
kernel_info_t *m_kernel;
struct CUevent_st *m_event;
};
-
-struct CUevent_st {
- public:
- CUevent_st(bool blocking) {
- m_uid = ++m_next_event_uid;
- m_blocking = blocking;
- m_updates = 0;
- m_wallclock = 0;
- m_gpu_tot_sim_cycle = 0;
- m_done = false;
- }
- void update(double cycle, time_t clk) {
- m_updates++;
- m_wallclock = clk;
- m_gpu_tot_sim_cycle = cycle;
- m_done = true;
- }
- // void set_done() { assert(!m_done); m_done=true; }
- int get_uid() const { return m_uid; }
- unsigned num_updates() const { return m_updates; }
- bool done() const { return m_done; }
- time_t clock() const { return m_wallclock; }
-
- private:
- int m_uid;
- bool m_blocking;
- bool m_done;
- int m_updates;
- time_t m_wallclock;
- double m_gpu_tot_sim_cycle;
-
- static int m_next_event_uid;
-};
-
struct CUstream_st {
public:
CUstream_st();
@@ -272,6 +276,7 @@ class stream_manager {
CUstream_st m_stream_zero;
bool m_service_stream_zero;
pthread_mutex_t m_lock;
+ std::list<struct CUstream_st *>::iterator m_last_stream;
};
#endif