Skip to content

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

[Snippets][CPU] Remove 'using namespace std' (#32027)

Arseniy Obolenskiye2b1917204e6
diff --git a/src/common/snippets/src/op/subgraph.cpp b/src/common/snippets/src/op/subgraph.cpp
index 505b2d22923..385cc08f4e7 100644
--- a/src/common/snippets/src/op/subgraph.cpp
+++ b/src/common/snippets/src/op/subgraph.cpp
@@ -99,7 +99,6 @@
#include "snippets/utils/debug_caps_config.hpp"
#include "snippets/utils/utils.hpp"
-using namespace std;
using namespace ov::op::util;
namespace ov::snippets::op {
@@ -221,7 +220,7 @@ Subgraph::Subgraph(const OutputVector& args, const std::shared_ptr<ov::Model>& b
std::shared_ptr<Node> Subgraph::clone_with_new_inputs(const OutputVector& inputs) const {
INTERNAL_OP_SCOPE(Subgraph);
- return make_shared<Subgraph>(inputs, body().clone());
+ return std::make_shared<Subgraph>(inputs, body().clone());
}
void Subgraph::validate_and_infer_types() {
@@ -427,7 +426,7 @@ std::shared_ptr<Subgraph> Subgraph::clone() const {
auto result = std::make_shared<snippets::op::Subgraph>(subgraph_node_inputs, new_body);
// Note: ov::copy_runtime_info accepts only shared_ptr<ov::Node> as "from" but never modifies it,
// so we have to cast away constness to copy runtime info
- ov::copy_runtime_info(const_pointer_cast<Node>(shared_from_this()), result);
+ ov::copy_runtime_info(std::const_pointer_cast<Node>(shared_from_this()), result);
result->set_friendly_name(get_friendly_name());
if (m_linear_ir) {
result->m_linear_ir = lowered::LinearIRBuilder().clone(m_linear_ir);
diff --git a/src/plugins/intel_cpu/src/transformations/snippets/x64/op/load_convert.cpp b/src/plugins/intel_cpu/src/transformations/snippets/x64/op/load_convert.cpp
index 7553872f6ae..aa0fbac248e 100644
--- a/src/plugins/intel_cpu/src/transformations/snippets/x64/op/load_convert.cpp
+++ b/src/plugins/intel_cpu/src/transformations/snippets/x64/op/load_convert.cpp
@@ -16,7 +16,6 @@
#include "snippets/op/load.hpp"
#include "snippets/op/memory_access.hpp"
-using namespace std;
using namespace ov;
intel_cpu::LoadConvertSaturation::LoadConvertSaturation(const Output<Node>& x,
diff --git a/src/plugins/intel_cpu/src/transformations/snippets/x64/op/store_convert.cpp b/src/plugins/intel_cpu/src/transformations/snippets/x64/op/store_convert.cpp
index e490de17eae..09352c62605 100644
--- a/src/plugins/intel_cpu/src/transformations/snippets/x64/op/store_convert.cpp
+++ b/src/plugins/intel_cpu/src/transformations/snippets/x64/op/store_convert.cpp
@@ -16,7 +16,6 @@
#include "snippets/op/memory_access.hpp"
#include "snippets/op/store.hpp"
-using namespace std;
using namespace ov;
intel_cpu::StoreConvertSaturation::StoreConvertSaturation(const Output<Node>& x,
diff --git a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/x64/paged_attn.cpp b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/x64/paged_attn.cpp
index d57269658e0..85783da0749 100644
--- a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/x64/paged_attn.cpp
+++ b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/x64/paged_attn.cpp
@@ -33,7 +33,6 @@
using namespace ov::test;
using namespace CPUTestUtils;
using namespace ov::op;
-using namespace std;
namespace ov {
namespace test {
diff --git a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/x64/paged_attn_score.cpp b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/x64/paged_attn_score.cpp
index d11b75a19f4..a97d012bc6a 100644
--- a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/x64/paged_attn_score.cpp
+++ b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/x64/paged_attn_score.cpp
@@ -43,7 +43,6 @@
using namespace ov::test;
using namespace CPUTestUtils;
using namespace ov::op;
-using namespace std;
namespace ov {
namespace test {
diff --git a/src/plugins/intel_cpu/tests/unit/shape_inference_test/embedding_segments_sum_test.cpp b/src/plugins/intel_cpu/tests/unit/shape_inference_test/embedding_segments_sum_test.cpp
index 07bd76a2833..af8e69e8e42 100644
--- a/src/plugins/intel_cpu/tests/unit/shape_inference_test/embedding_segments_sum_test.cpp
+++ b/src/plugins/intel_cpu/tests/unit/shape_inference_test/embedding_segments_sum_test.cpp
@@ -11,7 +11,6 @@ using namespace ov;
using namespace ov::intel_cpu;
using namespace ov::opset10;
using namespace testing;
-using namespace std;
class EmbeddingSegmentsSumV3StaticShapeInferenceTest : public OpStaticShapeInferenceTest<op::v3::EmbeddingSegmentsSum> {
protected:
@@ -33,12 +32,12 @@ TEST_F(EmbeddingSegmentsSumV3StaticShapeInferenceTest, default_ctor) {
}
TEST_F(EmbeddingSegmentsSumV3StaticShapeInferenceTest, constant_input) {
- auto emb_table = make_shared<op::v0::Parameter>(element::f32, ov::PartialShape{-1, -1});
- auto indices = make_shared<op::v0::Parameter>(element::i64, ov::PartialShape{-1});
- auto segment_ids = make_shared<op::v0::Parameter>(element::i64, ov::PartialShape{-1});
+ auto emb_table = std::make_shared<op::v0::Parameter>(element::f32, ov::PartialShape{-1, -1});
+ auto indices = std::make_shared<op::v0::Parameter>(element::i64, ov::PartialShape{-1});
+ auto segment_ids = std::make_shared<op::v0::Parameter>(element::i64, ov::PartialShape{-1});
auto num_segments = op::v0::Constant::create(element::i64, ov::Shape{}, {3});
- auto default_index = make_shared<op::v0::Parameter>(element::i64, ov::PartialShape{});
- auto per_sample_weights = make_shared<op::v0::Parameter>(element::f32, ov::PartialShape{-1});
+ auto default_index = std::make_shared<op::v0::Parameter>(element::i64, ov::PartialShape{});
+ auto per_sample_weights = std::make_shared<op::v0::Parameter>(element::f32, ov::PartialShape{-1});
auto op = make_op(emb_table, indices, segment_ids, num_segments, default_index, per_sample_weights);
input_shapes = {StaticShape{5, 2, 6}, StaticShape{4}, StaticShape{4}, StaticShape{}, StaticShape{}, StaticShape{4}},
@@ -47,12 +46,12 @@ TEST_F(EmbeddingSegmentsSumV3StaticShapeInferenceTest, constant_input) {
}
TEST_F(EmbeddingSegmentsSumV3StaticShapeInferenceTest, constant_map) {
- auto emb_table = make_shared<op::v0::Parameter>(element::f32, ov::PartialShape{-1, -1});
- auto indices = make_shared<op::v0::Parameter>(element::i64, ov::PartialShape{-1});
- auto segment_ids = make_shared<op::v0::Parameter>(element::i64, ov::PartialShape{-1});
- auto num_segments = make_shared<op::v0::Parameter>(element::i64, ov::PartialShape{});
- auto default_index = make_shared<op::v0::Parameter>(element::i64, ov::PartialShape{});
- auto per_sample_weights = make_shared<op::v0::Parameter>(element::f32, ov::PartialShape{-1});
+ auto emb_table = std::make_shared<op::v0::Parameter>(element::f32, ov::PartialShape{-1, -1});
+ auto indices = std::make_shared<op::v0::Parameter>(element::i64, ov::PartialShape{-1});
+ auto segment_ids = std::make_shared<op::v0::Parameter>(element::i64, ov::PartialShape{-1});
+ auto num_segments = std::make_shared<op::v0::Parameter>(element::i64, ov::PartialShape{});
+ auto default_index = std::make_shared<op::v0::Parameter>(element::i64, ov::PartialShape{});
+ auto per_sample_weights = std::make_shared<op::v0::Parameter>(element::f32, ov::PartialShape{-1});
auto op = make_op(emb_table, indices, segment_ids, num_segments, default_index, per_sample_weights);
input_shapes = {StaticShape{5, 2, 6}, StaticShape{4}, StaticShape{4}, StaticShape{}, StaticShape{}, StaticShape{4}};
@@ -65,12 +64,12 @@ TEST_F(EmbeddingSegmentsSumV3StaticShapeInferenceTest, constant_map) {
}
TEST_F(EmbeddingSegmentsSumV3StaticShapeInferenceTest, basic) {
- auto emb_table = make_shared<op::v0::Parameter>(element::f32, ov::PartialShape{-1, -1});
- auto indices = make_shared<op::v0::Parameter>(element::i64, ov::PartialShape{-1});
- auto segment_ids = make_shared<op::v0::Parameter>(element::i64, ov::PartialShape{-1});
+ auto emb_table = std::make_shared<op::v0::Parameter>(element::f32, ov::PartialShape{-1, -1});
+ auto indices = std::make_shared<op::v0::Parameter>(element::i64, ov::PartialShape{-1});
+ auto segment_ids = std::make_shared<op::v0::Parameter>(element::i64, ov::PartialShape{-1});
auto num_segments = op::v0::Constant::create(element::i64, ov::Shape{}, {3});
- auto default_index = make_shared<op::v0::Parameter>(element::i64, ov::PartialShape{});
- auto per_sample_weights = make_shared<op::v0::Parameter>(element::f32, ov::PartialShape{-1});
+ auto default_index = std::make_shared<op::v0::Parameter>(element::i64, ov::PartialShape{});
+ auto per_sample_weights = std::make_shared<op::v0::Parameter>(element::f32, ov::PartialShape{-1});
auto op = make_op(emb_table, indices, segment_ids, num_segments, default_index, per_sample_weights);