diff options
| author | Eric Dao <eric@erickhangdao.com> | 2025-03-10 17:54:31 -0400 |
|---|---|---|
| committer | Eric Dao <eric@erickhangdao.com> | 2025-03-10 17:54:31 -0400 |
| commit | ab224e2e6ba65f5a369ec392f99cd8845ad06c98 (patch) | |
| tree | a1e757e9341863ed52b8ad4c5a1c45933aab9da4 /python/openvino/runtime/patches/openvino_5cee8bbf29797f4544b343e803de957e9f041f92_gcc11.3.0.patch | |
| parent | 40da1752f2c8639186b72f6838aa415e854d0b1d (diff) | |
| download | thesis-master.tar.gz thesis-master.tar.bz2 thesis-master.zip | |
Diffstat (limited to 'python/openvino/runtime/patches/openvino_5cee8bbf29797f4544b343e803de957e9f041f92_gcc11.3.0.patch')
| -rw-r--r-- | python/openvino/runtime/patches/openvino_5cee8bbf29797f4544b343e803de957e9f041f92_gcc11.3.0.patch | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/python/openvino/runtime/patches/openvino_5cee8bbf29797f4544b343e803de957e9f041f92_gcc11.3.0.patch b/python/openvino/runtime/patches/openvino_5cee8bbf29797f4544b343e803de957e9f041f92_gcc11.3.0.patch new file mode 100644 index 0000000..97fbc4d --- /dev/null +++ b/python/openvino/runtime/patches/openvino_5cee8bbf29797f4544b343e803de957e9f041f92_gcc11.3.0.patch @@ -0,0 +1,37 @@ +diff --git a/src/core/src/type/bfloat16.cpp b/src/core/src/type/bfloat16.cpp +index 6e612b0cfe..dee498d795 100644 +--- a/src/core/src/type/bfloat16.cpp ++++ b/src/core/src/type/bfloat16.cpp +@@ -61,6 +61,23 @@ size_t bfloat16::size() const { + # pragma GCC diagnostic ignored "-Wuninitialized" + #endif + ++#if 1 ++// GCC 11 fails due to the reinterpret_cast violating alaising rules ++union bfloat16_uint32 ++{ ++ float f; ++ uint32_t v; ++}; ++ ++bfloat16::operator float() const ++{ ++ uint32_t tmp = (static_cast<uint32_t>(m_value) << 16); ++ union bfloat16_uint32 fv; ++ fv.v = tmp; ++ ++ return fv.f; ++} ++#else + bfloat16::operator float() const { + uint32_t tmp = 0; + uint32_t* ptmp = &tmp; +@@ -68,7 +85,7 @@ bfloat16::operator float() const { + const float* f = reinterpret_cast<const float*>(ptmp); + return *f; + } +- ++#endif + #if defined __GNUC__ && __GNUC__ == 11 + # pragma GCC diagnostic pop + #endif |
