Skip to content

Commit 39418ca

Browse files
remove cpu_reset in destruction of CPUStreamsExecutor (#28652)
### Details: - *Remove cpu_reset in destruction of CPUStreamsExecutor, Because cpu_reset is called in destruction of `Compiled model`, so it is no need to call this api again.* ### Tickets: - *ticket-id* Co-authored-by: Wanglei Shen <wanglei.shen@intel.com>
1 parent dc225cf commit 39418ca

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/inference/src/dev/threading/cpu_streams_executor.cpp

+4-10
Original file line numberDiff line numberDiff line change
@@ -496,10 +496,10 @@ std::vector<int> CPUStreamsExecutor::get_rank() {
496496
}
497497

498498
void CPUStreamsExecutor::cpu_reset() {
499-
if (!_impl->_cpu_ids_all.empty()) {
500-
set_cpu_used(_impl->_cpu_ids_all, NOT_USED);
501-
{
502-
std::lock_guard<std::mutex> lock(_impl->_cpu_ids_mutex);
499+
{
500+
std::lock_guard<std::mutex> lock(_impl->_cpu_ids_mutex);
501+
if (!_impl->_cpu_ids_all.empty()) {
502+
set_cpu_used(_impl->_cpu_ids_all, NOT_USED);
503503
_impl->_cpu_ids_all.clear();
504504
}
505505
}
@@ -508,12 +508,6 @@ void CPUStreamsExecutor::cpu_reset() {
508508
CPUStreamsExecutor::CPUStreamsExecutor(const IStreamsExecutor::Config& config) : _impl{new Impl{config}} {}
509509

510510
CPUStreamsExecutor::~CPUStreamsExecutor() {
511-
try {
512-
cpu_reset();
513-
} catch (const ov::Exception&) {
514-
// Destructor should not throw - catch needed for static analysis.
515-
OPENVINO_THROW("Reset CPU state error.");
516-
}
517511
{
518512
std::lock_guard<std::mutex> lock(_impl->_mutex);
519513
_impl->_isStopped = true;

0 commit comments

Comments
 (0)