| @@ -1394,9 +1394,19 @@ Status ModelManager::LaunchKernelCustAicpuSo(const string &kernel_name) { | |||||
| return SUCCESS; | return SUCCESS; | ||||
| } | } | ||||
| rtStream_t stream = nullptr; | |||||
| vector<void *> allocated_mem; | vector<void *> allocated_mem; | ||||
| std::function<void()> callback = [&]() { | |||||
| for (auto mem : allocated_mem) { | |||||
| GE_CHK_RT(rtFree(mem)); | |||||
| } | |||||
| if (stream != nullptr) { | |||||
| GE_CHK_RT(rtStreamDestroy(stream)); | |||||
| } | |||||
| }; | |||||
| GE_MAKE_GUARD(release, callback); | |||||
| rtError_t status; | rtError_t status; | ||||
| rtStream_t stream = nullptr; | |||||
| vector<CustAicpuSoBuf> v_cust_so; | vector<CustAicpuSoBuf> v_cust_so; | ||||
| void *args = nullptr; | void *args = nullptr; | ||||
| @@ -1471,13 +1481,6 @@ Status ModelManager::LaunchKernelCustAicpuSo(const string &kernel_name) { | |||||
| GELOGE(RT_FAILED, "[Call][RtStreamSynchronize] fail, ret = 0x%X", status); | GELOGE(RT_FAILED, "[Call][RtStreamSynchronize] fail, ret = 0x%X", status); | ||||
| return RT_ERROR_TO_GE_STATUS(status); | return RT_ERROR_TO_GE_STATUS(status); | ||||
| } | } | ||||
| std::function<void()> callback = [&]() { | |||||
| for (auto mem : allocated_mem) { | |||||
| GE_CHK_RT(rtFree(mem)); | |||||
| } | |||||
| GE_CHK_RT(rtStreamDestroy(stream)); | |||||
| }; | |||||
| GE_MAKE_GUARD(release, callback); | |||||
| GELOGI("Cpu kernel launch task success."); | GELOGI("Cpu kernel launch task success."); | ||||
| return SUCCESS; | return SUCCESS; | ||||
| } | } | ||||