[XPU] Update Lite XPU lib and fixed some bugs (#1647)

This commit is contained in:
DefTruth
2023-03-17 21:39:39 +08:00
committed by GitHub
parent e21127b7e8
commit 6af3691568
8 changed files with 100 additions and 11 deletions

View File

@@ -85,8 +85,13 @@ static bool CreateRuntimeOption(fastdeploy::RuntimeOption* option,
return false;
}
} else if (config_info["device"] == "xpu") {
option->UseKunlunXin(std::stoi(config_info["device_id"]),
std::stoi(config_info["xpu_l3_cache"]));
if (FLAGS_xpu_l3_cache >= 0) {
option->UseKunlunXin(std::stoi(config_info["device_id"],
FLAGS_xpu_l3_cache);
} else {
option->UseKunlunXin(std::stoi(config_info["device_id"]),
std::stoi(config_info["xpu_l3_cache"]));
}
if (config_info["backend"] == "ort") {
option->UseOrtBackend();
} else if (config_info["backend"] == "paddle") {