summaryrefslogtreecommitdiff
path: root/libcuda
diff options
context:
space:
mode:
authorJonathan <[email protected]>2018-05-25 17:41:40 -0700
committerJonathan <[email protected]>2018-05-25 17:41:40 -0700
commit2778712a298a58be4a5abaa28f45805eb3c027c6 (patch)
tree16ac0104d18c23dbaa7672b29daaa57f97488b47 /libcuda
parentfbf8e1180008db2fec31ba1f1e916ea4cb4af97a (diff)
seg fault fix
Diffstat (limited to 'libcuda')
-rw-r--r--libcuda/cuda_runtime_api.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/libcuda/cuda_runtime_api.cc b/libcuda/cuda_runtime_api.cc
index de6d5a5..f130a37 100644
--- a/libcuda/cuda_runtime_api.cc
+++ b/libcuda/cuda_runtime_api.cc
@@ -1157,12 +1157,6 @@ __host__ cudaError_t CUDARTAPI cudaStreamQuery(cudaStream_t stream)
#endif
}
-__host__ cudaError_t CUDARTAPI cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags)
-{
- stream->push(stream_operation(stream, event, flags));
- return g_last_cudaError = cudaSuccess;
-}
-
/*******************************************************************************
* *
* *
@@ -1205,6 +1199,16 @@ __host__ cudaError_t CUDARTAPI cudaEventRecord(cudaEvent_t event, cudaStream_t s
return g_last_cudaError = cudaSuccess;
}
+__host__ cudaError_t CUDARTAPI cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags)
+{
+ CUevent_st *e = get_event(event);
+ if( !e ) return g_last_cudaError = cudaErrorUnknown;
+ struct CUstream_st *s = (struct CUstream_st *)stream;
+ stream_operation op(s,e,flags);
+ g_stream_manager->push(op);
+ return g_last_cudaError = cudaSuccess;
+}
+
__host__ cudaError_t CUDARTAPI cudaEventQuery(cudaEvent_t event)
{
CUevent_st *e = get_event(event);