summaryrefslogtreecommitdiff
path: root/libcuda/cuda_runtime_api.cc
diff options
context:
space:
mode:
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 d971222..a45ed61 100644
--- a/libcuda/cuda_runtime_api.cc
+++ b/libcuda/cuda_runtime_api.cc
@@ -1157,6 +1157,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
+}
+
/*******************************************************************************
* *
* *