Skip to content

Commit 72d410b

Browse files
committed
Fixed compilation with C++20 on Windows
1 parent ef14b50 commit 72d410b

File tree

8 files changed

+40
-19
lines changed

8 files changed

+40
-19
lines changed

.github/workflows/linux_arm64.yml

-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ jobs:
149149
-DENABLE_NCC_STYLE=OFF \
150150
-DENABLE_TESTS=ON \
151151
-DENABLE_STRICT_DEPENDENCIES=OFF \
152-
-DENABLE_SYSTEM_TBB=OFF \
153152
-DENABLE_SYSTEM_OPENCL=ON \
154153
-DCMAKE_VERBOSE_MAKEFILE=ON \
155154
-DCPACK_GENERATOR=TGZ \

.github/workflows/linux_conditional_compilation.yml

+1
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ jobs:
143143
cmake \
144144
-G "${{ env.CMAKE_GENERATOR }}" \
145145
-DBUILD_SHARED_LIBS=OFF \
146+
-DCMAKE_CXX_STANDARD=20 \
146147
-DENABLE_TESTS=ON \
147148
-DENABLE_CPPLINT=OFF \
148149
-DENABLE_NCC_STYLE=OFF \

.github/workflows/windows_conditional_compilation.yml

+9-8
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ on:
44
schedule:
55
# run daily at 00:00
66
- cron: '0 0 * * *'
7-
# pull_request:
8-
# paths-ignore:
9-
# - '**/docs/**'
10-
# - 'docs/**'
11-
# - '**/**.md'
12-
# - '**.md'
13-
# - '**/layer_tests_summary/**'
14-
# - '**/conformance/**'
7+
pull_request:
8+
paths-ignore:
9+
- '**/docs/**'
10+
- 'docs/**'
11+
- '**/**.md'
12+
- '**.md'
13+
- '**/layer_tests_summary/**'
14+
- '**/conformance/**'
1515
push:
1616
paths-ignore:
1717
- '**/docs/**'
@@ -118,6 +118,7 @@ jobs:
118118
run: |
119119
cmake -G "${{ env.CMAKE_GENERATOR }}" `
120120
-DBUILD_SHARED_LIBS=OFF `
121+
-DCMAKE_CXX_STANDARD=20 `
121122
-DENABLE_TESTS=ON `
122123
-DENABLE_CPPLINT=OFF `
123124
-DENABLE_NCC_STYLE=OFF `

cmake/features.cmake

+6-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,12 @@ endif()
165165
if(DEFINED ENV{TBBROOT} OR DEFINED ENV{TBB_DIR} OR DEFINED TBB_DIR OR DEFINED TBBROOT)
166166
set(ENABLE_SYSTEM_TBB_DEFAULT OFF)
167167
else()
168-
set(ENABLE_SYSTEM_TBB_DEFAULT ${ENABLE_SYSTEM_LIBS_DEFAULT})
168+
if(LINUX AND ARM64)
169+
# CVS-126984: system TBB is not very stable on Linux ARM64 (at least on Ubuntu 20.04)
170+
set(ENABLE_SYSTEM_TBB_DEFAULT OFF)
171+
else()
172+
set(ENABLE_SYSTEM_TBB_DEFAULT ${ENABLE_SYSTEM_LIBS_DEFAULT})
173+
endif()
169174
endif()
170175

171176
ov_dependent_option (ENABLE_SYSTEM_TBB "Enables use of system TBB" ${ENABLE_SYSTEM_TBB_DEFAULT}

src/common/transformations/include/transformations/rt_info/nms_selected_indices.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ TRANSFORMATIONS_API bool has_nms_selected_indices(const Node* node);
2121

2222
TRANSFORMATIONS_API void set_nms_selected_indices(Node* node);
2323

24-
class TRANSFORMATIONS_API NmsSelectedIndices : ov::RuntimeAttribute {
24+
class TRANSFORMATIONS_API NmsSelectedIndices : public ov::RuntimeAttribute {
2525
public:
2626
OPENVINO_RTTI("nms_selected_indices", "0");
2727
NmsSelectedIndices() = default;

src/plugins/intel_cpu/src/graph.cpp

+21-6
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,17 @@ class UpdateNodesSeq : public IUpdateNodes {
10381038
#endif
10391039

10401040
#if (OV_THREAD == OV_THREAD_TBB || OV_THREAD == OV_THREAD_TBB_AUTO || OV_THREAD == OV_THREAD_OMP)
1041+
1042+
#if __cplusplus >= 202002L
1043+
#define ov_memory_order_release std::memory_order_release
1044+
#define ov_memory_order_relaxed std::memory_order_relaxed
1045+
#define ov_memory_order_acquire std::memory_order_acquire
1046+
#else
1047+
#define ov_memory_order_release std::memory_order::memory_order_release
1048+
#define ov_memory_order_relaxed std::memory_order::memory_order_relaxed
1049+
#define ov_memory_order_acquire std::memory_order::memory_order_acquire
1050+
#endif
1051+
10411052
class UpdateNodesBase : public IUpdateNodes {
10421053
public:
10431054
explicit UpdateNodesBase(std::vector<NodePtr>& executableGraphNodes) : m_executableGraphNodes(executableGraphNodes) {}
@@ -1048,22 +1059,22 @@ class UpdateNodesBase : public IUpdateNodes {
10481059
if (node->isDynamicNode()) {
10491060
node->updateShapes();
10501061
}
1051-
m_prepareCounter.store(i, std::memory_order::memory_order_release);
1062+
m_prepareCounter.store(i, ov_memory_order_release);
10521063
}
10531064
}
10541065
catch(...) {
1055-
m_completion.store(true, std::memory_order::memory_order_relaxed);
1066+
m_completion.store(true, ov_memory_order_relaxed);
10561067
throw;
10571068
}
1058-
m_prepareCounter.store(stop_indx, std::memory_order::memory_order_relaxed);
1059-
m_completion.store(true, std::memory_order::memory_order_release);
1069+
m_prepareCounter.store(stop_indx, ov_memory_order_relaxed);
1070+
m_completion.store(true, ov_memory_order_release);
10601071
}
10611072

10621073
void updateDynParams(size_t node_indx, size_t /*unused*/) {
10631074
size_t local_counter = node_indx;
10641075
while (true) {
1065-
const bool completion = m_completion.load(std::memory_order::memory_order_acquire);
1066-
const size_t prepareCounter = m_prepareCounter.load(std::memory_order::memory_order_relaxed);
1076+
const bool completion = m_completion.load(ov_memory_order_acquire);
1077+
const size_t prepareCounter = m_prepareCounter.load(ov_memory_order_relaxed);
10671078
if (completion && local_counter == prepareCounter) {
10681079
break;
10691080
}
@@ -1082,6 +1093,10 @@ class UpdateNodesBase : public IUpdateNodes {
10821093
std::vector<NodePtr>& m_executableGraphNodes;
10831094
};
10841095

1096+
#undef ov_memory_order_release
1097+
#undef ov_memory_order_relaxed
1098+
#undef ov_memory_order_acquire
1099+
10851100
#if (OV_THREAD == OV_THREAD_TBB || OV_THREAD == OV_THREAD_TBB_AUTO)
10861101
#if (TBB_VERSION_MAJOR > 2020)
10871102
template <typename Body>

src/plugins/intel_gpu/src/graph/graph_optimizer/reorder_inputs.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ void reorder_inputs::run(program& p, layout_optimizer& lo, reorder_factory& rf)
689689
p.get_processing_order().begin(),
690690
p.get_processing_order().end(),
691691
reorder_cnt{ 0, 0 },
692-
[&](reorder_cnt& total, program_node* node) {
692+
[&](const reorder_cnt& total, program_node* node) {
693693
if (fmt_map.count(node) == 0 || fmt_map.at(node) == format::any)
694694
return total;
695695
auto count = count_reorders(fmt_map, lo, node);

0 commit comments

Comments
 (0)