Skip to content

Commit c121e89

Browse files
Intel compiler support (openvinotoolkit#24217)
### Details: - Initial version of Intel compiler support - Only Linux is covered - Current PR is a prerequisite for openvinotoolkit#23534
1 parent 3b0d201 commit c121e89

File tree

62 files changed

+170
-113
lines changed

Some content is hidden

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

62 files changed

+170
-113
lines changed

.github/workflows/code_snippets.yml

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ jobs:
3636
packages: ocl-icd-opencl-dev opencl-headers
3737
version: 3.0
3838

39+
- name: Install scons
40+
if: runner.os == 'macOS'
41+
run: brew install scons
42+
3943
- name: CMake configure
4044
run: cmake -DCMAKE_BUILD_TYPE=Release -DTHREADING=SEQ -B build
4145

cmake/dependencies.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ function(ov_download_tbb)
158158
update_deps_cache(TBB_DIR "${TBBROOT}/lib/cmake/TBB" "Path to TBB cmake folder")
159159
elseif(EXISTS "${TBBROOT}/lib/cmake/tbb/TBBConfig.cmake")
160160
# oneTBB release package version less than 2021.6.0
161+
# or TBB from oneAPI package
161162
update_deps_cache(TBB_DIR "${TBBROOT}/lib/cmake/tbb" "Path to TBB cmake folder")
162163
elseif(EXISTS "${TBBROOT}/lib64/cmake/TBB/TBBConfig.cmake")
163164
# 64-bits oneTBB case

cmake/developer_package/compile_flags/os_flags.cmake

+23-24
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ macro(ov_disable_deprecated_warnings)
2020
else()
2121
set(ov_c_cxx_deprecated "-diag-disable=1478,1786")
2222
endif()
23-
elseif(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX)
23+
elseif(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_INTEL_LLVM)
2424
set(ov_c_cxx_deprecated "-Wno-deprecated-declarations")
2525
else()
2626
message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")
@@ -48,7 +48,7 @@ macro(ov_deprecated_no_errors)
4848
else()
4949
set(ov_c_cxx_deprecated_no_errors "-diag-warning=1478,1786")
5050
endif()
51-
elseif(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX)
51+
elseif(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_INTEL_LLVM)
5252
set(ov_c_cxx_deprecated_no_errors "-Wno-error=deprecated-declarations")
5353
# Suppress #warning messages
5454
set(ov_c_cxx_deprecated_no_errors "${ov_c_cxx_deprecated_no_errors} -Wno-cpp")
@@ -68,7 +68,7 @@ endmacro()
6868
# Exports flags for 3rdparty modules, but without errors
6969
#
7070
macro(ov_dev_package_no_errors)
71-
if(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX)
71+
if(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_INTEL_LLVM)
7272
set(ov_c_cxx_dev_no_errors "-Wno-all")
7373
if(SUGGEST_OVERRIDE_SUPPORTED)
7474
set(ov_cxx_dev_no_errors "-Wno-error=suggest-override")
@@ -100,7 +100,7 @@ endmacro()
100100
macro(ov_sse42_optimization_flags flags)
101101
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
102102
# No such option for MSVC 2019
103-
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
103+
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel" OR OV_COMPILER_IS_INTEL_LLVM)
104104
if(WIN32)
105105
set(${flags} /QxSSE4.2)
106106
else()
@@ -130,7 +130,7 @@ macro(ov_avx2_optimization_flags flags)
130130
else()
131131
set(${flags} -xCORE-AVX2)
132132
endif()
133-
elseif(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX)
133+
elseif(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_INTEL_LLVM)
134134
set(${flags} -mavx2 -mfma -mf16c)
135135
else()
136136
message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")
@@ -152,7 +152,7 @@ macro(ov_avx512_optimization_flags flags)
152152
else()
153153
set(${flags} -xCOMMON-AVX512)
154154
endif()
155-
elseif(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX)
155+
elseif(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_INTEL_LLVM)
156156
set(${flags} -mavx512f -mavx512bw -mavx512vl -mfma -mf16c)
157157
else()
158158
message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")
@@ -200,7 +200,7 @@ function(ov_disable_all_warnings)
200200

201201
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
202202
target_compile_options(${target} PRIVATE /WX-)
203-
elseif(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG)
203+
elseif(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR OV_COMPILER_IS_INTEL_LLVM)
204204
target_compile_options(${target} PRIVATE -w)
205205
# required for LTO
206206
set(link_interface INTERFACE_LINK_OPTIONS)
@@ -239,7 +239,7 @@ endmacro()
239239
function(ov_force_include target scope header_file)
240240
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
241241
target_compile_options(${target} ${scope} /FI"${header_file}")
242-
elseif(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX)
242+
elseif(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_INTEL_LLVM)
243243
target_compile_options(${target} ${scope} -include "${header_file}")
244244
else()
245245
message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")
@@ -314,7 +314,7 @@ set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
314314
if(CMAKE_CL_64)
315315
# Default char Type Is unsigned
316316
# ov_add_compiler_flags(/J)
317-
elseif(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG)
317+
elseif(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR OV_COMPILER_IS_INTEL_LLVM)
318318
ov_add_compiler_flags(-fsigned-char)
319319
endif()
320320

@@ -449,21 +449,11 @@ else()
449449
# To guarantee OpenVINO can be used with gcc versions 7 through 12
450450
# - https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html
451451
# - https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html
452-
if(CMAKE_COMPILER_IS_GNUCXX)
453-
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "8")
454-
# Enable __FILE__ trim only for release mode
455-
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ffile-prefix-map=${OV_NATIVE_PROJECT_ROOT_DIR}/= -ffile-prefix-map=${OV_RELATIVE_BIN_PATH}/=")
456-
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffile-prefix-map=${OV_NATIVE_PROJECT_ROOT_DIR}/= -ffile-prefix-map=${OV_RELATIVE_BIN_PATH}/=")
457-
endif()
458-
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wabi=11")
459-
endif()
460-
461-
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
462-
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "10")
463-
# Enable __FILE__ trim only for release mode
464-
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ffile-prefix-map=${OV_NATIVE_PROJECT_ROOT_DIR}/= -ffile-prefix-map=${OV_RELATIVE_BIN_PATH}/=")
465-
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffile-prefix-map=${OV_NATIVE_PROJECT_ROOT_DIR}/= -ffile-prefix-map=${OV_RELATIVE_BIN_PATH}/=")
466-
endif()
452+
if((CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8) OR
453+
(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10) OR OV_COMPILER_IS_INTEL_LLVM)
454+
# Enable __FILE__ trim only for release mode
455+
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ffile-prefix-map=${OV_NATIVE_PROJECT_ROOT_DIR}/= -ffile-prefix-map=${OV_RELATIVE_BIN_PATH}/=")
456+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffile-prefix-map=${OV_NATIVE_PROJECT_ROOT_DIR}/= -ffile-prefix-map=${OV_RELATIVE_BIN_PATH}/=")
467457
endif()
468458

469459
#
@@ -483,6 +473,10 @@ else()
483473
ov_add_compiler_flags(-diag-disable=remark,177,2196)
484474
endif()
485475

476+
if(OV_COMPILER_IS_INTEL_LLVM)
477+
ov_add_compiler_flags(-Wno-tautological-constant-compare)
478+
endif()
479+
486480
#
487481
# Linker flags
488482
#
@@ -507,6 +501,11 @@ else()
507501
endif()
508502
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections")
509503
endif()
504+
505+
if(OV_COMPILER_IS_INTEL_LLVM)
506+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-intel")
507+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-intel")
508+
endif()
510509
endif()
511510

512511
add_compile_definitions(

cmake/developer_package/compile_flags/sdl.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33
#
44

5-
if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR
5+
if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR OV_COMPILER_IS_INTEL_LLVM OR
66
(UNIX AND CMAKE_CXX_COMPILER_ID STREQUAL "Intel"))
77
set(OV_C_CXX_FLAGS "${OV_C_CXX_FLAGS} -Wformat -Wformat-security")
88

@@ -32,7 +32,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR
3232
if(NOT MINGW)
3333
set(OV_LINKER_FLAGS "${OV_LINKER_FLAGS} -z noexecstack -z relro -z now")
3434
endif()
35-
elseif(OV_COMPILER_IS_CLANG)
35+
elseif(OV_COMPILER_IS_CLANG OR OV_COMPILER_IS_INTEL_LLVM)
3636
if(EMSCRIPTEN)
3737
# emcc does not support fortification
3838
# https://stackoverflow.com/questions/58854858/undefined-symbol-stack-chk-guard-in-libopenh264-so-when-building-ffmpeg-wit

cmake/developer_package/cross_compile/native_compile.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function(ov_native_compile_external_project)
6262
endif()
6363

6464
# compile flags
65-
if(CMAKE_COMPILER_IS_GNUCXX)
65+
if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR OV_COMPILER_IS_INTEL_LLVM)
6666
set(compile_flags "-Wno-undef -Wno-error -Wno-deprecated-declarations")
6767
endif()
6868

cmake/developer_package/frontends/frontends.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ macro(ov_add_frontend)
212212
endif()
213213

214214
# remove -Wmissing-declarations warning, because of frontends implementation specific
215-
if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG)
215+
if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR OV_COMPILER_IS_INTEL_LLVM)
216216
target_compile_options(${TARGET_NAME} PRIVATE -Wno-missing-declarations)
217217
endif()
218218

cmake/developer_package/target_flags.cmake

+4
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$")
111111
endif()
112112
endif()
113113

114+
if(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
115+
set(OV_COMPILER_IS_INTEL_LLVM ON)
116+
endif()
117+
114118
get_property(OV_GENERATOR_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
115119

116120
function(ov_get_compiler_definition definition var)

docs/snippets/CMakeLists.txt

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@
44

55
set(TARGET_NAME openvino_docs_snippets)
66

7-
if(CMAKE_COMPILER_IS_GNUCXX)
7+
if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR OV_COMPILER_IS_INTEL_LLVM)
88
ov_add_compiler_flags(-Wall)
9-
endif()
10-
11-
if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG)
129
ov_add_compiler_flags(-Wno-unused-variable)
1310
endif()
1411
if(UNUSED_BUT_SET_VARIABLE_SUPPORTED)

docs/snippets/template_pattern_transformation.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "openvino/opsets/opset3.hpp"
1111
#include "openvino/pass/manager.hpp"
1212
#include "openvino/pass/pattern/op/wrap_type.hpp"
13+
#include "transformations/utils/utils.hpp"
1314
#include "template_model_transformation.hpp"
1415

1516
// ! [graph_rewrite:template_transformation_cpp]
@@ -61,7 +62,7 @@ ov::pass::ReluReluFusionMatcher::ReluReluFusionMatcher() {
6162
auto m_relu1 = ov::pass::pattern::wrap_type<ov::opset3::Relu>(pattern::consumers_count(1));
6263
auto m_relu2 = ov::pass::pattern::wrap_type<ov::opset3::Relu>({m_relu1});
6364

64-
ov::matcher_pass_callback callback = [=](pattern::Matcher& m) {
65+
ov::matcher_pass_callback callback = [OV_CAPTURE_CPY_AND_THIS](pattern::Matcher& m) {
6566
// Map that helps to connect labels with matched outputs
6667
auto& node_to_output = m.get_pattern_value_map();
6768

src/bindings/python/src/pyopenvino/CMakeLists.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PYTHON_BRIDGE_OUTPUT_DIRECTORY})
2121
set(CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${PYTHON_BRIDGE_OUTPUT_DIRECTORY})
2222
set(CMAKE_PDB_OUTPUT_DIRECTORY ${PYTHON_BRIDGE_OUTPUT_DIRECTORY})
2323

24-
# compile options
24+
# compile and linker options
2525

2626
if(OV_COMPILER_IS_APPLECLANG)
2727
add_link_options(-stdlib=libc++)
28-
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
28+
elseif(CMAKE_COMPILER_IS_GNUCXX)
2929
# WA for GCC 7.5 "PYBIND11_NOINLINE inline" warning
30-
add_compile_options(-Wno-error=attributes)
30+
ov_add_compiler_flags(-Wno-error=attributes)
3131
endif()
3232

33-
if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG)
34-
# for proper fix need to update pybind to version which does not use PyEval_InitThreads()
35-
add_compile_options(-Wno-deprecated-declarations -Wno-undef)
33+
if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR OV_COMPILER_IS_INTEL_LLVM)
34+
# TODO: remove this deprecated API usage
35+
ov_add_compiler_flags(-Wno-error=deprecated-declarations)
3636
endif()
3737

3838
if(ENABLE_TESTS)

src/cmake/install_tbb.cmake

+21-4
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ if(THREADING MATCHES "^(TBB|TBB_AUTO)$" AND
139139
if(NOT DEFINED TBBROOT AND DEFINED ENV{TBBROOT})
140140
file(TO_CMAKE_PATH $ENV{TBBROOT} TBBROOT)
141141
endif()
142+
# sometimes TBBROOT can be set with relative paths inside (e.g. oneAPI package)
143+
get_filename_component(TBBROOT "${TBBROOT}" ABSOLUTE)
142144
if(NOT DEFINED TBBROOT)
143145
get_target_property(_tbb_include_dir TBB::tbb INTERFACE_INCLUDE_DIRECTORIES)
144146
get_filename_component(TBBROOT ${_tbb_include_dir} PATH)
@@ -163,6 +165,7 @@ if(THREADING MATCHES "^(TBB|TBB_AUTO)$" AND
163165
# try to select proper library directory
164166
_ov_get_tbb_location(TBB::tbb _tbb_lib_location)
165167
get_filename_component(_tbb_libs_dir "${_tbb_lib_location}" DIRECTORY)
168+
get_filename_component(_tbb_libs_dir "${_tbb_libs_dir}" REALPATH)
166169
file(RELATIVE_PATH tbb_libs_dir "${TBBROOT}" "${_tbb_libs_dir}")
167170

168171
# install only meaningful directories
@@ -176,10 +179,24 @@ if(THREADING MATCHES "^(TBB|TBB_AUTO)$" AND
176179
set(tbb_component tbb)
177180
set(exclude_pattern REGEX ".*(cmake|pkgconfig)$" EXCLUDE)
178181
endif()
179-
install(DIRECTORY "${TBBROOT}/${dir}/"
180-
DESTINATION "${IE_TBBROOT_INSTALL}/${dir}"
181-
COMPONENT ${tbb_component}
182-
${exclude_pattern})
182+
183+
if(tbb_libs_dir STREQUAL dir)
184+
file(GLOB _tbb_libs ${TBBROOT}/${tbb_libs_dir}/*)
185+
foreach(_tbb_lib IN LISTS _tbb_libs)
186+
if(_tbb_lib MATCHES ".*${CMAKE_SHARED_LIBRARY_SUFFIX}.*")
187+
# resolve absolute path to avoid issues with installation
188+
get_filename_component(_tbb_lib "${_tbb_lib}" REALPATH)
189+
install(PROGRAMS "${_tbb_lib}"
190+
DESTINATION "${IE_TBBROOT_INSTALL}/${dir}"
191+
COMPONENT ${tbb_component})
192+
endif()
193+
endforeach()
194+
else()
195+
install(DIRECTORY "${TBBROOT}/${dir}/"
196+
DESTINATION "${IE_TBBROOT_INSTALL}/${dir}"
197+
COMPONENT ${tbb_component}
198+
${exclude_pattern})
199+
endif()
183200
endif()
184201
endforeach()
185202

src/common/low_precision_transformations/src/assign_and_read_value.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ AssignAndReadValueTransformation::AssignAndReadValueTransformation(const std::sh
2323
auto assign3 = pattern::wrap_type<opset3::Assign>({ pattern::wrap_type<ov::opset1::Multiply>() });
2424
auto assign6 = pattern::wrap_type<opset6::Assign>({ pattern::wrap_type<ov::opset1::Multiply>() });
2525

26-
ov::graph_rewrite_callback callback = [=](pattern::Matcher& m) {
26+
ov::graph_rewrite_callback callback = [OV_CAPTURE_CPY_AND_THIS](pattern::Matcher& m) {
2727
const auto& opsMap = m.get_pattern_value_map();
2828
auto op = m.get_match_root();
2929
auto assignIt = opsMap.find(assign3);

src/common/low_precision_transformations/src/convert_subtract_constant.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ ov::pass::low_precision::ConvertSubtractConstant::ConvertSubtractConstant(const
4444
auto multiplyConstantWrapper = ov::pass::pattern::wrap_type<opset1::Constant>(pattern::consumers_count(1));
4545
auto multiplyWrapper = ov::pass::pattern::wrap_type<opset1::Multiply>({ subtractWrapper, multiplyConstantWrapper }, pattern::consumers_count(1));
4646

47-
ov::matcher_pass_callback callback = [=](ov::pass::pattern::Matcher & m) -> bool {
47+
ov::matcher_pass_callback callback = [OV_CAPTURE_CPY_AND_THIS](ov::pass::pattern::Matcher & m) -> bool {
4848
const auto& opsMap = m.get_pattern_value_map();
4949
const auto weightsConvert = opsMap.at(weightsConvertWrapper).get_node_shared_ptr();
5050
const auto quantizePrecision = weightsConvert->get_input_element_type(0);

src/common/low_precision_transformations/src/reshape.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ReshapeTransformation::ReshapeTransformation(const Params& params) : LayerTransf
3333
auto reshape_pattern = std::make_shared<pass::pattern::op::Or>(OutputVector{ reshape_pattern_const, reshape_pattern_nonconst });
3434
auto matcher = pattern::wrap_type<ov::opset1::Reshape>({ mul_m, reshape_pattern });
3535

36-
ov::graph_rewrite_callback callback = [=](pattern::Matcher& m) {
36+
ov::graph_rewrite_callback callback = [OV_CAPTURE_CPY_AND_THIS](pattern::Matcher& m) {
3737
auto op = m.get_match_root();
3838
if (transformation_callback(op)) {
3939
return false;

src/common/snippets/src/pass/extract_reshapes_from_mha.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "openvino/pass/pattern/op/wrap_type.hpp"
1111
#include "snippets/itt.hpp"
1212
#include "snippets/pass/mha_tokenization.hpp"
13+
#include "transformations/utils/utils.hpp"
1314

1415
using namespace ov::pass;
1516

@@ -26,7 +27,7 @@ ov::snippets::pass::ExtractReshapesFromMHA::ExtractReshapesFromMHA() {
2627
auto add_2_m = pattern::wrap_type<opset1::Add>({add_1_m, sparse_input_2_m}, static_shape_single_consumer);
2728
auto reshape_2_m = pattern::wrap_type<opset1::Reshape>({add_2_m, pattern::wrap_type<opset1::Constant>()}, pattern::has_static_shape());
2829

29-
matcher_pass_callback callback = [=](pattern::Matcher& m) {
30+
matcher_pass_callback callback = [OV_CAPTURE_CPY_AND_THIS](pattern::Matcher& m) {
3031
OV_ITT_SCOPED_TASK(ov::pass::itt::domains::SnippetsTransform, "Snippets::op::ExtractReshapesFromMHA")
3132
const auto& pattern_map = m.get_pattern_value_map();
3233
const auto& matmul = pattern_map.at(matmul_m);

src/common/snippets/src/pass/fq_decomposition.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "openvino/pass/manager.hpp"
1313
#include "openvino/pass/pattern/op/wrap_type.hpp"
1414
#include "openvino/pass/validate.hpp"
15+
#include "transformations/utils/utils.hpp"
1516

1617
#include "openvino/reference/autobroadcast_binop.hpp"
1718
#include "openvino/reference/broadcast.hpp"
@@ -31,7 +32,7 @@ ov::snippets::pass::FakeQuantizeDecomposition::FakeQuantizeDecomposition() {
3132
ov::pass::pattern::wrap_type<ov::op::v0::Constant>(),
3233
ov::pass::pattern::wrap_type<ov::op::v0::Constant>()});
3334

34-
ov::matcher_pass_callback callback = [=](ov::pass::pattern::Matcher& m) {
35+
ov::matcher_pass_callback callback = [OV_CAPTURE_CPY_AND_THIS](ov::pass::pattern::Matcher& m) {
3536
OV_ITT_SCOPED_TASK(ov::pass::itt::domains::SnippetsTransform, "Snippets::op::FakeQuantizeDecomposition")
3637
auto& pattern_to_output = m.get_pattern_value_map();
3738
const auto fake_quantize_node = std::dynamic_pointer_cast<ov::op::v0::FakeQuantize>(

src/common/snippets/src/pass/matmul_to_brgemm.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include "openvino/core/rt_info.hpp"
1212
#include "openvino/pass/pattern/op/wrap_type.hpp"
13+
#include "transformations/utils/utils.hpp"
1314

1415
namespace ov {
1516
namespace snippets {
@@ -33,7 +34,7 @@ MatMulToBrgemm::MatMulToBrgemm() {
3334
MATCHER_SCOPE(MatMulToBrgemm);
3435
auto matmul_pattern = ov::pass::pattern::wrap_type<ov::opset1::MatMul>({ov::pass::pattern::any_input(), ov::pass::pattern::any_input()});
3536

36-
auto callback = [=](ov::pass::pattern::Matcher& m) {
37+
auto callback = [OV_CAPTURE_CPY_AND_THIS](ov::pass::pattern::Matcher& m) {
3738
OV_ITT_SCOPED_TASK(ov::pass::itt::domains::SnippetsTransform, "ov::intel_cpu::pass::MatMulToBrgemm")
3839
auto& pm = m.get_pattern_value_map();
3940
const auto matmul = as_type_ptr<ov::opset1::MatMul>(pm.at(matmul_pattern).get_node_shared_ptr());

src/common/snippets/src/pass/mha_tokenization.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "snippets/pass/explicit_transpose_matmul_inputs.hpp"
1313
#include "snippets/pass/mha_tokenization.hpp"
1414
#include "snippets/utils.hpp"
15+
#include "transformations/utils/utils.hpp"
1516

1617
namespace {
1718
bool is_supported_tensor(const ov::descriptor::Tensor& t) {
@@ -207,7 +208,7 @@ ov::snippets::pass::TokenizeMHASnippets::TokenizeMHASnippets(const SnippetsToken
207208
ov::pass::pattern::any_input(ov::pass::pattern::has_static_shape()));
208209

209210
register_matcher(std::make_shared<ov::pass::pattern::Matcher>(m_matmul0, matcher_name),
210-
[=](ov::pass::pattern::Matcher &m) {
211+
[OV_CAPTURE_CPY_AND_THIS](ov::pass::pattern::Matcher &m) {
211212
OV_ITT_SCOPED_TASK(ov::pass::itt::domains::SnippetsTransform, "Snippets::op::TokenizeMHASnippets")
212213
auto& pattern_to_output = m.get_pattern_value_map();
213214

0 commit comments

Comments
 (0)