Skip to content

Commit 9968af6

Browse files
authored
[CPU] Fix modernize-concat-nested-namespaces clang-tidy remarks (openvinotoolkit#28869)
### Details: - Fix "modernize-concat-nested-namespaces" issues reported by clang-tidy - Enable "modernize-concat-nested-namespaces" clang-tidy checks on CI by default ### Tickets: - N/A
1 parent a6cdc76 commit 9968af6

File tree

616 files changed

+1272
-3062
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

616 files changed

+1272
-3062
lines changed

src/plugins/intel_cpu/src/.clang-tidy

-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
# -readability-implicit-bool-conversion,
3232
# -readability-magic-numbers, cppcoreguidelines-avoid-magic-numbers
3333
# -readability-function-cognitive-complexity. Reasonable way to enforce splitting complex code into simple functions
34-
# -modernize-concat-nested-namespaces. More compact way when C++17 is available
3534

3635
Checks: >
3736
-*,
@@ -58,7 +57,6 @@ Checks: >
5857
-cppcoreguidelines-avoid-magic-numbers,
5958
-readability-uppercase-literal-suffix,
6059
-readability-function-cognitive-complexity,
61-
-modernize-concat-nested-namespaces,
6260
# Treat warnings as errors
6361
WarningsAsErrors: '*'
6462
# Use clang-format for applied fixes

src/plugins/intel_cpu/src/allocation_context.hpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
#include <unordered_map>
99
#include <vector>
1010

11-
namespace ov {
12-
namespace intel_cpu {
11+
namespace ov::intel_cpu {
1312

1413
class Node;
1514
class Edge;
@@ -22,5 +21,4 @@ struct AllocationContext {
2221
std::vector<size_t> syncPoints;
2322
};
2423

25-
} // namespace intel_cpu
26-
} // namespace ov
24+
} // namespace ov::intel_cpu

src/plugins/intel_cpu/src/cache/multi_cache.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44

55
#include "multi_cache.h"
66

7-
namespace ov {
8-
namespace intel_cpu {
7+
namespace ov::intel_cpu {
98

109
std::atomic_size_t MultiCache::_typeIdCounter{0};
1110

12-
} // namespace intel_cpu
13-
} // namespace ov
11+
} // namespace ov::intel_cpu

src/plugins/intel_cpu/src/compiled_model.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434

3535
using namespace ov::threading;
3636

37-
namespace ov {
38-
namespace intel_cpu {
37+
namespace ov::intel_cpu {
3938

4039
struct ImmediateSerialExecutor : public ov::threading::ITaskExecutor {
4140
void run(ov::threading::Task task) override {
@@ -362,5 +361,4 @@ void CompiledModel::release_memory() {
362361
}
363362
}
364363

365-
} // namespace intel_cpu
366-
} // namespace ov
364+
} // namespace ov::intel_cpu

src/plugins/intel_cpu/src/config.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
#include "utils/debug_capabilities.h"
1919
#include "utils/precision_support.h"
2020

21-
namespace ov {
22-
namespace intel_cpu {
21+
namespace ov::intel_cpu {
2322

2423
using namespace ov::threading;
2524
using namespace dnnl::impl::cpu::x64;
@@ -509,5 +508,4 @@ void Config::applyRtInfo(const std::shared_ptr<const ov::Model>& model) {
509508
}
510509
}
511510

512-
} // namespace intel_cpu
513-
} // namespace ov
511+
} // namespace ov::intel_cpu

src/plugins/intel_cpu/src/cpu_map_scheduling.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
#include "openvino/runtime/system_conf.hpp"
1010
#include "openvino/runtime/threading/cpu_streams_info.hpp"
1111

12-
namespace ov {
13-
namespace intel_cpu {
12+
namespace ov::intel_cpu {
1413

1514
std::vector<std::vector<int>> apply_scheduling_core_type(ov::hint::SchedulingCoreType& input_type,
1615
const std::vector<std::vector<int>>& proc_type_table) {
@@ -106,5 +105,4 @@ bool get_cpu_pinning(bool& input_value,
106105
return result_value;
107106
}
108107

109-
} // namespace intel_cpu
110-
} // namespace ov
108+
} // namespace ov::intel_cpu

src/plugins/intel_cpu/src/cpu_map_scheduling.hpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
#include "openvino/runtime/properties.hpp"
1616
#include "openvino/runtime/threading/istreams_executor.hpp"
1717

18-
namespace ov {
19-
namespace intel_cpu {
18+
namespace ov::intel_cpu {
2019

2120
/**
2221
* @brief Limit available CPU resource in processors type table according to scheduling core type property
@@ -55,5 +54,4 @@ bool get_cpu_pinning(bool& input_value,
5554
const std::vector<std::vector<int>>& proc_type_table,
5655
const std::vector<std::vector<int>>& streams_info_table);
5756

58-
} // namespace intel_cpu
59-
} // namespace ov
57+
} // namespace ov::intel_cpu

src/plugins/intel_cpu/src/cpu_memory.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
# include <utility>
1919
#endif
2020

21-
namespace ov {
22-
namespace intel_cpu {
21+
namespace ov::intel_cpu {
2322
template <>
2423
DnnlMemoryDescPtr IMemory::getDescWithType<DnnlMemoryDesc, 0, 0>() const {
2524
return MemoryDescUtils::convertToDnnlMemoryDesc(getDescPtr());
@@ -729,5 +728,4 @@ MemoryPtr split_vertical(const dnnl::engine& eng,
729728
return ptr;
730729
}
731730

732-
} // namespace intel_cpu
733-
} // namespace ov
731+
} // namespace ov::intel_cpu

src/plugins/intel_cpu/src/cpu_shape.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66

77
#include "utils/general_utils.h"
88

9-
namespace ov {
10-
namespace intel_cpu {
9+
namespace ov::intel_cpu {
1110

1211
bool Shape::isCompatible(const VectorDims& vecDims) const {
1312
if (getRank() != vecDims.size()) {
@@ -77,5 +76,4 @@ Shape mergeShapes(const Shape& lhs, const Shape& rhs) {
7776
return Shape{resultMinDims, resultMaxDims};
7877
}
7978

80-
} // namespace intel_cpu
81-
} // namespace ov
79+
} // namespace ov::intel_cpu

src/plugins/intel_cpu/src/cpu_streams_calculation.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ using namespace ov::threading;
2727
#define INIT_VAL -100
2828
#define TP_CPU_LIMIT 32
2929

30-
namespace ov {
31-
namespace intel_cpu {
30+
namespace ov::intel_cpu {
3231

3332
void sort_table_by_numa_node_id(const int current_numa_node, std::vector<std::vector<int>>& proc_type_table) {
3433
if (proc_type_table.size() > 1) {
@@ -761,5 +760,4 @@ void get_num_streams(const int streams, const std::shared_ptr<ov::Model>& model,
761760
}
762761
}
763762

764-
} // namespace intel_cpu
765-
} // namespace ov
763+
} // namespace ov::intel_cpu

src/plugins/intel_cpu/src/cpu_streams_calculation.hpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
#include "graph.h"
1717
#include "openvino/runtime/properties.hpp"
1818

19-
namespace ov {
20-
namespace intel_cpu {
19+
namespace ov::intel_cpu {
2120
/**
2221
* @brief Generate streams information table according to processors type table.
2322
* @param[in] input_streams is the targeted number of streams set by user via ov::num_streams or the default value.
@@ -114,5 +113,4 @@ void get_num_streams(const int streams, const std::shared_ptr<ov::Model>& model,
114113
*/
115114
void sort_table_by_numa_node_id(const int current_numa_node, std::vector<std::vector<int>>& proc_type_table);
116115

117-
} // namespace intel_cpu
118-
} // namespace ov
116+
} // namespace ov::intel_cpu

src/plugins/intel_cpu/src/cpu_tensor.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
#include "utils/debug_capabilities.h"
1111
#include "utils/general_utils.h"
1212

13-
namespace ov {
14-
namespace intel_cpu {
13+
namespace ov::intel_cpu {
1514

1615
Tensor::Tensor(MemoryPtr memptr) : m_memptr{std::move(memptr)} {
1716
OPENVINO_ASSERT(m_memptr != nullptr);
@@ -106,5 +105,4 @@ std::shared_ptr<ITensor> make_tensor(MemoryPtr mem) {
106105
return std::make_shared<Tensor>(std::move(mem));
107106
}
108107

109-
} // namespace intel_cpu
110-
} // namespace ov
108+
} // namespace ov::intel_cpu

src/plugins/intel_cpu/src/cpu_types.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88

99
#include "cpu_shape.h"
1010

11-
namespace ov {
12-
namespace intel_cpu {
11+
namespace ov::intel_cpu {
1312

1413
std::string dim2str(Dim dim) {
1514
return dim == Shape::UNDEFINED_DIM ? "?" : std::to_string(dim);
@@ -530,5 +529,4 @@ std::string algToString(const Algorithm alg) {
530529
return "Undefined";
531530
}
532531

533-
} // namespace intel_cpu
534-
} // namespace ov
532+
} // namespace ov::intel_cpu

src/plugins/intel_cpu/src/dnnl_extension_utils.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616

1717
using namespace dnnl;
1818

19-
namespace ov {
20-
namespace intel_cpu {
19+
namespace ov::intel_cpu {
2120

2221
uint8_t DnnlExtensionUtils::sizeOfDataType(dnnl::memory::data_type dataType) {
2322
switch (dataType) {
@@ -295,5 +294,4 @@ std::string DnnlExtensionUtils::computeWeightsStringHash(const std::shared_ptr<c
295294
return std::to_string(desc_hash) + "_" + std::to_string(reinterpret_cast<uint64_t>(memory->getData()));
296295
}
297296

298-
} // namespace intel_cpu
299-
} // namespace ov
297+
} // namespace ov::intel_cpu

src/plugins/intel_cpu/src/dnnl_postops_composer.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
#include "utils/cpu_utils.hpp"
2020
#include "utils/debug_capabilities.h"
2121

22-
namespace ov {
23-
namespace intel_cpu {
22+
namespace ov::intel_cpu {
2423

2524
DnnlPostOpsComposer::DnnlPostOpsComposer(const PostOps& postOps,
2625
const dnnl::engine& engine,
@@ -802,5 +801,4 @@ DnnlPrimitiveAttrs DnnlPostOpsComposer::compose() {
802801
return {attr, dnnlArgs, cpuArgs};
803802
}
804803

805-
} // namespace intel_cpu
806-
} // namespace ov
804+
} // namespace ov::intel_cpu

src/plugins/intel_cpu/src/dnnl_postops_composer_legacy.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010

1111
#include "utils/debug_capabilities.h"
1212

13-
namespace ov {
14-
namespace intel_cpu {
13+
namespace ov::intel_cpu {
1514

1615
DnnlPostOpsComposerLegacy::DnnlPostOpsComposerLegacy(const dnnl::engine& engine,
1716
dnnl::primitive_attr& attr,
@@ -268,5 +267,4 @@ void DnnlPostOpsComposerLegacy::appendClip(const std::vector<float>& low, const
268267
}
269268
}
270269

271-
} // namespace intel_cpu
272-
} // namespace ov
270+
} // namespace ov::intel_cpu

src/plugins/intel_cpu/src/edge.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#include "openvino/util/pp.hpp"
1111

1212
using namespace dnnl;
13-
namespace ov {
14-
namespace intel_cpu {
13+
14+
namespace ov::intel_cpu {
1515

1616
Edge::Edge(const NodePtr& parent, const NodePtr& child, int pr_port, int ch_port)
1717
: parent(parent),
@@ -668,5 +668,4 @@ std::ostream& operator<<(std::ostream& os, const Edge& edge) {
668668
<< ":" << Edge::statusToString(edge.getStatus());
669669
}
670670

671-
} // namespace intel_cpu
672-
} // namespace ov
671+
} // namespace ov::intel_cpu

src/plugins/intel_cpu/src/emitters/plugin/aarch64/jit_conversion_emitters.cpp

+2-6
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
using namespace dnnl::impl::cpu::aarch64;
1010
using namespace Xbyak_aarch64;
1111

12-
namespace ov {
13-
namespace intel_cpu {
14-
namespace aarch64 {
12+
namespace ov::intel_cpu::aarch64 {
1513

1614
// In aarch64, conversion between f16 and i16/u16 can be done with single instruction. The supported
1715
// conversion precicions are f32, i32, f16, i8 (byte), u8 (byte). If we introduce an intermediate
@@ -274,6 +272,4 @@ void jit_convert_saturation_emitter::emit_isa(const std::vector<size_t>& in_idxs
274272
jit_convert_process<TReg>(src, dst, input_type, output_type, true);
275273
}
276274

277-
} // namespace aarch64
278-
} // namespace intel_cpu
279-
} // namespace ov
275+
} // namespace ov::intel_cpu::aarch64

src/plugins/intel_cpu/src/emitters/plugin/aarch64/jit_conversion_emitters.hpp

+2-6
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66

77
#include "jit_emitter.hpp"
88

9-
namespace ov {
10-
namespace intel_cpu {
11-
namespace aarch64 {
9+
namespace ov::intel_cpu::aarch64 {
1210

1311
class jit_convert_emitter : public jit_emitter {
1412
public:
@@ -89,6 +87,4 @@ class jit_convert_saturation_emitter : public jit_convert_emitter {
8987
void emit_isa(const std::vector<size_t>& in_idxs, const std::vector<size_t>& out_idxs) const;
9088
};
9189

92-
} // namespace aarch64
93-
} // namespace intel_cpu
94-
} // namespace ov
90+
} // namespace ov::intel_cpu::aarch64

src/plugins/intel_cpu/src/emitters/plugin/aarch64/jit_eltwise_emitters.cpp

+2-6
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
#include "openvino/core/type/element_type.hpp"
1212
#include "transformations/cpu_opset/common/op/swish_cpu.hpp"
1313

14-
namespace ov {
15-
namespace intel_cpu {
16-
namespace aarch64 {
14+
namespace ov::intel_cpu::aarch64 {
1715

1816
using namespace dnnl::impl::utils;
1917
using namespace dnnl::impl::cpu;
@@ -2905,6 +2903,4 @@ std::set<std::vector<element::Type>> jit_tanh_emitter::get_supported_precisions(
29052903
return {{element::f32}};
29062904
}
29072905

2908-
} // namespace aarch64
2909-
} // namespace intel_cpu
2910-
} // namespace ov
2906+
} // namespace ov::intel_cpu::aarch64

src/plugins/intel_cpu/src/emitters/plugin/aarch64/jit_eltwise_emitters.hpp

+2-6
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66

77
#include "jit_emitter.hpp"
88

9-
namespace ov {
10-
namespace intel_cpu {
11-
namespace aarch64 {
9+
namespace ov::intel_cpu::aarch64 {
1210

1311
class jit_abs_emitter : public jit_emitter {
1412
public:
@@ -1194,6 +1192,4 @@ class jit_tanh_emitter : public jit_emitter {
11941192
void emit_isa(const std::vector<size_t>& in_vec_idxs, const std::vector<size_t>& out_vec_idxs) const;
11951193
};
11961194

1197-
} // namespace aarch64
1198-
} // namespace intel_cpu
1199-
} // namespace ov
1195+
} // namespace ov::intel_cpu::aarch64

src/plugins/intel_cpu/src/emitters/plugin/aarch64/jit_emitter.cpp

+2-6
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
using namespace dnnl::impl::cpu;
1313
using namespace dnnl::impl;
1414

15-
namespace ov {
16-
namespace intel_cpu {
17-
namespace aarch64 {
15+
namespace ov::intel_cpu::aarch64 {
1816

1917
const std::vector<size_t> jit_emitter::store_gpr_regs = {
2018
// Parameter/result registers
@@ -338,6 +336,4 @@ void jit_emitter::restore_context(const std::vector<size_t>& gpr_regs,
338336
}
339337
}
340338

341-
} // namespace aarch64
342-
} // namespace intel_cpu
343-
} // namespace ov
339+
} // namespace ov::intel_cpu::aarch64

src/plugins/intel_cpu/src/emitters/plugin/aarch64/jit_emitter.hpp

+2-6
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
#include "snippets/generator.hpp"
1313
#include "snippets/snippets_isa.hpp"
1414

15-
namespace ov {
16-
namespace intel_cpu {
17-
namespace aarch64 {
15+
namespace ov::intel_cpu::aarch64 {
1816

1917
enum emitter_in_out_map {
2018
vec_to_vec,
@@ -186,6 +184,4 @@ class jit_emitter : public ov::snippets::Emitter {
186184
const std::unordered_set<size_t>& ignore_vec_regs = {}) const;
187185
};
188186

189-
} // namespace aarch64
190-
} // namespace intel_cpu
191-
} // namespace ov
187+
} // namespace ov::intel_cpu::aarch64

0 commit comments

Comments
 (0)