未验证 提交 b2bd74f7 编写于 作者: R risemeup1 提交者: GitHub

fix_gcc12_error (#52007)

* fix_gcc12_error

* patch on eigen3 for fixing gcc12 error

* Update multiary.cc
上级 968f7f24
......@@ -41,6 +41,22 @@ elseif(LINUX)
endif()
endif()
if(CMAKE_COMPILER_IS_GNUCC)
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpfullversion -dumpversion
OUTPUT_VARIABLE GCC_VERSION)
string(REGEX MATCHALL "[0-9]+" GCC_VERSION_COMPONENTS ${GCC_VERSION})
list(GET GCC_VERSION_COMPONENTS 0 GCC_MAJOR)
list(GET GCC_VERSION_COMPONENTS 1 GCC_MINOR)
set(GCC_VERSION "${GCC_MAJOR}.${GCC_MINOR}")
if(GCC_VERSION GREATER_EQUAL "12.0")
file(TO_NATIVE_PATH ${PADDLE_SOURCE_DIR}/patches/eigen/Complex.h.patch
complex_header)
set(EIGEN_PATCH_COMMAND
patch -d ${EIGEN_SOURCE_DIR}/Eigen/src/Core/arch/SSE/ <
${complex_header})
endif()
endif()
set(EIGEN_INCLUDE_DIR ${EIGEN_SOURCE_DIR})
include_directories(${EIGEN_INCLUDE_DIR})
......
......@@ -2231,7 +2231,7 @@ void MultiDotInferMeta(const std::vector<const MetaTensor*>& x,
: phi::make_ddim({first_dim[0], last_dim[1]});
}
auto width = first_dim[1];
auto width = first_dim.at(1);
for (size_t i = 1; i < n - 1; i++) {
PADDLE_ENFORCE_EQ(inputs_dims[i].size(),
static_cast<size_t>(2),
......
diff --git a/Eigen/src/Core/arch/SSE/Complex.h b/Eigen/src/Core/arch/SSE/Complex.h
index f6f1b8c..2f4e7d1 100644
--- a/Eigen/src/Core/arch/SSE/Complex.h
+++ b/Eigen/src/Core/arch/SSE/Complex.h
@@ -17,7 +17,7 @@ namespace internal {
//---------- float ----------
struct Packet2cf
{
- EIGEN_STRONG_INLINE Packet2cf() {}
+ EIGEN_STRONG_INLINE Packet2cf() :v(_mm_setzero_ps()) {}
EIGEN_STRONG_INLINE explicit Packet2cf(const __m128& a) : v(a) {}
__m128 v;
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册