Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[CPU] Remove redundant enum_class_hash utility (#31620)

Arseniy Obolenskiy1beca5483f75
diff --git a/src/plugins/intel_cpu/src/utils/debug_caps_config.h b/src/plugins/intel_cpu/src/utils/debug_caps_config.h
index ed79c0d7f86..5456b194df9 100644
--- a/src/plugins/intel_cpu/src/utils/debug_caps_config.h
+++ b/src/plugins/intel_cpu/src/utils/debug_caps_config.h
@@ -17,7 +17,6 @@
# include "openvino/core/except.hpp"
# include "openvino/util/common_util.hpp"
-# include "utils/enum_class_hash.hpp"
namespace ov::intel_cpu {
@@ -48,7 +47,7 @@ public:
std::string verbose;
std::string blobDumpDir = "cpu_dump";
FORMAT blobDumpFormat = FORMAT::TEXT;
- std::unordered_map<FILTER, std::string, EnumClassHash> blobDumpFilters;
+ std::unordered_map<FILTER, std::string> blobDumpFilters;
bool summaryPerf = false;
std::string memoryStatisticsDumpPath;
diff --git a/src/plugins/intel_cpu/src/utils/enum_class_hash.hpp b/src/plugins/intel_cpu/src/utils/enum_class_hash.hpp
deleted file mode 100644
index e4b4f68e83d..00000000000
--- a/src/plugins/intel_cpu/src/utils/enum_class_hash.hpp
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (C) 2018-2025 Intel Corporation
-// SPDX-License-Identifier: Apache-2.0
-//
-
-#pragma once
-
-namespace ov::intel_cpu {
-
-/**
- * Workaround for c++11 defect, where hashing support
- * is missed for enum classes
- */
-struct EnumClassHash {
- template <typename T>
- int operator()(T t) const {
- return static_cast<int>(t);
- }
-};
-
-} // namespace ov::intel_cpu
diff --git a/src/plugins/intel_cpu/src/utils/ngraph_transformation.hpp b/src/plugins/intel_cpu/src/utils/ngraph_transformation.hpp
index 4614541746b..1458e2d8f29 100644
--- a/src/plugins/intel_cpu/src/utils/ngraph_transformation.hpp
+++ b/src/plugins/intel_cpu/src/utils/ngraph_transformation.hpp
@@ -60,15 +60,12 @@ private:
std::string name;
TransformationType prev;
};
- // std::hash<std::underlying_type<FILTER>::type> is necessary for Ubuntu-16.04 (gcc-5.4 and defect in C++11
- // standart)
- const std::
- unordered_map<TransformationType, TransformationInfo, std::hash<std::underlying_type_t<TransformationType>>>
- infoMap = {{TransformationType::PreLpt, {"preLpt", TransformationType::NumOfTypes}},
- {TransformationType::Lpt, {"lpt", TransformationType::PreLpt}},
- {TransformationType::PostLpt, {"postLpt", TransformationType::Lpt}},
- {TransformationType::Snippets, {"snippets", TransformationType::PostLpt}},
- {TransformationType::Specific, {"cpuSpecific", TransformationType::Snippets}}};
+ const std::unordered_map<TransformationType, TransformationInfo> infoMap = {
+ {TransformationType::PreLpt, {"preLpt", TransformationType::NumOfTypes}},
+ {TransformationType::Lpt, {"lpt", TransformationType::PreLpt}},
+ {TransformationType::PostLpt, {"postLpt", TransformationType::Lpt}},
+ {TransformationType::Snippets, {"snippets", TransformationType::PostLpt}},
+ {TransformationType::Specific, {"cpuSpecific", TransformationType::Snippets}}};
static std::bitset<TransformationType::NumOfTypes>& wasDumped() {
static std::bitset<TransformationType::NumOfTypes> wasDumped;
return wasDumped;