@@ -57,8 +57,9 @@ CompiledModel::CompiledModel(const std::shared_ptr<ov::Model>& model,
57
57
m_sub_memory_manager (std::move(sub_memory_manager)) {
58
58
m_mutex = std::make_shared<std::mutex>();
59
59
const auto & core = m_plugin->get_core ();
60
- if (!core)
60
+ if (!core) {
61
61
OPENVINO_THROW (" Unable to get API version. Core is unavailable" );
62
+ }
62
63
63
64
IStreamsExecutor::Config executor_config;
64
65
if (m_cfg.exclusiveAsyncRequests ) {
@@ -81,10 +82,12 @@ CompiledModel::CompiledModel(const std::shared_ptr<ov::Model>& model,
81
82
m_callback_executor = m_task_executor;
82
83
}
83
84
84
- if (m_task_executor)
85
+ if (m_task_executor) {
85
86
set_task_executor (m_task_executor);
86
- if (m_callback_executor)
87
+ }
88
+ if (m_callback_executor) {
87
89
set_callback_executor (m_callback_executor);
90
+ }
88
91
89
92
int streams = std::max (1 , executor_config.get_streams ());
90
93
std::vector<Task> tasks;
@@ -208,15 +211,17 @@ std::shared_ptr<ov::IAsyncInferRequest> CompiledModel::create_infer_request() co
208
211
}
209
212
210
213
std::shared_ptr<const ov::Model> CompiledModel::get_runtime_model () const {
211
- if (m_graphs.empty ())
214
+ if (m_graphs.empty ()) {
212
215
OPENVINO_THROW (" No graph was found" );
216
+ }
213
217
214
218
return get_graph ()._graph .dump ();
215
219
}
216
220
217
221
ov::Any CompiledModel::get_property (const std::string& name) const {
218
- if (m_graphs.empty ())
222
+ if (m_graphs.empty ()) {
219
223
OPENVINO_THROW (" No graph was found" );
224
+ }
220
225
221
226
if (name == ov::loaded_from_cache) {
222
227
return m_loaded_from_cache;
@@ -275,30 +280,30 @@ ov::Any CompiledModel::get_property(const std::string& name) const {
275
280
return decltype (ov::model_name)::value_type (modelName);
276
281
} else if (name == ov::optimal_number_of_infer_requests) {
277
282
const auto streams = config.streamExecutorConfig .get_streams ();
278
- return decltype (ov::optimal_number_of_infer_requests)::value_type (
283
+ return static_cast < decltype (ov::optimal_number_of_infer_requests)::value_type> (
279
284
streams > 0 ? streams : 1 ); // ov::optimal_number_of_infer_requests has no negative values
280
285
} else if (name == ov::num_streams) {
281
286
const auto streams = config.streamExecutorConfig .get_streams ();
282
287
return decltype (ov::num_streams)::value_type (
283
288
streams); // ov::num_streams has special negative values (AUTO = -1, NUMA = -2)
284
289
} else if (name == ov::inference_num_threads) {
285
290
const auto num_threads = config.streamExecutorConfig .get_threads ();
286
- return decltype (ov::inference_num_threads)::value_type (num_threads);
291
+ return static_cast < decltype (ov::inference_num_threads)::value_type> (num_threads);
287
292
} else if (name == ov::enable_profiling.name ()) {
288
293
const bool perfCount = config.collectPerfCounters ;
289
- return decltype (ov::enable_profiling)::value_type (perfCount);
294
+ return static_cast < decltype (ov::enable_profiling)::value_type> (perfCount);
290
295
} else if (name == ov::hint::inference_precision) {
291
296
return decltype (ov::hint::inference_precision)::value_type (config.inferencePrecision );
292
297
} else if (name == ov::hint::performance_mode) {
293
- return decltype (ov::hint::performance_mode)::value_type (config.hintPerfMode );
298
+ return static_cast < decltype (ov::hint::performance_mode)::value_type> (config.hintPerfMode );
294
299
} else if (name == ov::log ::level) {
295
- return decltype (ov::log ::level)::value_type (config.logLevel );
300
+ return static_cast < decltype (ov::log ::level)::value_type> (config.logLevel );
296
301
} else if (name == ov::hint::enable_cpu_pinning.name ()) {
297
302
const bool use_pin = config.enableCpuPinning ;
298
- return decltype (ov::hint::enable_cpu_pinning)::value_type (use_pin);
303
+ return static_cast < decltype (ov::hint::enable_cpu_pinning)::value_type> (use_pin);
299
304
} else if (name == ov::hint::enable_cpu_reservation.name ()) {
300
305
const bool use_reserve = config.enableCpuReservation ;
301
- return decltype (ov::hint::enable_cpu_reservation)::value_type (use_reserve);
306
+ return static_cast < decltype (ov::hint::enable_cpu_reservation)::value_type> (use_reserve);
302
307
} else if (name == ov::hint::scheduling_core_type) {
303
308
const auto stream_mode = config.schedulingCoreType ;
304
309
return stream_mode;
@@ -307,31 +312,32 @@ ov::Any CompiledModel::get_property(const std::string& name) const {
307
312
return distribution_policy;
308
313
} else if (name == ov::hint::enable_hyper_threading.name ()) {
309
314
const bool use_ht = config.enableHyperThreading ;
310
- return decltype (ov::hint::enable_hyper_threading)::value_type (use_ht);
315
+ return static_cast < decltype (ov::hint::enable_hyper_threading)::value_type> (use_ht);
311
316
} else if (name == ov::hint::execution_mode) {
312
317
return config.executionMode ;
313
318
} else if (name == ov::hint::num_requests) {
314
- return decltype (ov::hint::num_requests)::value_type (config.hintNumRequests );
319
+ return static_cast < decltype (ov::hint::num_requests)::value_type> (config.hintNumRequests );
315
320
} else if (name == ov::execution_devices) {
316
321
return decltype (ov::execution_devices)::value_type{m_plugin->get_device_name ()};
317
322
} else if (name == ov::intel_cpu::denormals_optimization) {
318
- return decltype (ov::intel_cpu::denormals_optimization)::value_type (config. denormalsOptMode ==
319
- Config::DenormalsOptMode::DO_On);
323
+ return static_cast < decltype (ov::intel_cpu::denormals_optimization)::value_type>(
324
+ config. denormalsOptMode == Config::DenormalsOptMode::DO_On);
320
325
} else if (name == ov::intel_cpu::sparse_weights_decompression_rate) {
321
- return decltype (ov::intel_cpu::sparse_weights_decompression_rate)::value_type (
326
+ return static_cast < decltype (ov::intel_cpu::sparse_weights_decompression_rate)::value_type> (
322
327
config.fcSparseWeiDecompressionRate );
323
328
} else if (name == ov::hint::dynamic_quantization_group_size) {
324
- return decltype (ov::hint::dynamic_quantization_group_size)::value_type (config.fcDynamicQuantizationGroupSize );
329
+ return static_cast <decltype (ov::hint::dynamic_quantization_group_size)::value_type>(
330
+ config.fcDynamicQuantizationGroupSize );
325
331
} else if (name == ov::hint::kv_cache_precision) {
326
332
return decltype (ov::hint::kv_cache_precision)::value_type (config.kvCachePrecision );
327
333
} else if (name == ov::key_cache_precision) {
328
334
return decltype (ov::key_cache_precision)::value_type (config.keyCachePrecision );
329
335
} else if (name == ov::value_cache_precision) {
330
336
return decltype (ov::value_cache_precision)::value_type (config.valueCachePrecision );
331
337
} else if (name == ov::key_cache_group_size) {
332
- return decltype (ov::key_cache_group_size)::value_type (config.keyCacheGroupSize );
338
+ return static_cast < decltype (ov::key_cache_group_size)::value_type> (config.keyCacheGroupSize );
333
339
} else if (name == ov::value_cache_group_size) {
334
- return decltype (ov::value_cache_group_size)::value_type (config.valueCacheGroupSize );
340
+ return static_cast < decltype (ov::value_cache_group_size)::value_type> (config.valueCacheGroupSize );
335
341
}
336
342
OPENVINO_THROW (" Unsupported property: " , name);
337
343
}
0 commit comments