aboutsummaryrefslogtreecommitdiff
path: root/matrix/generic/cumatrix.c
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/generic/cumatrix.c
parent008d32ccd08581b4ff56b33b69f19d849b49c6e4 (diff)
use -FLT_MAX as init value in rowmax; add sync code
Diffstat (limited to 'matrix/generic/cumatrix.c')
-rw-r--r--matrix/generic/cumatrix.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/matrix/generic/cumatrix.c b/matrix/generic/cumatrix.c
index 8e7d34f..956e1e6 100644
--- a/matrix/generic/cumatrix.c
+++ b/matrix/generic/cumatrix.c
@@ -24,7 +24,7 @@ static void nerv_matrix_(add_)(lua_State *L, const Matrix *a, const Matrix *b,
const Matrix *c,
MATRIX_ELEM alpha, MATRIX_ELEM beta) {
PROFILE_START
- CUBLAS_SAFE_CALL(
+ CUBLAS_SAFE_SYNC_CALL(
NERV_CUBLAS_(geam)(cublas_handle, CUBLAS_OP_N, CUBLAS_OP_N,
a->ncol, a->nrow,
&alpha,
@@ -74,7 +74,7 @@ static int nerv_matrix_(mul)(lua_State *L) {
/* MATRIX_ELEM alpha = 1.0f, beta = 0.0f; */
/* Because matrix in Nerv is row-major, here b comes first */
PROFILE_START
- CUBLAS_SAFE_CALL(
+ CUBLAS_SAFE_SYNC_CALL(
NERV_CUBLAS_(gemm)(cublas_handle, tb, ta,
bn, am, bm,
&alpha,
@@ -285,7 +285,7 @@ static int nerv_matrix_(trans)(lua_State *L) {
MATRIX_ELEM alpha = 1, beta = 0;
/* FIXME: possible memory leak when lua error is raised */
PROFILE_START
- CUBLAS_SAFE_CALL(
+ CUBLAS_SAFE_SYNC_CALL(
NERV_CUBLAS_(geam)(cublas_handle, CUBLAS_OP_T, CUBLAS_OP_T,
a->nrow, a->ncol,
&alpha,