Skip to content

Commit

Permalink
remove cpu_reset in destruction of CPUStreamsExecutor
Browse files Browse the repository at this point in the history
  • Loading branch information
sunxiaoxia2022 committed Jan 24, 2025
1 parent 7f56fcd commit 3b03274
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/inference/src/dev/threading/cpu_streams_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,10 +492,10 @@ std::vector<int> CPUStreamsExecutor::get_rank() {
}

void CPUStreamsExecutor::cpu_reset() {
if (!_impl->_cpu_ids_all.empty()) {
set_cpu_used(_impl->_cpu_ids_all, NOT_USED);
{
std::lock_guard<std::mutex> lock(_impl->_cpu_ids_mutex);
{
std::lock_guard<std::mutex> lock(_impl->_cpu_ids_mutex);
if (!_impl->_cpu_ids_all.empty()) {
set_cpu_used(_impl->_cpu_ids_all, NOT_USED);
_impl->_cpu_ids_all.clear();
}
}
Expand All @@ -504,12 +504,6 @@ void CPUStreamsExecutor::cpu_reset() {
CPUStreamsExecutor::CPUStreamsExecutor(const IStreamsExecutor::Config& config) : _impl{new Impl{config}} {}

CPUStreamsExecutor::~CPUStreamsExecutor() {
try {
cpu_reset();
} catch (const ov::Exception&) {
// Destructor should not throw - catch needed for static analysis.
OPENVINO_THROW("Reset CPU state error.");
}
{
std::lock_guard<std::mutex> lock(_impl->_mutex);
_impl->_isStopped = true;
Expand Down

0 comments on commit 3b03274

Please sign in to comment.