aboutsummaryrefslogtreecommitdiff
path: root/nerv/matrix/generic/cumatrix.c
diff options
context:
space:
mode:
authorDeterminant <ted.sybil@gmail.com>2015-11-23 14:12:33 +0800
committerDeterminant <ted.sybil@gmail.com>2015-11-23 14:12:33 +0800
commit52dc38775347efb7bf56210b4c3f5935d19317cd (patch)
tree9b8ea06b5ba69f7014a13ddf48239581c0e14f19 /nerv/matrix/generic/cumatrix.c
parentd1eb2a18c0adfec52b438eda8602ab2601d12391 (diff)
add cflag __NERV_FUTURE_CUDA_7
Diffstat (limited to 'nerv/matrix/generic/cumatrix.c')
-rw-r--r--nerv/matrix/generic/cumatrix.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/nerv/matrix/generic/cumatrix.c b/nerv/matrix/generic/cumatrix.c
index f675149..e1519b0 100644
--- a/nerv/matrix/generic/cumatrix.c
+++ b/nerv/matrix/generic/cumatrix.c
@@ -291,8 +291,10 @@ static int nerv_matrix_(lua_scale_rows_by_row)(lua_State *L) {
return 0;
}
+#ifdef __NERV_FUTURE_CUDA_7
static int nerv_matrix_(lua_update_select_rows)(lua_State *L) {
- //Update c's select rows, i.e. c[idx[i]] = c[idx[i]] * (1 - beta * alpha) + a[i] * alpha
+ /* update c's select rows,
+ * i.e. c[idx[i]] = c[idx[i]] * (1 - beta * alpha) + a[i] * alpha */
Status status;
Matrix *c = luaT_checkudata(L, 1, nerv_matrix_(tname));
const Matrix *a = luaT_checkudata(L, 2, nerv_matrix_(tname));
@@ -303,6 +305,7 @@ static int nerv_matrix_(lua_update_select_rows)(lua_State *L) {
NERV_LUA_CHECK_STATUS(L, status);
return 0;
}
+#endif
static const luaL_Reg nerv_matrix_(extra_methods)[] = {
{"colsum", nerv_matrix_(lua_colsum)},
@@ -323,7 +326,6 @@ static const luaL_Reg nerv_matrix_(extra_methods)[] = {
{"add_row", nerv_matrix_(lua_add_row)},
{"clip", nerv_matrix_(lua_clip)},
{"fill", nerv_matrix_(lua_fill)},
- {"update_select_rows", nerv_matrix_(lua_update_select_rows)},
{"sigmoid", nerv_matrix_(lua_sigmoid)},
{"sigmoid_grad", nerv_matrix_(lua_sigmoid_grad)},
{"softmax", nerv_matrix_(lua_softmax)},
@@ -335,6 +337,9 @@ static const luaL_Reg nerv_matrix_(extra_methods)[] = {
{"rearrange_frm", nerv_matrix_(lua_rearrange_frm)},
{"scale_rows_by_row", nerv_matrix_(lua_scale_rows_by_row)},
{"scale_rows_by_col", nerv_matrix_(lua_scale_rows_by_col)},
+#ifdef __NERV_FUTURE_CUDA_7
+ {"update_select_rows", nerv_matrix_(lua_update_select_rows)},
+#endif
{NULL, NULL}
};