Skip to content

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

[CPU] Make TBB default threading on RISC-V (#31925)

Arseniy Obolenskiyf237d776c01f
diff --git a/.github/workflows/linux_riscv.yml b/.github/workflows/linux_riscv.yml
index 816d8607f40..bc69ae499f4 100644
--- a/.github/workflows/linux_riscv.yml
+++ b/.github/workflows/linux_riscv.yml
@@ -211,6 +211,7 @@ jobs:
-DENABLE_SYSTEM_SNAPPY=ON \
-DENABLE_SYSTEM_PUGIXML=ON \
-DBUILD_SHARED_LIBS=OFF \
+ -DTHREADING=OMP \
-DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations" \
-DCMAKE_C_FLAGS="-Wno-deprecated-declarations" \
-DCMAKE_VERBOSE_MAKEFILE=ON \
diff --git a/.github/workflows/linux_riscv_xuantie_dev_cpu.yml b/.github/workflows/linux_riscv_xuantie_dev_cpu.yml
index 8627ec790f7..379bfbd41ae 100644
--- a/.github/workflows/linux_riscv_xuantie_dev_cpu.yml
+++ b/.github/workflows/linux_riscv_xuantie_dev_cpu.yml
@@ -176,6 +176,7 @@ jobs:
-DCMAKE_VERBOSE_MAKEFILE=ON
-DENABLE_WHEEL=OFF
-DCMAKE_COMPILE_WARNING_AS_ERROR=OFF
+ -DENABLE_SYSTEM_TBB=ON
-DCMAKE_TOOLCHAIN_FILE=${OPENVINO_REPO}/cmake/toolchains/riscv64-100-xuantie-gnu.toolchain.cmake
-S ${OPENVINO_REPO}
-B ${BUILD_DIR}
diff --git a/cmake/features.cmake b/cmake/features.cmake
index b9ea25b3f09..ebeaca5d3df 100644
--- a/cmake/features.cmake
+++ b/cmake/features.cmake
@@ -79,11 +79,7 @@ ov_dependent_option (ENABLE_PKGCONFIG_GEN "Enable openvino.pc pkg-config file ge
#
# "OneDNN library based on OMP or TBB or Sequential implementation: TBB|OMP|SEQ"
-if(RISCV64)
- set(THREADING_DEFAULT "OMP")
-else()
- set(THREADING_DEFAULT "TBB")
-endif()
+set(THREADING_DEFAULT "TBB")
set(THREADING_OPTIONS "TBB" "TBB_AUTO" "SEQ" "OMP")
diff --git a/src/plugins/intel_cpu/src/graph.cpp b/src/plugins/intel_cpu/src/graph.cpp
index 02f5ef99299..8620ced8a5a 100644
--- a/src/plugins/intel_cpu/src/graph.cpp
+++ b/src/plugins/intel_cpu/src/graph.cpp
@@ -9,7 +9,6 @@
#include <oneapi/dnnl/dnnl_types.h>
#include <algorithm>
-#include <atomic>
#include <cassert>
#include <cstddef>
#include <cstdint>
@@ -76,6 +75,10 @@
#include "utils/verbose.h"
#include "weights_cache.hpp"
+#if (OV_THREAD == OV_THREAD_TBB || OV_THREAD == OV_THREAD_TBB_AUTO || OV_THREAD == OV_THREAD_OMP)
+# include <atomic>
+#endif
+
#if (OV_THREAD == OV_THREAD_TBB || OV_THREAD == OV_THREAD_TBB_AUTO)
# include <tbb/task.h>
#endif
diff --git a/src/plugins/intel_cpu/thirdparty/onednn b/src/plugins/intel_cpu/thirdparty/onednn
index 8db5d5ae8b6..5b93a37dae0 160000
--- a/src/plugins/intel_cpu/thirdparty/onednn
+++ b/src/plugins/intel_cpu/thirdparty/onednn
@@ -1 +1 @@
-Subproject commit 8db5d5ae8b61bc88c3ad2ea849a0e5e8576d130d
+Subproject commit 5b93a37dae0237400e43850c07b4a44695e29178