From 4fd432fdaca4de977df3a9cb3a5dd58c6539a6c9 Mon Sep 17 00:00:00 2001 From: tensor-tang Date: Wed, 8 Nov 2017 20:36:41 +0800 Subject: [PATCH] update mkldnn tag and abandoned deprecated sum API interface --- cmake/external/mkldnn.cmake | 6 +++++- paddle/gserver/layers/MKLDNNAddtoLayer.cpp | 6 +++--- paddle/gserver/layers/MKLDNNLayer.cpp | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cmake/external/mkldnn.cmake b/cmake/external/mkldnn.cmake index 9686df002..5a06825be 100644 --- a/cmake/external/mkldnn.cmake +++ b/cmake/external/mkldnn.cmake @@ -46,16 +46,20 @@ IF(${CBLAS_PROVIDER} STREQUAL "MKLML") MESSAGE(STATUS "Build MKLDNN with ${MKLDNN_MKLROOT}") ENDIF() +SET(MKLDNN_CFLAG "${CMAKE_C_FLAGS} -Wno-error=strict-overflow") +SET(MKLDNN_CXXFLAG "${CMAKE_CXX_FLAGS} -Wno-error=strict-overflow") ExternalProject_Add( ${MKLDNN_PROJECT} ${EXTERNAL_PROJECT_LOG_ARGS} DEPENDS ${MKLDNN_DEPENDS} GIT_REPOSITORY "https://github.com/01org/mkl-dnn.git" - GIT_TAG "v0.10" + GIT_TAG "v0.11" PREFIX ${MKLDNN_SOURCES_DIR} UPDATE_COMMAND "" CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${MKLDNN_INSTALL_DIR} CMAKE_ARGS -DMKLROOT=${MKLDNN_MKLROOT} + CMAKE_ARGS -DCMAKE_C_FLAGS=${MKLDNN_CFLAG} + CMAKE_ARGS -DCMAKE_CXX_FLAGS=${MKLDNN_CXXFLAG} CMAKE_CACHE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${MKLDNN_INSTALL_DIR} -DMKLROOT:PATH=${MKLDNN_MKLROOT} ) diff --git a/paddle/gserver/layers/MKLDNNAddtoLayer.cpp b/paddle/gserver/layers/MKLDNNAddtoLayer.cpp index 9c13a23d4..6ffe4fbec 100644 --- a/paddle/gserver/layers/MKLDNNAddtoLayer.cpp +++ b/paddle/gserver/layers/MKLDNNAddtoLayer.cpp @@ -91,7 +91,7 @@ void MKLDNNAddtoLayer::resetBwd(std::vector& pipeline, // backward bias bwdBias_ = nullptr; if (bias) { - std::vector scales(bs_, 1.0); + std::vector scales(bs_, 1.0); std::vector srcPDs(bs_, bias->getPrimitiveDesc()); auto biasPD = sum::primitive_desc(bias->getMemoryDesc(), scales, srcPDs); std::vector srcs; @@ -153,7 +153,7 @@ void MKLDNNAddtoLayer::resetFwdPD(std::shared_ptr& pd, std::vector& inputs, MKLDNNMatrixPtr bias, MKLDNNMatrixPtr out) { - std::vector scales(inputs.size(), 1.0); + std::vector scales(inputs.size(), 1.0); std::vector srcPDs; for (size_t i = 0; i < inputs.size(); i++) { srcPDs.push_back(inputs[i]->getPrimitiveDesc()); @@ -164,7 +164,7 @@ void MKLDNNAddtoLayer::resetFwdPD(std::shared_ptr& pd, biasPD = nullptr; if (bias) { - std::vector scales(2, 1.0); + std::vector scales(2, 1.0); std::vector srcPDs(2, bias->getPrimitiveDesc()); biasPD.reset( new sum::primitive_desc(bias->getMemoryDesc(), scales, srcPDs)); diff --git a/paddle/gserver/layers/MKLDNNLayer.cpp b/paddle/gserver/layers/MKLDNNLayer.cpp index 82ef344c7..e75ac5ba4 100644 --- a/paddle/gserver/layers/MKLDNNLayer.cpp +++ b/paddle/gserver/layers/MKLDNNLayer.cpp @@ -287,7 +287,7 @@ void MKLDNNLayer::resetMergeGrad(MKLDNNMatrixPtr& out) { return; } CHECK(out) << "should have reset internal ouput grad"; - std::vector scales(outputMap_.size(), 1.0); + std::vector scales(outputMap_.size(), 1.0); std::vector srcPDs; std::vector srcs; for (auto it = outputMap_.begin(); it != outputMap_.end(); ++it) { -- GitLab