summaryrefslogtreecommitdiff
path: root/libcuda/cuda_runtime_api.cc
diff options
context:
space:
mode:
authorJonathan <[email protected]>2018-05-22 17:27:28 -0700
committerJonathan <[email protected]>2018-05-22 17:27:28 -0700
commit1d37aee592b621c3113dc878403dfd1ccf547746 (patch)
tree707cdec9ac8cb1a7fad2d4fd5f66f5a7eba576e7 /libcuda/cuda_runtime_api.cc
parent91db4fc3b6a3ef4c4a330736896e498694fc3455 (diff)
cudaStreamWaitEvent tentative implementation
Diffstat (limited to 'libcuda/cuda_runtime_api.cc')
-rw-r--r--libcuda/cuda_runtime_api.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/libcuda/cuda_runtime_api.cc b/libcuda/cuda_runtime_api.cc
index fa5a523..f597a15 100644
--- a/libcuda/cuda_runtime_api.cc
+++ b/libcuda/cuda_runtime_api.cc
@@ -1168,6 +1168,26 @@ __host__ cudaError_t CUDARTAPI cudaStreamQuery(cudaStream_t stream)
#endif
}
+__host__ cudaError_t CUDARTAPI cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags)
+{
+
+#if (CUDART_VERSION >= 3000)
+ if( stream == NULL )
+ return g_last_cudaError = cudaErrorInvalidResourceHandle;
+ return g_last_cudaError = stream->empty()?cudaSuccess:cudaErrorNotReady;
+#else
+ printf("GPGPU-Sim API: cudaStreamWaitEvent ** waiting for event\n");
+ fflush(stdout);
+ CUevent_st *e = (CUevent_st*) event;
+ while( !e->done() )
+ ;
+ printf("GPGPU-Sim API: cudaStreamWaitEvent ** event detected\n");
+ fflush(stdout);
+ printf("GPGPU-Sim PTX: WARNING: Asynchronous kernel execution not supported (%s)\n", __my_func__);
+ return g_last_cudaError = cudaSuccess; // it is always success because all cuda calls are synchronous
+#endif
+}
+
/*******************************************************************************
* *
* *