SINGA-100 Implement layers using CUDNN for GPU training

Automatically add library path when using `--with-cuda' and `--with-cudnn'.
Users can pass the lib check even if they do not set cuda/cudnn library path in 
environment variables.


Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/f9d42687
Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/f9d42687
Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/f9d42687

Branch: refs/heads/master
Commit: f9d42687a623e6f010aedeca14692baaadc8241d
Parents: 6f81adb
Author: xiezl <[email protected]>
Authored: Sun Dec 13 11:25:39 2015 +0800
Committer: xiezl <[email protected]>
Committed: Sun Dec 13 11:25:39 2015 +0800

----------------------------------------------------------------------
 Makefile.am  | 4 ++--
 configure.ac | 4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/f9d42687/Makefile.am
----------------------------------------------------------------------
diff --git a/Makefile.am b/Makefile.am
index 90807be..bfbd409 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -29,8 +29,8 @@ MSHADOW_FLAGS = -DMSHADOW_USE_CUDA=0 -DMSHADOW_USE_CBLAS=1 
-DMSHADOW_USE_MKL=0
 DEFAULT_FLAGS = -Wall -pthread -fPIC -std=c++11 -Wno-unknown-pragmas \
               $(MSHADOW_FLAGS) -funroll-loops -DTHREADED
 
-CFLAGS = $(DEBUG)
-CXXFLAGS = $(DEBUG)
+CFLAGS += $(DEBUG)
+CXXFLAGS += $(DEBUG)
 AC_CXXFLAGS = $(DEBUG)
 
 INCLUDES = -I$(top_srcdir)/include

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/f9d42687/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 1127994..5ae2e8c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -68,6 +68,8 @@ if test x"$cudaval" = x"yes"; then
     CUDA_CFLAGS="-I$cuda_prefix/include"
     CUDA_LDFLAGS="-L$cuda_prefix/lib64 -L$cuda_prefix/lib"
     CUDA_LIBS="-lcublas -lcudart -lcurand"
+    LIBS="$LIBS $CUDA_LIBS"
+    LDFLAGS="$LDFLAGS $CUDA_LDFLAGS"
     NVCC="nvcc"
        DEBUG="-DUSE_GPU "
     AC_DEFINE(DCUDA,[1],[Defined if CUDA should be used])
@@ -111,6 +113,8 @@ if test x"$enable_cudnn" == x"yes"; then
     CUDNN_CFLAGS="-I$cudnn_prefix/include"
     CUDNN_LDFLAGS="-L$cudnn_prefix/lib64 -L$cudnn_prefix/lib"
     CUDNN_LIBS="-lcudnn"
+    LIBS="$LIBS $CUDNN_LIBS"
+    LDFLAGS="$LDFLAGS $CUDNN_LDFLAGS"
     DEBUG+=" -DUSE_CUDNN "
     AC_DEFINE(DCUDNN,[1],[Defined if CUDNN should be used])
     AC_CHECK_LIB([cudnn], [main], [], [

Reply via email to