From 430e0e418bb34d6a14662a29a3e6d5fb906c9610 Mon Sep 17 00:00:00 2001 From: hedaoyuan Date: Mon, 21 Aug 2017 10:12:25 +0800 Subject: [PATCH] Follow comments. --- paddle/function/CMakeLists.txt | 4 +++- paddle/function/EigenGemm.cpp | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/paddle/function/CMakeLists.txt b/paddle/function/CMakeLists.txt index 9187294a49..c572a9d433 100644 --- a/paddle/function/CMakeLists.txt +++ b/paddle/function/CMakeLists.txt @@ -5,7 +5,9 @@ list(APPEND h_files Function.h) list(APPEND cpp_files Function.cpp) list(APPEND cpp_files BufferArg.cpp) list(APPEND cpp_files GemmFunctor.cpp) -list(APPEND cpp_files EigenGemm.cpp) +if(USE_EIGEN_FOR_BLAS) + list(APPEND cpp_files EigenGemm.cpp) +endif(USE_EIGEN_FOR_BLAS) if(WITH_GPU) file(GLOB cu_files . *OpGpu.cu) diff --git a/paddle/function/EigenGemm.cpp b/paddle/function/EigenGemm.cpp index 0b4220fcbe..674141ed39 100644 --- a/paddle/function/EigenGemm.cpp +++ b/paddle/function/EigenGemm.cpp @@ -77,8 +77,7 @@ struct EigenBlasGemm { } else if (alpha == T(1) && beta == T(1)) { c.device(device) += a.contract(b, dims); } else { - c.device(device) = - c.constant(alpha) * a.contract(b, dims) + c.constant(beta) * c; + c.device(device) = alpha * a.contract(b, dims) + beta * c; } } }; -- GitLab