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.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/libcuda/cuda_runtime_api.cc b/libcuda/cuda_runtime_api.cc
index 77456d4..350ba0b 100644
--- a/libcuda/cuda_runtime_api.cc
+++ b/libcuda/cuda_runtime_api.cc
@@ -440,6 +440,10 @@ extern "C" {
* *
* *
*******************************************************************************/
+cudaError_t cudaPeekAtLastError(void)
+{
+ return g_last_cudaError;
+}
__host__ cudaError_t CUDARTAPI cudaMalloc(void **devPtr, size_t size)
{
@@ -1000,7 +1004,8 @@ __host__ cudaError_t CUDARTAPI cudaStreamSynchronize(cudaStream_t stream)
{
#if (CUDART_VERSION >= 3000)
if( stream == NULL )
- return g_last_cudaError = cudaErrorInvalidResourceHandle;
+ synchronize();
+ return g_last_cudaError = cudaSuccess;
stream->synchronize();
#else
printf("GPGPU-Sim PTX: WARNING: Asynchronous kernel execution not supported (%s)\n", __my_func__);