Skip to content

Commit

Permalink
Remove usage of deprecated ov::affinity property (#3991)
Browse files Browse the repository at this point in the history
* Remove usage of deprecated ov::affinity property

* fixed review comments

---------

Co-authored-by: Ilya Lavrenov <[email protected]>
  • Loading branch information
dmitry-gorokhov and ilya-lavrenov authored Jan 3, 2025
1 parent 612d680 commit 7d15a7b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion demos/common/cpp/utils/src/config_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ ModelConfig ConfigFactory::getUserConfig(const std::string& flags_d,
if (flags_nthreads != 0)
config.compiledModelConfig.emplace(ov::inference_num_threads.name(), flags_nthreads);

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

ov::streams::Num nstreams =
deviceNstreams.count(device) > 0 ? ov::streams::Num(deviceNstreams[device]) : ov::streams::AUTO;
Expand Down
2 changes: 1 addition & 1 deletion demos/multi_channel_common/cpp/graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static inline size_t roundUp(size_t enumerator, size_t denominator) {

static inline std::queue<ov::InferRequest> compile(std::shared_ptr<ov::Model>&& model, const std::string& modelPath,
const std::string& device, size_t performanceHintNumRequests, ov::Core& core) {
core.set_property("CPU", ov::affinity(ov::Affinity::NONE));
core.set_property("CPU", ov::hint::enable_cpu_pinning(false));
ov::CompiledModel compiled = core.compile_model(model, device, {
{ov::hint::performance_mode(ov::hint::PerformanceMode::THROUGHPUT)},
{ov::hint::num_requests(performanceHintNumRequests)}});
Expand Down
2 changes: 1 addition & 1 deletion demos/security_barrier_camera_demo/cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ int main(int argc, char* argv[]) {
if (FLAGS_nthreads != 0) {
core.set_property("CPU", ov::inference_num_threads(FLAGS_nthreads));
}
core.set_property("CPU", ov::affinity(ov::Affinity::NONE));
core.set_property("CPU", ov::hint::enable_cpu_pinning(false));
core.set_property("CPU", ov::streams::num((device_nstreams.count("CPU") > 0 ? ov::streams::Num(device_nstreams["CPU"]) : ov::streams::AUTO)));

device_nstreams["CPU"] = core.get_property("CPU", ov::streams::num);
Expand Down
2 changes: 1 addition & 1 deletion demos/social_distance_demo/cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ int main(int argc, char* argv[]) {
if (FLAGS_nthreads != 0) {
core.set_property("CPU", ov::inference_num_threads(FLAGS_nthreads));
}
core.set_property("CPU", ov::affinity(ov::Affinity::NONE));
core.set_property("CPU", ov::hint::enable_cpu_pinning(false));
core.set_property("CPU", ov::streams::num((deviceNStreams.count("CPU") > 0 ? ov::streams::Num(deviceNStreams["CPU"]) : ov::streams::AUTO)));
deviceNStreams["CPU"] = core.get_property("CPU", ov::streams::num);
}
Expand Down

0 comments on commit 7d15a7b

Please sign in to comment.