|
|
|
@ -125,18 +125,21 @@ Status KnownNodeTask::Init(TaskContext &context) {
|
|
|
|
|
load_flag_ = true;
|
|
|
|
|
}
|
|
|
|
|
GE_CHK_STATUS_RET(ModelManager::GetInstance()->DestroyAicpuKernel(davinci_model_->GetSessionId(),
|
|
|
|
|
davinci_model_->Id(), davinci_model_->SubModelId()), "KnownNodeTask::Init destroy aicpu kernel failed.");
|
|
|
|
|
davinci_model_->Id(), davinci_model_->SubModelId()),
|
|
|
|
|
"KnownNodeTask::Init destroy aicpu kernel failed.");
|
|
|
|
|
GELOGI("[%s] KnownNodeExecutor::Init success.", context.GetNodeName());
|
|
|
|
|
return SUCCESS;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Status KnownNodeTask::InitDavinciModel() {
|
|
|
|
|
GELOGD("[Init][Model] start");
|
|
|
|
|
davinci_model_->InitRuntimeParams();
|
|
|
|
|
GE_CHK_STATUS_RET(davinci_model_->InitVariableMem(), "init variable mem failed");
|
|
|
|
|
int32_t device_id = 0;
|
|
|
|
|
GE_CHK_RT_RET(rtGetDevice(&device_id));
|
|
|
|
|
davinci_model_->SetDeviceId(static_cast<uint32_t>(device_id));
|
|
|
|
|
GE_CHK_STATUS_RET(DoInitDavinciModel(), "[Init][Model] Failed to init davinci model.");
|
|
|
|
|
GELOGD("[Init][Model] success");
|
|
|
|
|
return SUCCESS;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|