aboutsummaryrefslogtreecommitdiff
path: root/matrix/generic
diff options
context:
space:
mode:
Diffstat (limited to 'matrix/generic')
-rw-r--r--matrix/generic/cumatrix.c2
-rw-r--r--matrix/generic/mmatrix.c6
2 files changed, 2 insertions, 6 deletions
diff --git a/matrix/generic/cumatrix.c b/matrix/generic/cumatrix.c
index 956e1e6..a340aef 100644
--- a/matrix/generic/cumatrix.c
+++ b/matrix/generic/cumatrix.c
@@ -443,6 +443,8 @@ 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);
+ cudaEventCreate(&profile_start);
+ cudaEventCreate(&profile_stop);
profile = hashmap_create(PROFILE_HASHMAP_SIZE, bkdr_hash, strcmp);
}
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;
}