Skip to content

Commit 7d15a7b

Browse files
Gorokhov Dmitriyilya-lavrenov
Gorokhov Dmitriy
andauthored
Remove usage of deprecated ov::affinity property (#3991)
* Remove usage of deprecated ov::affinity property * fixed review comments --------- Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
1 parent 612d680 commit 7d15a7b

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

demos/common/cpp/utils/src/config_factory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ ModelConfig ConfigFactory::getUserConfig(const std::string& flags_d,
4848
if (flags_nthreads != 0)
4949
config.compiledModelConfig.emplace(ov::inference_num_threads.name(), flags_nthreads);
5050

51-
config.compiledModelConfig.emplace(ov::affinity.name(), ov::Affinity::NONE);
51+
config.compiledModelConfig.emplace(ov::hint::enable_cpu_pinning.name(), false);
5252

5353
ov::streams::Num nstreams =
5454
deviceNstreams.count(device) > 0 ? ov::streams::Num(deviceNstreams[device]) : ov::streams::AUTO;

demos/multi_channel_common/cpp/graph.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static inline size_t roundUp(size_t enumerator, size_t denominator) {
2929

3030
static inline std::queue<ov::InferRequest> compile(std::shared_ptr<ov::Model>&& model, const std::string& modelPath,
3131
const std::string& device, size_t performanceHintNumRequests, ov::Core& core) {
32-
core.set_property("CPU", ov::affinity(ov::Affinity::NONE));
32+
core.set_property("CPU", ov::hint::enable_cpu_pinning(false));
3333
ov::CompiledModel compiled = core.compile_model(model, device, {
3434
{ov::hint::performance_mode(ov::hint::PerformanceMode::THROUGHPUT)},
3535
{ov::hint::num_requests(performanceHintNumRequests)}});

demos/security_barrier_camera_demo/cpp/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ int main(int argc, char* argv[]) {
718718
if (FLAGS_nthreads != 0) {
719719
core.set_property("CPU", ov::inference_num_threads(FLAGS_nthreads));
720720
}
721-
core.set_property("CPU", ov::affinity(ov::Affinity::NONE));
721+
core.set_property("CPU", ov::hint::enable_cpu_pinning(false));
722722
core.set_property("CPU", ov::streams::num((device_nstreams.count("CPU") > 0 ? ov::streams::Num(device_nstreams["CPU"]) : ov::streams::AUTO)));
723723

724724
device_nstreams["CPU"] = core.get_property("CPU", ov::streams::num);

demos/social_distance_demo/cpp/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ int main(int argc, char* argv[]) {
695695
if (FLAGS_nthreads != 0) {
696696
core.set_property("CPU", ov::inference_num_threads(FLAGS_nthreads));
697697
}
698-
core.set_property("CPU", ov::affinity(ov::Affinity::NONE));
698+
core.set_property("CPU", ov::hint::enable_cpu_pinning(false));
699699
core.set_property("CPU", ov::streams::num((deviceNStreams.count("CPU") > 0 ? ov::streams::Num(deviceNStreams["CPU"]) : ov::streams::AUTO)));
700700
deviceNStreams["CPU"] = core.get_property("CPU", ov::streams::num);
701701
}

0 commit comments

Comments
 (0)