hiai接入NPU调动

Signed-off-by: w30052974 <wangyifan94@huawei.com>
This commit is contained in:
w30052974 2024-09-02 14:51:53 +08:00
parent 884a653820
commit 8af6544008
2 changed files with 7 additions and 2 deletions

View File

@ -1244,6 +1244,11 @@ OH_NN_ReturnCode Scheduling(Compilation** compilation)
return OH_NN_INVALID_PARAMETER;
}
std::string cachePath = "";
if (compilationImpl->cachePath != nullptr) {
cachePath = compilationImpl->cachePath;
}
bool supportStat = false;
int ret = nnrtService.IsSupportScheduling(&supportStat);
if (ret != static_cast<int>(OH_NN_SUCCESS)) {
@ -1261,7 +1266,7 @@ OH_NN_ReturnCode Scheduling(Compilation** compilation)
}
bool needModelLatency = false;
ret = nnrtService.Scheduling(compilationImpl->hiaiModelId, &needModelLatency);
ret = nnrtService.Scheduling(compilationImpl->hiaiModelId, &needModelLatency, cachePath.c_str());
if (ret != static_cast<int>(OH_NN_SUCCESS)) {
LOGE("Scheduling failed, some error happened when scheduling.");
return static_cast<OH_NN_ReturnCode>(ret);

View File

@ -37,7 +37,7 @@ public:
int (*IsSupportAuthentication)(bool* supportStat) = nullptr;
int (*IsSupportScheduling)(bool* supportStat) = nullptr;
int (*Authentication)(int callingPid) = nullptr;
int (*Scheduling)(uint32_t hiaiModelId, bool* needModelLatency) = nullptr;
int (*Scheduling)(uint32_t hiaiModelId, bool* needModelLatency, const char* cachePath) = nullptr;
int (*UpdateModelLatency)(uint32_t hiaiModelId, int modelLatency) = nullptr;
int (*Unload)(uint32_t hiaiModelId) = nullptr;