[openvino]windows上配置C++openvino后测试代码

测试环境:

vs2025

w_openvino_toolkit_windows_2025.3.0.16041.1e3b88e4e3f_x86_64.zip

代码:

#include 
#include 

int main(int, char**) { // -------- 获取 OpenVINO 运行时版本 -------- std::cout << "OpenVINO version: " << ov::get_openvino_version() << std::endl;

// -------- Step 1. 初始化 Core 对象 --------
ov::Core core;

// -------- Step 2. 获取可用的设备 --------
std::vector availableDevices = core.get_available_devices();

// -------- Step 3. 查询并打印支持的指标和配置键 --------
std::cout << "支持的设备及其属性:" << std::endl;
for (const auto& device : availableDevices) {
    std::cout << "设备: " << device << std::endl;

    // 获取该设备支持的读取指标
    auto supportedMetrics = core.get_property(device, ov::supported_properties);
    std::cout << "  支持的属性: ";
    for (const auto& metric : supportedMetrics) {
        std::cout << metric << ", ";
    }
    std::cout << std::endl;

    // 获取可配置的选项
    auto configKeys = core.get_property(device, ov::device::properties);
    std::cout << "  可配置项: ";
    for (const auto& key : configKeys) {
        std::cout << key << " ";
    }
    std::cout << std::endl << std::endl;
}

return 0;

}

运行结果: