From 87da7a74537c29b612f8078b468620d3cd2d4d7d Mon Sep 17 00:00:00 2001 From: Alexander Nesterov Date: Tue, 17 Oct 2023 15:58:35 +0200 Subject: [PATCH] revert changes --- .../intel_cpu/src/nodes/executors/acl/acl_eltwise.cpp | 9 +++++++++ src/plugins/intel_cpu/src/plugin.cpp | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/plugins/intel_cpu/src/nodes/executors/acl/acl_eltwise.cpp b/src/plugins/intel_cpu/src/nodes/executors/acl/acl_eltwise.cpp index eb8e8a2f2b4b08..f22004a0d3e154 100644 --- a/src/plugins/intel_cpu/src/nodes/executors/acl/acl_eltwise.cpp +++ b/src/plugins/intel_cpu/src/nodes/executors/acl/acl_eltwise.cpp @@ -10,6 +10,11 @@ namespace intel_cpu { using namespace arm_compute; +static std::mutex & get_mtx_ifunc() { + static std::mutex mtx_ifunc; + return mtx_ifunc; +} + inline VectorDims reshape_sizes(VectorDims dims) { const size_t MAX_NUM_SHAPE = arm_compute::MAX_DIMS; VectorDims result_dims(MAX_NUM_SHAPE - 1); @@ -495,6 +500,10 @@ bool AclEltwiseExecutor::init(const EltwiseAttrs &eltwiseAttrs, const std::vecto IE_THROW() << "Unsupported operation type for ACL Eltwise executor: " << static_cast(aclEltwiseAttrs.algorithm); } + // We get a problem (seg. faults, data race etc) for eltwise operations when we use several configure(...) functions in parallel. + // We created issue about this problem here: https://github.com/ARM-software/ComputeLibrary/issues/1073 + // TODO: change it when we will get an answer to our question in issue + std::lock_guard _lock {get_mtx_ifunc()}; ifunc = exec_func(); return true; } diff --git a/src/plugins/intel_cpu/src/plugin.cpp b/src/plugins/intel_cpu/src/plugin.cpp index df03d01cd6a991..8bec3128476e4f 100644 --- a/src/plugins/intel_cpu/src/plugin.cpp +++ b/src/plugins/intel_cpu/src/plugin.cpp @@ -47,7 +47,7 @@ static std::mutex & get_mtx_acl() { } static std::shared_ptr & get_acl_scheduler() { - static thread_local std::shared_ptr acl_scheduler = + static std::shared_ptr acl_scheduler = std::make_shared(); return acl_scheduler; }