From b6b85c02db6a44c17957d7b59cf68494da822a0b Mon Sep 17 00:00:00 2001 From: Determinant Date: Fri, 5 Jun 2015 12:09:04 +0800 Subject: use -FLT_MAX as init value in rowmax; add sync code --- matrix/cuda_helper.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'matrix/cuda_helper.h') diff --git a/matrix/cuda_helper.h b/matrix/cuda_helper.h index 5e5f2ad..88619fd 100644 --- a/matrix/cuda_helper.h +++ b/matrix/cuda_helper.h @@ -4,12 +4,13 @@ #include "cuda_runtime.h" #include "driver_types.h" #include "cublas_v2.h" -#define CUBLAS_SAFE_CALL(call) \ +#define CUBLAS_SAFE_SYNC_CALL(call) \ do { \ cublasStatus_t err = (call); \ if (err != CUBLAS_STATUS_SUCCESS) \ nerv_error(L, "cumatrix cublas error: %s at %s:%d", \ cublasGetErrorString(err), __FILE__, __LINE__); \ + cudaDeviceSynchronize(); \ } while (0) #define CUDA_SAFE_CALL(call) \ -- cgit v1.2.3