aboutsummaryrefslogtreecommitdiff
path: root/matrix/cuda_helper.h
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2015-06-05 12:09:04 +0800
committerDeterminant <[email protected]>2015-06-05 12:09:04 +0800
commitb6b85c02db6a44c17957d7b59cf68494da822a0b (patch)
treee4fa342e317daa58cb68c8c4b1b5a0079d535bcc /matrix/cuda_helper.h
parent008d32ccd08581b4ff56b33b69f19d849b49c6e4 (diff)
use -FLT_MAX as init value in rowmax; add sync code
Diffstat (limited to 'matrix/cuda_helper.h')
-rw-r--r--matrix/cuda_helper.h3
1 files changed, 2 insertions, 1 deletions
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) \