Skip to content

Commit d6b3c76

Browse files
do not create CPU plugin if setting properties to disable CPU.
1 parent 041d8a1 commit d6b3c76

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/plugins/auto/src/plugin.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,19 @@ ov::Any Plugin::get_property(const std::string& name, const ov::AnyMap& argument
301301
? m_plugin_config.parse_priorities_devices(
302302
arguments.at(ov::device::priorities.name()).as<std::string>())
303303
: get_core()->get_available_devices();
304+
bool enable_startup_cpu = arguments.count(ov::intel_auto::enable_startup_fallback.name())
305+
? arguments.at(ov::intel_auto::enable_startup_fallback).as<bool>()
306+
: true;
307+
bool enable_runtime_cpu = arguments.count(ov::intel_auto::enable_runtime_fallback.name())
308+
? arguments.at(ov::intel_auto::enable_runtime_fallback).as<bool>()
309+
: true;
310+
bool enable_cpu = enable_startup_cpu || enable_runtime_cpu;
304311
std::vector<std::string> capabilities;
305312
for (auto const& device : device_list) {
306313
auto real_device = device[0] == '-' ? device.substr(1) : device;
314+
if (real_device.find("CPU") != std::string::npos && !enable_cpu) {
315+
continue;
316+
}
307317
try {
308318
auto devCapabilities = get_core()->get_property(real_device, ov::device::capabilities);
309319
capabilities.insert(capabilities.end(), devCapabilities.begin(), devCapabilities.end());

0 commit comments

Comments
 (0)