优化性能,增加npu使用率
This commit is contained in:
parent
f8aa377a79
commit
266fbb040e
@ -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));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user