aboutsummaryrefslogtreecommitdiff
path: root/src/stream_manager.cc
diff options
context:
space:
mode:
authorTim Rogers <[email protected]>2018-11-16 13:24:28 -0500
committerGitHub <[email protected]>2018-11-16 13:24:28 -0500
commit52df8562368a64a578ed1278680621a36ba98a64 (patch)
tree3949a1f5600e5e42f7c3365909fb1c6a39ca7187 /src/stream_manager.cc
parent0265d747b06c18d0a1ee00fb1641032201425c97 (diff)
parentf9a626f93d891b553c11bb86172b41ccc1deb569 (diff)
Merge pull request #81 from deval281shah/dev
Merging changes for cuDNN, Pytorch and checkpoint support
Diffstat (limited to 'src/stream_manager.cc')
-rw-r--r--src/stream_manager.cc22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/stream_manager.cc b/src/stream_manager.cc
index 3b6cbd5..6cd62a2 100644
--- a/src/stream_manager.cc
+++ b/src/stream_manager.cc
@@ -188,13 +188,21 @@ bool stream_operation::do_operation( gpgpu_sim *gpu )
}
break;
case stream_event: {
- if(g_debug_execution >= 3)
- printf("event update\n");
+ printf("event update\n");
time_t wallclock = time((time_t *)NULL);
m_event->update( gpu_tot_sim_cycle, wallclock );
m_stream->record_next_done();
}
break;
+ case stream_wait_event: {
+ //only allows next op to go if event is done
+ //otherwise stays in the stream queue
+ printf("stream wait event processing...\n");
+ if(m_event->done())
+ printf("stream wait event done\n");
+ m_stream->record_next_done();
+ }
+ break;
default:
abort();
}
@@ -369,6 +377,8 @@ void stream_manager::destroy_stream( CUstream_st *stream )
bool stream_manager::concurrent_streams_empty()
{
bool result = true;
+ if (m_streams.empty())
+ return true;
// called by gpu simulation thread
std::list<struct CUstream_st *>::iterator s;
for( s=m_streams.begin(); s!=m_streams.end();++s ) {
@@ -376,6 +386,7 @@ bool stream_manager::concurrent_streams_empty()
if( !stream->empty() ) {
//stream->print(stdout);
result = false;
+ break;
}
}
return result;
@@ -467,3 +478,10 @@ void stream_manager::push( stream_operation op )
}
}
+void stream_manager::pushCudaStreamWaitEventToAllStreams( CUevent_st *e, unsigned int flags ){
+ std::list<CUstream_st *>::iterator s;
+ for( s=m_streams.begin(); s != m_streams.end(); s++ ) {
+ stream_operation op(*s,e,flags);
+ push(op);
+ }
+}