aboutsummaryrefslogtreecommitdiff
path: root/matrix/generic
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/generic
parent31330d6c095b2b11b34f524169f56dc8d18355c3 (diff)
parent0f30b1a4b5e583cb1df7dbb349c1af4378e41369 (diff)
...
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'matrix/generic')
-rw-r--r--matrix/generic/cumatrix.c4
-rw-r--r--matrix/generic/matrix.c1
-rw-r--r--matrix/generic/mmatrix.c6
3 files changed, 1 insertions, 10 deletions
diff --git a/matrix/generic/cumatrix.c b/matrix/generic/cumatrix.c
index 956e1e6..a8e18e0 100644
--- a/matrix/generic/cumatrix.c
+++ b/matrix/generic/cumatrix.c
@@ -11,11 +11,9 @@
#define MATRIX_BASE_TNAME nerv_matrix_cuda_tname
#define NERV_GENERIC_MATRIX
#define NERV_GENERIC_CUKERNEL
-#define PROFILE_HASHMAP_SIZE 123457
#include "../../common.h"
#include "../cukernel.h"
#include "../cuda_helper.h"
-#include <string.h>
Matrix *nerv_matrix_(new_)(lua_State *L, long nrow, long ncol);
void nerv_matrix_(data_free)(lua_State *L, Matrix *self);
@@ -442,8 +440,6 @@ static const luaL_Reg nerv_matrix_(extra_methods)[] = {
static void cuda_matrix_(init)(lua_State *L) {
luaN_append_methods(L, nerv_matrix_(extra_methods));
- cublasCreate(&cublas_handle);
- profile = hashmap_create(PROFILE_HASHMAP_SIZE, bkdr_hash, strcmp);
}
static void cuda_matrix_(free)(lua_State *L, MATRIX_ELEM *ptr) {
diff --git a/matrix/generic/matrix.c b/matrix/generic/matrix.c
index d6b0aea..e17fb42 100644
--- a/matrix/generic/matrix.c
+++ b/matrix/generic/matrix.c
@@ -6,6 +6,7 @@ extern const char *nerv_matrix_(tname);
extern const char *MATRIX_BASE_TNAME;
void nerv_matrix_(data_free)(lua_State *L, Matrix *self) {
+ (void)L;
assert(*self->data_ref > 0);
if (--(*self->data_ref) == 0)
{
diff --git a/matrix/generic/mmatrix.c b/matrix/generic/mmatrix.c
index 2045d65..b0f0791 100644
--- a/matrix/generic/mmatrix.c
+++ b/matrix/generic/mmatrix.c
@@ -87,15 +87,9 @@ int nerv_matrix_(save)(lua_State *L) {
MATRIX_ELEM *row = MATRIX_ROW_PTR(self, i);
for (j = 0; j < ncol; j++)
if (fprintf(fp, MATRIX_ELEM_WRITE_FMT " ", row[j]) < 0)
- {
- free(self);
return 0;
- }
if (fprintf(fp, "\n") < 0)
- {
- free(self);
return 0;
- }
}
return 0;
}