aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeterminant <ted.sybil@gmail.com>2016-02-16 14:50:31 +0800
committerDeterminant <ted.sybil@gmail.com>2016-02-16 14:50:31 +0800
commit9e7171e2da3e4edba303f5c2bdaef416fb62e81a (patch)
tree722605d92482df5f57e329ab4b3e34b6982671ee
parenta7608a67f16f745309409f6a004354121e0b3ba6 (diff)
pass cflags to nvcc correctly; add omitted func decl
-rw-r--r--nerv/Makefile5
-rw-r--r--nerv/lib/matrix/cukernel.h7
-rw-r--r--nerv/lib/matrix/generic/cumatrix.h7
3 files changed, 18 insertions, 1 deletions
diff --git a/nerv/Makefile b/nerv/Makefile
index 0c6b380..a29309a 100644
--- a/nerv/Makefile
+++ b/nerv/Makefile
@@ -46,7 +46,10 @@ INCLUDE += $(CUDA_INCLUDE)
LDFLAGS := -L$(CUDA_BASE)/lib64/ -Wl,-rpath=$(CUDA_BASE)/lib64/ -lcudart -lcublas -lcurand
NVCC := $(CUDA_BASE)/bin/nvcc
-NVCC_FLAGS := -Xcompiler -fPIC,-Wextra
+EMPTY :=
+SPACE := $(EMPTY) $(EMPTY)
+COMMA := ,
+NVCC_FLAGS := -Xcompiler -fPIC -Xcompiler $(subst $(SPACE),$(COMMA),$(CFLAGS))
LUA_LIBS := $(addprefix $(LUA_DIR)/,$(LUA_LIBS))
diff --git a/nerv/lib/matrix/cukernel.h b/nerv/lib/matrix/cukernel.h
index 04d0e28..4654d29 100644
--- a/nerv/lib/matrix/cukernel.h
+++ b/nerv/lib/matrix/cukernel.h
@@ -27,4 +27,11 @@ void cudak_(cuda_copy_rows_by_idx)(const Matrix *a, Matrix *b,
const Matrix *idx, int b_begin);
void cudak_(cuda_copy_rows_by_colidx)(const Matrix *a, Matrix *b,
const Matrix *idx, int b_begin);
+#ifdef __NERV_FUTURE_CUDA_7
+ void cudak_(cuda_update_select_rows_by_rowidx)(Matrix *c, const Matrix *a, const Matrix *idx,
+ double alpha, double beta);
+ void cudak_(cuda_update_select_rows_by_colidx)(Matrix *c, const Matrix *a, const Matrix *idx,
+ double alpha, double beta);
+#endif
+
#endif
diff --git a/nerv/lib/matrix/generic/cumatrix.h b/nerv/lib/matrix/generic/cumatrix.h
index 9304060..4f66a2c 100644
--- a/nerv/lib/matrix/generic/cumatrix.h
+++ b/nerv/lib/matrix/generic/cumatrix.h
@@ -65,3 +65,10 @@ void nerv_matrix_(thres_mask)(Matrix *a, Matrix *b,
double thres, double low, double high,
Status *status);
void nerv_matrix_(rand_uniform)(Matrix *a, Status *status);
+
+#ifdef __NERV_FUTURE_CUDA_7
+void nerv_matrix_(update_select_rows_by_rowidx)(Matrix *c, const Matrix *a, const Matrix *idx,
+ double alpha, double beta, Status *status);
+void nerv_matrix_(update_select_rows_by_colidx)(Matrix *c, const Matrix *a, const Matrix *idx,
+ double alpha, double beta, Status *status);
+#endif