From b30b283f0d93d61815351a64abdef1765a833848 Mon Sep 17 00:00:00 2001 From: Xiping Yan Date: Mon, 27 Feb 2023 17:11:55 +0800 Subject: [PATCH] [CPU] Fix all warnings or errors after removing "-Wno-class-memaccess" in cpu plugin CMakeLists.txt (#15780) * Remove -Wno-class-memaccess Signed-off-by: Yan, Xiping * fix warnings for memset. Signed-off-by: Yan, Xiping * Change bfloat16_t implementation to trivial. Signed-off-by: Yan, Xiping * memset warning can be fixed via changing bfloat16_t to TRIVIAL. Signed-off-by: Yan, Xiping * Revert "memset warning can be fixed via changing bfloat16_t to TRIVIAL." This reverts commit 28a37af5c8205fd522d6b2a68f490bdc8e3d2021. --------- Signed-off-by: Yan, Xiping --- src/plugins/intel_cpu/CMakeLists.txt | 1 - src/plugins/intel_cpu/src/utils/bfloat16.hpp | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/plugins/intel_cpu/CMakeLists.txt b/src/plugins/intel_cpu/CMakeLists.txt index 65d8601d6e8..380dfa1ff4d 100644 --- a/src/plugins/intel_cpu/CMakeLists.txt +++ b/src/plugins/intel_cpu/CMakeLists.txt @@ -12,7 +12,6 @@ if(CMAKE_COMPILER_IS_GNUCXX) ie_add_compiler_flags(-Wno-sign-compare) ie_add_compiler_flags(-Wno-sequence-point) ie_add_compiler_flags(-Wno-strict-aliasing) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-class-memaccess") elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") # C4267, 4244 issues from mkl-dnn headers conversion from 'XXX' to 'YYY', possible loss of data ie_add_compiler_flags(/wd4267) diff --git a/src/plugins/intel_cpu/src/utils/bfloat16.hpp b/src/plugins/intel_cpu/src/utils/bfloat16.hpp index 6fbd2875a22..7e190e756c9 100644 --- a/src/plugins/intel_cpu/src/utils/bfloat16.hpp +++ b/src/plugins/intel_cpu/src/utils/bfloat16.hpp @@ -20,10 +20,7 @@ namespace intel_cpu { class bfloat16_t { public: - constexpr bfloat16_t() - : m_value{0} - { - } + bfloat16_t() = default; bfloat16_t(float value) noexcept : m_value{ #if defined BFLOAT16_ROUND_MODE_TO_NEAREST