int luaopen_libcutorch(lua_State *L) { lua_newtable(L); luaL_register(L, NULL, cutorch_stuff__); THCudaInit(); THCRandom_seed(); cutorch_CudaStorage_init(L); cutorch_CudaTensor_init(L); cutorch_CudaTensorMath_init(L); return 1; }
static int cutorch_seed(lua_State *L) { unsigned long seed = THCRandom_seed(cutorch_getstate(L)); lua_pushnumber(L, seed); return 1; }