From 66a4804b6c843db6222f6ba290d88af2b110e35d Mon Sep 17 00:00:00 2001 From: risemeup1 <62429225+risemeup1@users.noreply.github.com> Date: Mon, 10 Apr 2023 10:43:22 +0800 Subject: [PATCH] fix gcc12 error (#52646) --- cmake/external/gtest.cmake | 3 ++- paddle/fluid/operators/fused/fusion_seqconv_eltadd_relu_op.cc | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cmake/external/gtest.cmake b/cmake/external/gtest.cmake index 9b19d571360..3d79b154b80 100644 --- a/cmake/external/gtest.cmake +++ b/cmake/external/gtest.cmake @@ -63,7 +63,7 @@ if(WITH_MKLML) # wait for mklml downloading completed set(GTEST_DEPENDS ${MKLML_PROJECT}) endif() -if(${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 12.0) +if(NOT WIN32 AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 12.0) file(TO_NATIVE_PATH ${PADDLE_SOURCE_DIR}/patches/gtest/gtest-death-test.cc.patch native_src) set(GTEST_PATCH_COMMAND patch -d ${GTEST_SOURCE_DIR}/googletest/src < @@ -77,6 +77,7 @@ ExternalProject_Add( DEPENDS ${GTEST_DEPENDS} PREFIX ${GTEST_PREFIX_DIR} UPDATE_COMMAND "" + PATCH_COMMAND ${GTEST_PATCH_COMMAND} CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_FLAGS=${GTEST_CMAKE_CXX_FLAGS} diff --git a/paddle/fluid/operators/fused/fusion_seqconv_eltadd_relu_op.cc b/paddle/fluid/operators/fused/fusion_seqconv_eltadd_relu_op.cc index cd481bc0c28..ab74df426a7 100644 --- a/paddle/fluid/operators/fused/fusion_seqconv_eltadd_relu_op.cc +++ b/paddle/fluid/operators/fused/fusion_seqconv_eltadd_relu_op.cc @@ -159,8 +159,8 @@ class FusionSeqConvEltAddReluKernel : public framework::OpKernel { auto* col = ctx.Output("ColMat"); auto x_lod = x->lod(); - auto x_dims = x->dims(); - auto w_dims = w->dims(); + auto x_dims = phi::vectorize(x->dims()); + auto w_dims = phi::vectorize(w->dims()); PADDLE_ENFORCE_EQ( b->numel(), w_dims[1], -- GitLab