summaryrefslogtreecommitdiff
path: root/libcuda/cuda_runtime_api.cc
diff options
context:
space:
mode:
authorJonathan <[email protected]>2018-05-29 10:39:17 -0700
committerJonathan <[email protected]>2018-05-29 10:39:17 -0700
commit80707e17c486f5628b280c3da7e84ba73f317157 (patch)
treebb19c5447bb4467570e9284d5edd753b53457896 /libcuda/cuda_runtime_api.cc
parent4b19748d4b3f808d8a45039326673da8caf73186 (diff)
added must recordevent before waitevent call message
Diffstat (limited to 'libcuda/cuda_runtime_api.cc')
-rw-r--r--libcuda/cuda_runtime_api.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/libcuda/cuda_runtime_api.cc b/libcuda/cuda_runtime_api.cc
index 33da17f..b6fc6c8 100644
--- a/libcuda/cuda_runtime_api.cc
+++ b/libcuda/cuda_runtime_api.cc
@@ -1202,9 +1202,12 @@ __host__ cudaError_t CUDARTAPI cudaEventRecord(cudaEvent_t event, cudaStream_t s
__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;
+ if( !e ){
+ printf("GPGPU-Sim API: ERROR: Must call cudaEventRecord on event before calling cudaStreamWaitEvent.\n");
+ return g_last_cudaError = cudaErrorInvalidValue;
+ }
if (!stream){
- printf("GPGPU-Sim API: Warning: cudaStreamWaitEvent on NULL stream not currently supported.\n");
+ printf("GPGPU-Sim API: ERROR: cudaStreamWaitEvent on NULL stream not currently supported.\n");
return g_last_cudaError = cudaErrorInvalidValue;
}
struct CUstream_st *s = (struct CUstream_st *)stream;