From 93e7cf63e045c5f753a6ea2e6ad8eb5146933991 Mon Sep 17 00:00:00 2001 From: Bomb Zhang Date: Thu, 6 Oct 2016 18:24:11 +0800 Subject: [PATCH 1/2] If cmake -DWITH_AVX=OFF during configuration, should not compile the file src/hl_math.cc and src/hl_avx_functions.cc. --- paddle/cuda/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) mode change 100644 => 100755 paddle/cuda/CMakeLists.txt diff --git a/paddle/cuda/CMakeLists.txt b/paddle/cuda/CMakeLists.txt old mode 100644 new mode 100755 index e03a9a1baa004..6eeeeb3ea0012 --- a/paddle/cuda/CMakeLists.txt +++ b/paddle/cuda/CMakeLists.txt @@ -2,10 +2,17 @@ set(AVX_SOURCES src/hl_math.cc src/hl_avx_functions.cc ) +if(WITH_AVX) set(CUDA_SOURCES src/hl_time.cc src/hl_cpu_functions.cc ${AVX_SOURCES}) +else() +set(CUDA_SOURCES + src/hl_time.cc + src/hl_cpu_functions.cc +) +endif() set(CUDA_CXX_WITH_GPU_SOURCES src/hl_cuda_cublas.cc From 67730f108a271f55010e2739019f8bcfa85cacc1 Mon Sep 17 00:00:00 2001 From: Mark Date: Sun, 9 Oct 2016 13:05:20 +0800 Subject: [PATCH 2/2] Add whitespace as @reyoung suggestion. Add whitespace as @reyoung suggestion. --- paddle/cuda/CMakeLists.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/paddle/cuda/CMakeLists.txt b/paddle/cuda/CMakeLists.txt index 6eeeeb3ea0012..cdb730bb3cec7 100755 --- a/paddle/cuda/CMakeLists.txt +++ b/paddle/cuda/CMakeLists.txt @@ -2,16 +2,16 @@ set(AVX_SOURCES src/hl_math.cc src/hl_avx_functions.cc ) + if(WITH_AVX) -set(CUDA_SOURCES - src/hl_time.cc - src/hl_cpu_functions.cc - ${AVX_SOURCES}) + set(CUDA_SOURCES + src/hl_time.cc + src/hl_cpu_functions.cc + ${AVX_SOURCES}) else() -set(CUDA_SOURCES - src/hl_time.cc - src/hl_cpu_functions.cc -) + set(CUDA_SOURCES + src/hl_time.cc + src/hl_cpu_functions.cc) endif() set(CUDA_CXX_WITH_GPU_SOURCES