From 80707e17c486f5628b280c3da7e84ba73f317157 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 29 May 2018 10:39:17 -0700 Subject: added must recordevent before waitevent call message --- libcuda/cuda_runtime_api.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libcuda/cuda_runtime_api.cc') 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; -- cgit v1.3