Enable log information. Disable NPU in U9

This commit is contained in:
2026-04-21 15:48:27 +10:00
parent 00f6e2f852
commit 97d814936d
18 changed files with 301 additions and 54 deletions

View File

@@ -1,5 +1,6 @@
#include "ONNXSAM3.h"
#include "ONNXEngine.h" // OrtCompatiableGetInputName/OutputName helpers
#include "OpenVINODeviceConfig.h"
#include <iostream>
#include <fstream>
@@ -73,11 +74,13 @@ namespace ANSCENTER
bool ONNXSAM3::TryAppendOpenVINO(Ort::SessionOptions& session_options)
{
std::vector<std::unordered_map<std::string, std::string>> configs = {
{{"device_type","AUTO:NPU,GPU"},{"precision","FP16"},{"num_of_threads","4"},{"num_streams","4"}},
{{"device_type","GPU.0"}, {"precision","FP16"},{"num_of_threads","4"},{"num_streams","4"}},
{{"device_type","AUTO:GPU,CPU"},{"precision","FP16"},{"num_of_threads","4"},{"num_streams","4"}}
};
// NPU gated by OPENVINO_ENABLE_NPU — see OpenVINODeviceConfig.h
std::vector<std::unordered_map<std::string, std::string>> configs;
if (IsOpenVINONpuEnabled()) {
configs.push_back({{"device_type","AUTO:NPU,GPU"},{"precision","FP16"},{"num_of_threads","4"},{"num_streams","4"}});
}
configs.push_back({{"device_type","GPU.0"}, {"precision","FP16"},{"num_of_threads","4"},{"num_streams","4"}});
configs.push_back({{"device_type","AUTO:GPU,CPU"},{"precision","FP16"},{"num_of_threads","4"},{"num_streams","4"}});
for (const auto& config : configs) {
try {
session_options.AppendExecutionProvider_OpenVINO_V2(config);