From 7abd1bdfff5af52295a0d15644923fdf9aea46bc Mon Sep 17 00:00:00 2001 From: dangqingqing Date: Tue, 7 Nov 2017 14:00:52 +0800 Subject: [PATCH] Fix cmake error when building with WITH_AVX=OFF. --- paddle/operators/math/detail/CMakeLists.txt | 4 +--- paddle/operators/math/detail/avx_functions.cc | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/paddle/operators/math/detail/CMakeLists.txt b/paddle/operators/math/detail/CMakeLists.txt index 92eac9d3623..0df1c060f90 100644 --- a/paddle/operators/math/detail/CMakeLists.txt +++ b/paddle/operators/math/detail/CMakeLists.txt @@ -1,3 +1 @@ -if(WITH_AVX) - cc_library(activation_functions SRCS avx_functions.cc) -endif() +cc_library(activation_functions SRCS avx_functions.cc) diff --git a/paddle/operators/math/detail/avx_functions.cc b/paddle/operators/math/detail/avx_functions.cc index 6d9df654a48..921364788cd 100644 --- a/paddle/operators/math/detail/avx_functions.cc +++ b/paddle/operators/math/detail/avx_functions.cc @@ -12,6 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ +#ifdef __AVX__ + #include #include "paddle/operators/math/detail/activation_functions.h" // TODO(qingqing) refine this dependence @@ -84,3 +86,5 @@ __m256 Identity(const __m256 a, const __m256 b) { return a; } } // namespace math } // namespace operators } // namespace paddle + +#endif -- GitLab