提交 c515ee1c 编写于 作者: M Megvii Engine Team

fix(src/atlas): wrapping the aclmdlExecuteAsync interface with MGB_USE_ATLAS_ASYNC_API macros

GitOrigin-RevId: 0f2a12ff607042ce421b9a129bd7e6a2dc2b0dc1
上级 f438efc9
......@@ -394,8 +394,14 @@ void AtlasRuntimeOpr::scn_do_execute() {
aclmdlSetDatasetTensorDesc(model_outputs, tensorDesc, i);
}
}
MGB_ATLAS_CHECK(aclmdlExecute(m_model_id, model_inputs, model_outputs));
#if MGB_USE_ATLAS_ASYNC_API
MGB_ATLAS_CHECK(aclmdlExecuteAsync(
m_model_id, model_inputs, model_outputs, acl_env.stream));
MGB_ATLAS_CHECK(aclrtSynchronizeStream(acl_env.stream));
#else
MGB_ATLAS_CHECK(aclmdlExecute(m_model_id, model_inputs, model_outputs));
#endif
for (size_t i = 0; i < nr_inputs; ++i) {
aclDataBuffer* db_ptr = aclmdlGetDatasetBuffer(model_inputs, i);
MGB_ATLAS_CHECK(aclDestroyDataBuffer(db_ptr));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册