From 9e7171e2da3e4edba303f5c2bdaef416fb62e81a Mon Sep 17 00:00:00 2001 From: Determinant Date: Tue, 16 Feb 2016 14:50:31 +0800 Subject: pass cflags to nvcc correctly; add omitted func decl --- nerv/Makefile | 5 ++++- nerv/lib/matrix/cukernel.h | 7 +++++++ nerv/lib/matrix/generic/cumatrix.h | 7 +++++++ 3 files changed, 18 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3-70-g09d2