2022-01-19 01:07:49 +03:00
|
|
|
// Copyright (C) 2018-2022 Intel Corporation
|
2019-08-09 19:02:42 +03:00
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
//
|
|
|
|
|
|
2021-04-22 14:02:54 +03:00
|
|
|
#include <cstdlib>
|
2019-08-09 19:02:42 +03:00
|
|
|
#include <iomanip>
|
|
|
|
|
#include <memory>
|
2021-04-22 14:02:54 +03:00
|
|
|
#include <set>
|
2019-08-09 19:02:42 +03:00
|
|
|
#include <string>
|
|
|
|
|
#include <tuple>
|
2021-04-22 14:02:54 +03:00
|
|
|
#include <vector>
|
2019-08-09 19:02:42 +03:00
|
|
|
|
2021-12-13 11:30:58 +03:00
|
|
|
// clang-format off
|
2021-10-23 22:47:35 +03:00
|
|
|
#include "openvino/openvino.hpp"
|
2021-12-13 11:30:58 +03:00
|
|
|
#include "samples/common.hpp"
|
|
|
|
|
#include "samples/slog.hpp"
|
|
|
|
|
// clang-format on
|
2019-08-09 19:02:42 +03:00
|
|
|
|
2021-04-15 13:42:46 +03:00
|
|
|
/**
|
2021-04-22 14:02:54 +03:00
|
|
|
* @brief Print IE Parameters
|
|
|
|
|
* @param reference on IE Parameter
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
2021-12-29 15:36:33 +03:00
|
|
|
void print_any_value(const ov::Any& value) {
|
2021-03-17 13:08:42 +03:00
|
|
|
if (value.empty()) {
|
2021-12-13 11:30:58 +03:00
|
|
|
slog::info << "EMPTY VALUE" << slog::endl;
|
2022-02-11 09:22:45 +03:00
|
|
|
} else {
|
2019-08-09 19:02:42 +03:00
|
|
|
std::string stringValue = value.as<std::string>();
|
2021-12-13 11:30:58 +03:00
|
|
|
slog::info << (stringValue.empty() ? "\"\"" : stringValue) << slog::endl;
|
2019-08-09 19:02:42 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 14:02:54 +03:00
|
|
|
int main(int argc, char* argv[]) {
|
2019-08-09 19:02:42 +03:00
|
|
|
try {
|
2021-12-13 11:30:58 +03:00
|
|
|
// -------- Get OpenVINO runtime version --------
|
|
|
|
|
slog::info << ov::get_openvino_version() << slog::endl;
|
|
|
|
|
|
2021-10-23 22:47:35 +03:00
|
|
|
// -------- Parsing and validation of input arguments --------
|
2019-08-09 19:02:42 +03:00
|
|
|
if (argc != 1) {
|
2021-04-22 14:02:54 +03:00
|
|
|
std::cout << "Usage : " << argv[0] << std::endl;
|
2019-08-09 19:02:42 +03:00
|
|
|
return EXIT_FAILURE;
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-23 22:47:35 +03:00
|
|
|
// -------- Step 1. Initialize OpenVINO Runtime Core --------
|
2022-01-20 16:17:57 +03:00
|
|
|
ov::Core core;
|
2019-08-09 19:02:42 +03:00
|
|
|
|
2021-10-23 22:47:35 +03:00
|
|
|
// -------- Step 2. Get list of available devices --------
|
|
|
|
|
std::vector<std::string> availableDevices = core.get_available_devices();
|
2019-08-09 19:02:42 +03:00
|
|
|
|
2021-10-23 22:47:35 +03:00
|
|
|
// -------- Step 3. Query and print supported metrics and config keys --------
|
2021-12-13 11:30:58 +03:00
|
|
|
slog::info << "Available devices: " << slog::endl;
|
2021-04-22 14:02:54 +03:00
|
|
|
for (auto&& device : availableDevices) {
|
2021-12-13 11:30:58 +03:00
|
|
|
slog::info << device << slog::endl;
|
2019-08-09 19:02:42 +03:00
|
|
|
|
2022-02-01 13:05:14 +03:00
|
|
|
// Query supported properties and print all of them
|
|
|
|
|
slog::info << "\tSUPPORTED_PROPERTIES: " << slog::endl;
|
|
|
|
|
auto supported_properties = core.get_property(device, ov::supported_properties);
|
|
|
|
|
for (auto&& property : supported_properties) {
|
|
|
|
|
if (property != ov::supported_properties.name()) {
|
|
|
|
|
slog::info << "\t\t" << (property.is_mutable() ? "Mutable: " : "Immutable: ") << property << " : "
|
|
|
|
|
<< slog::flush;
|
|
|
|
|
print_any_value(core.get_property(device, property));
|
2020-04-15 19:01:57 +03:00
|
|
|
}
|
2019-08-09 19:02:42 +03:00
|
|
|
}
|
|
|
|
|
|
2021-12-13 11:30:58 +03:00
|
|
|
slog::info << slog::endl;
|
2019-08-09 19:02:42 +03:00
|
|
|
}
|
2021-04-22 14:02:54 +03:00
|
|
|
} catch (const std::exception& ex) {
|
2021-03-17 13:08:42 +03:00
|
|
|
std::cerr << std::endl << "Exception occurred: " << ex.what() << std::endl << std::flush;
|
2019-08-09 19:02:42 +03:00
|
|
|
return EXIT_FAILURE;
|
|
|
|
|
}
|
2021-10-23 22:47:35 +03:00
|
|
|
|
2019-08-09 19:02:42 +03:00
|
|
|
return EXIT_SUCCESS;
|
|
|
|
|
}
|