优化性能,增加npu使用率
Some checks are pending
CI / host-build (push) Waiting to run
CI / rk3588-cross-build (push) Waiting to run

This commit is contained in:
sladro 2026-01-06 17:53:03 +08:00
parent f8aa377a79
commit 266fbb040e

View File

@ -99,6 +99,13 @@ ModelHandle AiScheduler::LoadModel(const std::string& model_path, std::string& e
return kInvalidModelHandle;
}
// Prefer using all NPU cores (RK3588).
// This does not change the shared-context behavior; it only hints RKNN runtime scheduling.
ret = rknn_set_core_mask(ctx->ctx, RKNN_NPU_CORE_0_1_2);
if (ret < 0) {
LogWarn("[AiScheduler] rknn_set_core_mask failed: " + std::to_string(ret));
}
// Query input/output info
rknn_input_output_num io_num;
ret = rknn_query(ctx->ctx, RKNN_QUERY_IN_OUT_NUM, &io_num, sizeof(io_num));