aboutsummaryrefslogtreecommitdiff
path: root/matrix/init.c
diff options
context:
space:
mode:
authorcloudygoose <[email protected]>2015-06-08 12:50:02 +0800
committercloudygoose <[email protected]>2015-06-08 12:50:02 +0800
commit155b0c0803f5f7cd3f8780273f6b0bdfbaed5970 (patch)
tree967c6326b83cda2b92eee5f597dde0e74b071dbb /matrix/init.c
parent31330d6c095b2b11b34f524169f56dc8d18355c3 (diff)
parent0f30b1a4b5e583cb1df7dbb349c1af4378e41369 (diff)
...
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'matrix/init.c')
-rw-r--r--matrix/init.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/matrix/init.c b/matrix/init.c
index 7b7f478..c29d7e9 100644
--- a/matrix/init.c
+++ b/matrix/init.c
@@ -5,21 +5,14 @@ const char *nerv_matrix_tname = "nerv.Matrix";
const char *nerv_matrix_cuda_tname = "nerv.CuMatrix";
const char *nerv_matrix_host_tname = "nerv.MMatrix";
-void nerv_matrix_host_float_init(lua_State *L);
-void nerv_matrix_cuda_float_init(lua_State *L);
-void nerv_matrix_host_double_init(lua_State *L);
-void nerv_matrix_cuda_double_init(lua_State *L);
-void nerv_matrix_host_int_init(lua_State *L);
-int print_profile(lua_State *L);
-int clear_profile(lua_State *L);
+void nerv_cumatrix_init(lua_State *L);
+void nerv_mmatrix_init(lua_State *L);
static const luaL_Reg matrix_methods[] = {
{"__tostring__", nerv_error_method_not_implemented },
{"__add__", nerv_error_method_not_implemented },
{"__sub__", nerv_error_method_not_implemented },
{"__mul__", nerv_error_method_not_implemented },
- {"print_profile", print_profile},
- {"clear_profile", clear_profile},
{NULL, NULL}
};
@@ -32,13 +25,11 @@ void nerv_matrix_init(lua_State *L) {
/* CuMatrix inherits from Matrix */
luaT_newmetatable(L, nerv_matrix_cuda_tname, nerv_matrix_tname,
NULL, NULL, NULL);
- nerv_matrix_cuda_float_init(L);
- nerv_matrix_cuda_double_init(L);
-
+ nerv_cumatrix_init(L);
+ lua_pop(L, 1);
/* MMatrix inherits from Matrix */
luaT_newmetatable(L, nerv_matrix_host_tname, nerv_matrix_tname,
NULL, NULL, NULL);
- nerv_matrix_host_float_init(L);
- nerv_matrix_host_double_init(L);
- nerv_matrix_host_int_init(L);
+ nerv_mmatrix_init(L);
+ lua_pop(L, 1);
}