You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@singa.apache.org by wa...@apache.org on 2016/06/24 06:51:35 UTC

[2/6] incubator-singa git commit: SINGA-197 Add CNMem as a submodule in lib/

SINGA-197 Add CNMem as a submodule in lib/

Compile CNMem library before building singa. A "libcnmem.so" file is generated in BUILD_PATH/lib.
Now it is compatible with low version of cmake.
The cuda sources will not be compiled when USE_CUDA is OFF.
Move singa_config.h to BUILD_PATH/include/singa.


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

Branch: refs/heads/dev
Commit: ce3e6dc102964ec6ed782cbdd6cb6ca30b41a4db
Parents: 683b3a7
Author: xiezl <xi...@comp.nus.edu.sg>
Authored: Tue Jun 14 15:45:45 2016 +0800
Committer: xiezl <xi...@comp.nus.edu.sg>
Committed: Tue Jun 14 15:45:45 2016 +0800

----------------------------------------------------------------------
 CMakeLists.txt                      |  6 ++++--
 cmake/Cuda.cmake                    |  1 -
 cmake/Dependencies.cmake            |  4 ++--
 cmake/Protobuf.cmake                | 28 ++++++++++++++++++++++++++++
 include/singa/core/common.h         |  2 +-
 include/singa/core/device.h         |  2 +-
 include/singa/utils/cuda_utils.h    |  2 +-
 src/CMakeLists.txt                  | 19 +++++++++++++------
 src/core/device/cuda_gpu.cc         |  2 +-
 src/core/tensor/math_kernel.cu      |  2 +-
 src/core/tensor/math_kernel.h       |  2 +-
 src/core/tensor/tensor_math_cuda.h  |  2 +-
 src/model/layer/cudnn_activation.cc |  2 +-
 src/model/layer/cudnn_activation.h  |  2 +-
 src/model/layer/cudnn_batchnorm.h   |  2 +-
 src/model/layer/cudnn_convolution.h |  2 +-
 src/model/layer/cudnn_dropout.h     |  2 +-
 src/model/layer/cudnn_lrn.h         |  2 +-
 src/model/layer/cudnn_pooling.h     |  2 +-
 src/model/layer/cudnn_softmax.cc    |  2 +-
 src/model/layer/cudnn_utils.h       |  2 +-
 test/singa/test_cudnn_activation.cc |  2 +-
 test/singa/test_cudnn_softmax.cc    |  2 +-
 test/singa/test_dense.cc            |  2 +-
 test/singa/test_mse.cc              |  2 +-
 test/singa/test_sgd.cc              |  2 +-
 26 files changed, 68 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/ce3e6dc1/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fbe3adc..f6240d2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,7 +12,8 @@ IF(UNIX OR APPLE)
 ENDIF()
 
 #message(STATUS "${CMAKE_CXX_FLAGS}")
-SET(SINGA_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/include;${PROJECT_BINARY_DIR}")
+SET(SINGA_INCLUDE_DIR
+    "${CMAKE_SOURCE_DIR}/include;${CMAKE_SOURCE_DIR}/lib/cnmem/lib;${PROJECT_BINARY_DIR}")
 #message(STATUS "include path: ${SINGA_INCLUDE_DIR}")
 INCLUDE_DIRECTORIES(${SINGA_INCLUDE_DIR})
 
@@ -28,7 +29,7 @@ ADD_DEFINITIONS(-DUSE_CMAKE)
 
 CONFIGURE_FILE (
     "${PROJECT_SOURCE_DIR}/cmake/Templates/singa_config.h.in"
-    "${PROJECT_BINARY_DIR}/singa_config.h")
+    "${PROJECT_BINARY_DIR}/include/singa/singa_config.h")
 
 #set(SINGA_CONFIGURE_SRC "${PROJECT_BINARY_DIR}/singa_config.h")
 #LIST(APPEND SRCS ${SINGA_CONFIGURE_SRCS} ${PROJECT_BINARY_DIR}/singa_config.h)
@@ -36,5 +37,6 @@ CONFIGURE_FILE (
 SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
 SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
 
+ADD_SUBDIRECTORY(lib/cnmem)
 ADD_SUBDIRECTORY(src)
 ADD_SUBDIRECTORY(test)

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/ce3e6dc1/cmake/Cuda.cmake
----------------------------------------------------------------------
diff --git a/cmake/Cuda.cmake b/cmake/Cuda.cmake
index a74c82b..e7af7c9 100644
--- a/cmake/Cuda.cmake
+++ b/cmake/Cuda.cmake
@@ -10,7 +10,6 @@ MESSAGE(STATUS "Found cuda_v${CUDA_VERSION}")
 #ADD_DEFINITIONS(-DUSE_CUDA)
 #message(STATUS "linking: ${CUDA_CUDART_LIBRARY} ${CUDA_curand_LIBRARY} ${CUDA_CUBLAS_LIBRARIES}")
 
-
 IF(USE_CUDNN)
 #include(cmake/Modules/Cudnn.cmake)
     FIND_PACKAGE(CUDNN REQUIRED)

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/ce3e6dc1/cmake/Dependencies.cmake
----------------------------------------------------------------------
diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
index d3f0b00..fe178d6 100644
--- a/cmake/Dependencies.cmake
+++ b/cmake/Dependencies.cmake
@@ -6,6 +6,7 @@ FIND_PACKAGE( Protobuf REQUIRED )
 INCLUDE_DIRECTORIES(SYSTEM ${PROTOBUF_INCLUDE_DIR})
 MESSAGE(STATUS "proto libs " ${PROTOBUF_LIBRARIES})
 LIST(APPEND singa_linker_libs ${PROTOBUF_LIBRARIES})
+INCLUDE("cmake/Protobuf.cmake")
 
 IF(USE_LMDB)
     FIND_PACKAGE(LMDB REQUIRED)
@@ -14,10 +15,9 @@ IF(USE_LMDB)
     MESSAGE(STATUS "FOUND lmdb at ${LMDB_INCLUDE_DIR}")
 ENDIF()
 
-IF(NOT CPU_ONLY)
+IF(USE_CUDA)
     INCLUDE("cmake/Cuda.cmake")
 ELSE()
-    SET(USE_CUDA FALSE)
     SET(USE_CUDNN FALSE)
 ENDIF()
 

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/ce3e6dc1/cmake/Protobuf.cmake
----------------------------------------------------------------------
diff --git a/cmake/Protobuf.cmake b/cmake/Protobuf.cmake
new file mode 100644
index 0000000..c72b2c0
--- /dev/null
+++ b/cmake/Protobuf.cmake
@@ -0,0 +1,28 @@
+# copy from cmake source code
+function(PROTOBUF_GENERATE_PYTHON OUTPUT)
+    if(NOT ARGN)
+        message(SEND_ERROR "Error: PROTOBUF_GENERATE_PYTHON() called 
+        without any proto files")
+        return()
+    endif(NOT ARGN)
+
+    set(${OUTPUT})
+    foreach(FIL ${ARGN})
+        get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
+        get_filename_component(FIL_WE ${FIL} NAME_WE)
+        get_filename_component(PATH ${FIL} PATH)
+
+        list(APPEND ${OUTPUT} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}_pb2.py")
+
+        add_custom_command(
+            OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}_pb2.py"
+            COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
+            ARGS --python_out ${CMAKE_CURRENT_BINARY_DIR}
+                 --proto_path ${PATH} ${ABS_FIL}
+            DEPENDS ${ABS_FIL}
+            COMMENT "Running Python protocol buffer compiler on ${FIL}" VERBATIM)
+    endforeach()
+    
+    set_source_files_properties(${${SRCS}} ${${HDRS}} PROPERTIES GENERATED TRUE)
+    set(${OUTPUT} ${${OUTPUT}} PARENT_SCOPE)
+endfunction()

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/ce3e6dc1/include/singa/core/common.h
----------------------------------------------------------------------
diff --git a/include/singa/core/common.h b/include/singa/core/common.h
index e6f4c90..e19022e 100644
--- a/include/singa/core/common.h
+++ b/include/singa/core/common.h
@@ -20,7 +20,7 @@
 #define SINGA_CORE_COMMON_H_
 #include <random>
 #include <chrono>
-#include "./singa_config.h"
+#include "./singa/singa_config.h"
 #include "singa/utils/logging.h"
 
 #ifdef USE_CUDA

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/ce3e6dc1/include/singa/core/device.h
----------------------------------------------------------------------
diff --git a/include/singa/core/device.h b/include/singa/core/device.h
index 56eda70..8c95dc7 100644
--- a/include/singa/core/device.h
+++ b/include/singa/core/device.h
@@ -23,7 +23,7 @@
 #include <vector>
 #include <string>
 #include <functional>
-#include "singa_config.h"
+#include "singa/singa_config.h"
 #include "singa/core/common.h"
 #include "singa/core/memory.h"
 #include "singa/core/scheduler.h"

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/ce3e6dc1/include/singa/utils/cuda_utils.h
----------------------------------------------------------------------
diff --git a/include/singa/utils/cuda_utils.h b/include/singa/utils/cuda_utils.h
index 17eb683..24f3eb9 100644
--- a/include/singa/utils/cuda_utils.h
+++ b/include/singa/utils/cuda_utils.h
@@ -2,7 +2,7 @@
 #ifndef SINGA_UTILS_CUDA_UTILS_H_
 #define SINGA_UTILS_CUDA_UTILS_H_
 
-#include "singa_config.h"
+#include "singa/singa_config.h"
 #ifdef USE_CUDA
 #include <cublas_v2.h>
 #include <cuda.h>

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/ce3e6dc1/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 952f7ee..4949236 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -31,15 +31,22 @@ AUX_SOURCE_DIRECTORY(core/device core_source)
 AUX_SOURCE_DIRECTORY(core/memory core_source)
 AUX_SOURCE_DIRECTORY(core/scheduler core_source)
 AUX_SOURCE_DIRECTORY(core/tensor core_source)
-FILE(GLOB_RECURSE cuda_source core "*.cu")
-SET(FLAGS_BACKUP ${CMAKE_CXX_FLAGS})
-SET(CMAKE_CXX_FLAGS "")
-CUDA_COMPILE(cuda_objs SHARED ${cuda_source} OPTIONS "-Xcompiler -fPIC")
+IF (USE_CUDA)
+    FILE(GLOB_RECURSE cuda_source core "*.cu")
+    SET(FLAGS_BACKUP ${CMAKE_CXX_FLAGS})
+    SET(CMAKE_CXX_FLAGS "")
+    IF (CMAKE_BUILD_TYPE MATCHES DEBUG)
+        CUDA_COMPILE(cuda_objs SHARED ${cuda_source} 
+            OPTIONS "-Xcompiler -fPIC -G -g")
+    ELSE (CMAKE_BUILD_TYPE MATCHES  DEBUG)
+        CUDA_COMPILE(cuda_objs SHARED ${cuda_source} OPTIONS "-Xcompiler -fPIC")
+    ENDIF (CMAKE_BUILD_TYPE MATCHES DEBUG)
+    include_directories("${CMAKE_CURRENT_SOURCE_DIR}/core/tensor")
+    SET(CMAKE_CXX_FLAGS ${FLAGS_BACKUP})
+ENDIF (USE_CUDA)
 #message(STATUS "FLAGS ${CMAKE_CXX_FLAGS}")
 #message(STATUS "CORE ${cuda_source}")
 #message(STATUS "OBJ ${cuda_objs}")
-include_directories("${CMAKE_CURRENT_SOURCE_DIR}/core/tensor")
-SET(CMAKE_CXX_FLAGS ${FLAGS_BACKUP})
 ADD_LIBRARY(singa_core SHARED ${core_source} ${cuda_objs})
 TARGET_LINK_LIBRARIES(singa_core ${SINGA_LINKER_LIBS})
 LIST(APPEND SINGA_LINKER_LIBS singa_core)

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/ce3e6dc1/src/core/device/cuda_gpu.cc
----------------------------------------------------------------------
diff --git a/src/core/device/cuda_gpu.cc b/src/core/device/cuda_gpu.cc
index 5d4e1ed..a47f6fe 100644
--- a/src/core/device/cuda_gpu.cc
+++ b/src/core/device/cuda_gpu.cc
@@ -15,7 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include "singa_config.h"
+#include "singa/singa_config.h"
 #ifdef USE_CUDA
 #include <cublas_v2.h>
 #include <cuda.h>

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/ce3e6dc1/src/core/tensor/math_kernel.cu
----------------------------------------------------------------------
diff --git a/src/core/tensor/math_kernel.cu b/src/core/tensor/math_kernel.cu
index aed6add..cc84e5c 100644
--- a/src/core/tensor/math_kernel.cu
+++ b/src/core/tensor/math_kernel.cu
@@ -19,7 +19,7 @@
 *
 *************************************************************/
 
-#include "singa_config.h"
+#include "singa/singa_config.h"
 #ifdef USE_CUDA
 #include <cmath>
 #include <algorithm>

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/ce3e6dc1/src/core/tensor/math_kernel.h
----------------------------------------------------------------------
diff --git a/src/core/tensor/math_kernel.h b/src/core/tensor/math_kernel.h
index 5c906a9..4f13a5b 100644
--- a/src/core/tensor/math_kernel.h
+++ b/src/core/tensor/math_kernel.h
@@ -22,7 +22,7 @@
 #define SRC_CORE_TENSOR__MATH_KERNEL_H_
 
 
-#include "singa_config.h"
+#include "singa/singa_config.h"
 #ifdef USE_CUDA
 
 /// TODO(wangwei) Clean the function APIs as commented in tensor_math.h

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/ce3e6dc1/src/core/tensor/tensor_math_cuda.h
----------------------------------------------------------------------
diff --git a/src/core/tensor/tensor_math_cuda.h b/src/core/tensor/tensor_math_cuda.h
index 4a2ba66..6693644 100644
--- a/src/core/tensor/tensor_math_cuda.h
+++ b/src/core/tensor/tensor_math_cuda.h
@@ -18,7 +18,7 @@
 
 #ifndef  SINGA_CORE_TENSOR_TENSOR_MATH_CUDA_H_
 #define  SINGA_CORE_TENSOR_TENSOR_MATH_CUDA_H_
-#include "singa_config.h"
+#include "singa/singa_config.h"
 #ifdef USE_CUDA
 #include "./tensor_math.h"
 #include "./math_kernel.h"

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/ce3e6dc1/src/model/layer/cudnn_activation.cc
----------------------------------------------------------------------
diff --git a/src/model/layer/cudnn_activation.cc b/src/model/layer/cudnn_activation.cc
index 8ecbbc7..b924494 100644
--- a/src/model/layer/cudnn_activation.cc
+++ b/src/model/layer/cudnn_activation.cc
@@ -15,7 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include "singa_config.h"
+#include "singa/singa_config.h"
 #ifdef USE_CUDNN
 #include "./cudnn_activation.h"
 #include <cudnn.h>

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/ce3e6dc1/src/model/layer/cudnn_activation.h
----------------------------------------------------------------------
diff --git a/src/model/layer/cudnn_activation.h b/src/model/layer/cudnn_activation.h
index b572db7..1483e48 100644
--- a/src/model/layer/cudnn_activation.h
+++ b/src/model/layer/cudnn_activation.h
@@ -18,7 +18,7 @@
 
 #ifndef SINGA_MODEL_LAYER_CUDNN_ACTIVATION_H_
 #define SINGA_MODEL_LAYER_CUDNN_ACTIVATION_H_
-#include "singa_config.h"
+#include "singa/singa_config.h"
 #ifdef USE_CUDNN
 #include <cudnn.h>
 #include <utility>

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/ce3e6dc1/src/model/layer/cudnn_batchnorm.h
----------------------------------------------------------------------
diff --git a/src/model/layer/cudnn_batchnorm.h b/src/model/layer/cudnn_batchnorm.h
index 83258d2..8598b65 100644
--- a/src/model/layer/cudnn_batchnorm.h
+++ b/src/model/layer/cudnn_batchnorm.h
@@ -20,7 +20,7 @@
 ************************************************************/
 #ifndef SINGA_MODEL_LAYER_CUDNN_BATCHNORM_H
 #define SINGA_MODEL_LAYER_CUDNN_BATCHNORM_H
-#include "singa_config.h"
+#include "singa/singa_config.h"
 #ifdef USE_CUDNN
 
 #include "batchnorm.h"

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/ce3e6dc1/src/model/layer/cudnn_convolution.h
----------------------------------------------------------------------
diff --git a/src/model/layer/cudnn_convolution.h b/src/model/layer/cudnn_convolution.h
index b86c576..152d797 100644
--- a/src/model/layer/cudnn_convolution.h
+++ b/src/model/layer/cudnn_convolution.h
@@ -18,7 +18,7 @@
 
 #ifndef SRC_MODEL_LAYER_CUDNN_CONVOLUTION_H_
 #define SRC_MODEL_LAYER_CUDNN_CONVOLUTION_H_
-#include "singa_config.h"
+#include "singa/singa_config.h"
 #ifdef USE_CUDNN
 #include <string>
 #include <utility>

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/ce3e6dc1/src/model/layer/cudnn_dropout.h
----------------------------------------------------------------------
diff --git a/src/model/layer/cudnn_dropout.h b/src/model/layer/cudnn_dropout.h
index 7cb185b..da3d1d2 100644
--- a/src/model/layer/cudnn_dropout.h
+++ b/src/model/layer/cudnn_dropout.h
@@ -18,7 +18,7 @@
 
 #ifndef SRC_MODEL_LAYER_CUDNN_DROPOUT_H_
 #define SRC_MODEL_LAYER_CUDNN_DROPOUT_H_
-#include "singa_config.h"
+#include "singa/singa_config.h"
 #ifdef USE_CUDNN
 // cudnn dropout is added in cudnn 5
 #if CUDNN_VERSION_MAJOR >= 5

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/ce3e6dc1/src/model/layer/cudnn_lrn.h
----------------------------------------------------------------------
diff --git a/src/model/layer/cudnn_lrn.h b/src/model/layer/cudnn_lrn.h
index 0f650fe..cd3bcf1 100644
--- a/src/model/layer/cudnn_lrn.h
+++ b/src/model/layer/cudnn_lrn.h
@@ -20,7 +20,7 @@
 ************************************************************/
 #ifndef SINGA_MODEL_LAYER_CUDNN_LRN_H_
 #define SINGA_MODEL_LAYER_CUDNN_LRN_H_
-#include "singa_config.h"
+#include "singa/singa_config.h"
 #ifdef USE_CUDNN
 
 #include "lrn.h"

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/ce3e6dc1/src/model/layer/cudnn_pooling.h
----------------------------------------------------------------------
diff --git a/src/model/layer/cudnn_pooling.h b/src/model/layer/cudnn_pooling.h
index 1a38cd5..a5936ad 100644
--- a/src/model/layer/cudnn_pooling.h
+++ b/src/model/layer/cudnn_pooling.h
@@ -18,7 +18,7 @@
 
 #ifndef SRC_MODEL_LAYER_CUDNN_POOLING_H_
 #define SRC_MODEL_LAYER_CUDNN_POOLING_H_
-#include "singa_config.h"
+#include "singa/singa_config.h"
 #ifdef USE_CUDNN
 #include <cudnn.h>
 #include <string>

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/ce3e6dc1/src/model/layer/cudnn_softmax.cc
----------------------------------------------------------------------
diff --git a/src/model/layer/cudnn_softmax.cc b/src/model/layer/cudnn_softmax.cc
index 85b0c3d..d557062 100644
--- a/src/model/layer/cudnn_softmax.cc
+++ b/src/model/layer/cudnn_softmax.cc
@@ -15,7 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include "singa_config.h"
+#include "singa/singa_config.h"
 #include "./cudnn_softmax.h"
 #ifdef USE_CUDNN
 #include <cudnn.h>

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/ce3e6dc1/src/model/layer/cudnn_utils.h
----------------------------------------------------------------------
diff --git a/src/model/layer/cudnn_utils.h b/src/model/layer/cudnn_utils.h
index 039a1ac..19c72ec 100644
--- a/src/model/layer/cudnn_utils.h
+++ b/src/model/layer/cudnn_utils.h
@@ -18,7 +18,7 @@
 #ifndef SRC_MODEL_LAYER_CUDNN_UTILS_H_
 #define SRC_MODEL_LAYER_CUDNN_UTILS_H_
 
-#include "singa_config.h"
+#include "singa/singa_config.h"
 #ifdef USE_CUDNN
 
 #include <cudnn.h>

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/ce3e6dc1/test/singa/test_cudnn_activation.cc
----------------------------------------------------------------------
diff --git a/test/singa/test_cudnn_activation.cc b/test/singa/test_cudnn_activation.cc
index 892b80b..bed7715 100644
--- a/test/singa/test_cudnn_activation.cc
+++ b/test/singa/test_cudnn_activation.cc
@@ -18,7 +18,7 @@
 * under the License.
 *
 *************************************************************/
-#include "singa_config.h"
+#include "singa/singa_config.h"
 #ifdef USE_CUDNN
 
 #include "singa/proto/core.pb.h"

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/ce3e6dc1/test/singa/test_cudnn_softmax.cc
----------------------------------------------------------------------
diff --git a/test/singa/test_cudnn_softmax.cc b/test/singa/test_cudnn_softmax.cc
index 05783e2..e11be87 100644
--- a/test/singa/test_cudnn_softmax.cc
+++ b/test/singa/test_cudnn_softmax.cc
@@ -18,7 +18,7 @@
 * under the License.
 *
 *************************************************************/
-#include "singa_config.h"
+#include "singa/singa_config.h"
 #ifdef USE_CUDNN
 
 #include "../src/model/layer/cudnn_softmax.h"

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/ce3e6dc1/test/singa/test_dense.cc
----------------------------------------------------------------------
diff --git a/test/singa/test_dense.cc b/test/singa/test_dense.cc
index 5050d7e..052d0e8 100644
--- a/test/singa/test_dense.cc
+++ b/test/singa/test_dense.cc
@@ -20,7 +20,7 @@
 *************************************************************/
 #include "../src/model/layer/dense.h"
 #include "gtest/gtest.h"
-#include "singa_config.h"
+#include "singa/singa_config.h"
 
 using singa::Dense;
 TEST(Dense, Setup) {

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/ce3e6dc1/test/singa/test_mse.cc
----------------------------------------------------------------------
diff --git a/test/singa/test_mse.cc b/test/singa/test_mse.cc
index ccaab7a..2c02273 100644
--- a/test/singa/test_mse.cc
+++ b/test/singa/test_mse.cc
@@ -23,7 +23,7 @@
 #include "singa/core/tensor.h"
 #include "singa/core/device.h"
 #include "../src/model/loss/mse.h"
-#include "singa_config.h"
+#include "singa/singa_config.h"
 using singa::Tensor;
 class TestMSE : public ::testing::Test {
  protected:

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/ce3e6dc1/test/singa/test_sgd.cc
----------------------------------------------------------------------
diff --git a/test/singa/test_sgd.cc b/test/singa/test_sgd.cc
index c0b6e2b..71ab15e 100644
--- a/test/singa/test_sgd.cc
+++ b/test/singa/test_sgd.cc
@@ -21,7 +21,7 @@
 
 #include "gtest/gtest.h"
 #include "singa/model/optimizer.h"
-#include "singa_config.h"
+#include "singa/singa_config.h"
 
 TEST(SGD, ApplyWithoutMomentum) {
   singa::SGD sgd;