[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 <xiping.yan@intel.com>

* fix warnings for memset.

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Change bfloat16_t implementation to trivial.

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* memset warning can be fixed via changing bfloat16_t to TRIVIAL.

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Revert "memset warning can be fixed via changing bfloat16_t to TRIVIAL."

This reverts commit 28a37af5c8.

---------

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>
This commit is contained in:
Xiping Yan 2023-02-27 17:11:55 +08:00 committed by GitHub
parent a7443e13fa
commit b30b283f0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 5 deletions

View File

@ -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)

View File

@ -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