已合并
检视意见修改 #2765
检视意见修改 #2765
已合并
强龙创建于 6月11日
18 个文件变更+72-59
@@ -1663,7 +1663,7 @@ aclError aclmdlRIAddCondTask(aclmdlRICondTaskParams params, aclrtStream stream,
1663 1663 
1664在Stream上添加条件任务。1664在Stream上添加条件任务。
1665 1665 
1666-条件任务参数包括条件句柄(条件值、默认值等)、条件类型、分支数量、子图等信息。执行条件任务的Stream必须处于捕获状态活跃的ACL图Stream1666+条件任务参数包括条件句柄(条件值、默认值等)、条件类型、分支数量、子图等信息。执行条件任务的Stream必须处于捕获状态。
1667 1667 
1668### 参数说明1668### 参数说明
1669 1669 
@@ -1671,7 +1671,7 @@ aclError aclmdlRIAddCondTask(aclmdlRICondTaskParams params, aclrtStream stream,
1671| 参数名 | 输入/输出 | 说明 |1671| 参数名 | 输入/输出 | 说明 |
1672| --- | :---: | --- |1672| --- | :---: | --- |
1673| params | 输入 | 条件任务参数,包含条件句柄、条件类型、分支数量、子图等信息。类型定义请参见[aclmdlRICondTaskParams](25_数据类型及其操作接口.md#aclmdlRICondTaskParams)。 |1673| params | 输入 | 条件任务参数,包含条件句柄、条件类型、分支数量、子图等信息。类型定义请参见[aclmdlRICondTaskParams](25_数据类型及其操作接口.md#aclmdlRICondTaskParams)。 |
1674-| stream | 输入 | 执行条件任务的Stream,必须处于捕获状态活跃的ACL图Stream。类型定义请参见[aclrtStream](25_数据类型及其操作接口.md#aclrtStream)。 |1674+| stream | 输入 | 执行条件任务的Stream,必须处于捕获状态。类型定义请参见[aclrtStream](25_数据类型及其操作接口.md#aclrtStream)。 |
1675| flags | 输入 | 预留参数。当前固定配置为0。 |1675| flags | 输入 | 预留参数。当前固定配置为0。 |
1676 1676 
1677### 返回值说明1677### 返回值说明
@@ -63,8 +63,7 @@ extern "C" {
63#define ACL_ERROR_RT_SYMBOL_NOT_FOUND 107042 // symbol not found63#define ACL_ERROR_RT_SYMBOL_NOT_FOUND 107042 // symbol not found
64#define ACL_ERROR_RT_INVALID_SYMBOL 107043 // invalid device symbol64#define ACL_ERROR_RT_INVALID_SYMBOL 107043 // invalid device symbol
65#define ACL_ERROR_RT_INVALID_DEVICE_FUNCTION 107044 // invalid device function65#define ACL_ERROR_RT_INVALID_DEVICE_FUNCTION 107044 // invalid device function
66-#define ACL_ERROR_RT_STREAM_NOT_SUPPORT_OPERA 107045 // stream not support66+#define ACL_ERROR_RT_SUB_ACLGRAPH_IS_CAPTURING 107045 // sub acl graph is caputring
67-#define ACL_ERROR_RT_SUB_ACLGRAPH_IS_CAPTURING 107046 // sub acl graph is caputring
68 67 
69#define ACL_ERROR_RT_FEATURE_NOT_SUPPORT 207000 // feature not support68#define ACL_ERROR_RT_FEATURE_NOT_SUPPORT 207000 // feature not support
70#define ACL_ERROR_RT_MEMORY_ALLOCATION 207001 // memory allocation error, only used by out of memory69#define ACL_ERROR_RT_MEMORY_ALLOCATION 207001 // memory allocation error, only used by out of memory
@@ -431,12 +431,6 @@ typedef void *rtMemHandle;
431 */431 */
432typedef void *rtTaskGrp_t;432typedef void *rtTaskGrp_t;
433 433 
434-/**
435- * @ingroup dvrt_base
436- * @brief condition task handle.
437- */
438-typedef void *rtCondHandle_t;
439- 
440#define RT_PROF_MAX_DEV_NUM 64434#define RT_PROF_MAX_DEV_NUM 64
441 435 
442#define PATH_LEN_MAX 1023436#define PATH_LEN_MAX 1023
@@ -158,8 +158,7 @@ constexpr int32_t RT_ERROR_STREAM_TASKGRP_UPDATE = 0x07030024;
158constexpr int32_t RT_ERROR_STREAM_CAPTURE_UNMATCHED = 0x07030025;158constexpr int32_t RT_ERROR_STREAM_CAPTURE_UNMATCHED = 0x07030025;
159constexpr int32_t RT_ERROR_STREAM_CAPTURE_WRONG_THREAD = 0x07030026;159constexpr int32_t RT_ERROR_STREAM_CAPTURE_WRONG_THREAD = 0x07030026;
160constexpr int32_t RT_ERROR_STREAM_CAPTURE_MODE_BLOCK_ASYNC = 0x07030027;160constexpr int32_t RT_ERROR_STREAM_CAPTURE_MODE_BLOCK_ASYNC = 0x07030027;
161-constexpr int32_t RT_ERROR_STREAM_NOT_SUPPORT_OPERA = 0x07030028;161+constexpr int32_t RT_ERROR_STREAM_SUB_ACLGRAPH_IS_CAPTURING = 0x07030028;
162-constexpr int32_t RT_ERROR_STREAM_SUB_ACLGRAPH_IS_CAPTURING = 0x07030029;
163 162 
164constexpr int32_t RT_ERROR_MODEL_BASE = 0x07040000;163constexpr int32_t RT_ERROR_MODEL_BASE = 0x07040000;
165constexpr int32_t RT_ERROR_MODEL_NULL = 0x07040001;164constexpr int32_t RT_ERROR_MODEL_NULL = 0x07040001;
@@ -95,7 +95,7 @@ private:
95 uint32_t condSize_{0U}; // 子模型个数95 uint32_t condSize_{0U}; // 子模型个数
96 uint64_t *devAddr_{nullptr}; // device ptr,用于存储条件值96 uint64_t *devAddr_{nullptr}; // device ptr,用于存储条件值
97 Context *context_{nullptr};97 Context *context_{nullptr};
98- rtInnerObject handle_ {};98+ rtInnerObject handle_{};
99 std::vector<Model *> subCaptureModels_; // 当前condHandle的model列表99 std::vector<Model *> subCaptureModels_; // 当前condHandle的model列表
100 Notify *subModelNotify_{nullptr}; // 所有submodel共用同一个notify,避免重复申请100 Notify *subModelNotify_{nullptr}; // 所有submodel共用同一个notify,避免重复申请
101};101};
@@ -32,8 +32,11 @@ bool CheckCaptureModeSupport(const Context* ctx, const char* funcName);
32bool NeedReBuildSqe(const TaskInfo *const task);32bool NeedReBuildSqe(const TaskInfo *const task);
33bool IsUseHardwareEvent(Device * const dev);33bool IsUseHardwareEvent(Device * const dev);
34rtError_t AllocNotifyIdForSubModel(Model * const mdl, Notify *notify);34rtError_t AllocNotifyIdForSubModel(Model * const mdl, Notify *notify);
35-rtError_t ReleaseNotifyResWhenSendEndGraphFailed(Model * const mdl, Notify *notify);35+rtError_t ReleaseNotify(Model * const mdl, Notify *notify);
36uint32_t FindStreamIdInSubModels(CaptureModel * const parentModel, const uint16_t sqId);36uint32_t FindStreamIdInSubModels(CaptureModel * const parentModel, const uint16_t sqId);
37+bool IsStreamBindWithSubModel(Stream * const stream);
38+bool IsTaskBelongToSubCaptureMdl(const TaskInfo * const task);
39+ 
37}40}
38}41}
39 42 
@@ -65,7 +65,7 @@ typedef struct tagTaskInfoStru {
65 uint8_t isNoRingbuffer : 1;65 uint8_t isNoRingbuffer : 1;
66 uint8_t taskOwner : 1; // 默认是user,使用此标记需关注其实际值66 uint8_t taskOwner : 1; // 默认是user,使用此标记需关注其实际值
67 uint8_t resv : 4;67 uint8_t resv : 4;
68- uint8_t sqeNum : 7;68+ uint8_t sqeNum : 7; // 使用sqeNum必须在对应taskini中初始化
69 uint8_t needPostProc : 1;69 uint8_t needPostProc : 1;
70 /*-------------------------tmp begine---------------------------------------*/70 /*-------------------------tmp begine---------------------------------------*/
71 // DavinciMultiTaskInfo、PCTraceTaskInfo:71 // DavinciMultiTaskInfo、PCTraceTaskInfo:
@@ -133,10 +133,10 @@ typedef struct tagTaskInfoStru {
133 DebugUnRegisterTaskInfo debugUnRegisterTask;133 DebugUnRegisterTaskInfo debugUnRegisterTask;
134 FusionDumpAddrSetTaskInfo fusionDumpAddrSetTask;134 FusionDumpAddrSetTaskInfo fusionDumpAddrSetTask;
135 DebugRegisterForStreamTaskInfo debugRegisterForStreamTask;135 DebugRegisterForStreamTaskInfo debugRegisterForStreamTask;
136- DebugUnRegForStreamTaskInfo debugUnRegisterForStreamTask;136+ DebugUnRegForStreamTaskInfo debugUnRegisterForStreamTask;
137- TimeoutSetTaskInfo timeoutSetTask;137+ TimeoutSetTaskInfo timeoutSetTask;
138- GetDevMsgTaskInfo getDevMsgTask;138+ GetDevMsgTaskInfo getDevMsgTask;
139- FlipTaskInfo flipTask;139+ FlipTaskInfo flipTask;
140 SqLockUnlockTaskInfo sqLockUnlockTask;140 SqLockUnlockTaskInfo sqLockUnlockTask;
141 CmoAddrTaskInfo cmoAddrTaskInfo;141 CmoAddrTaskInfo cmoAddrTaskInfo;
142 UpdateAddressTaskInfo updateAddrTask;142 UpdateAddressTaskInfo updateAddrTask;
@@ -318,12 +318,9 @@ rtError_t ApiErrorDecorator::StreamTaskClean(Stream * const stm)
318 ErrorCode::EE1011, __func__, "RT_STREAM_AICPU", "stream flag", 318 ErrorCode::EE1011, __func__, "RT_STREAM_AICPU", "stream flag",
319 "AICPU stream " + std::to_string(stm->Id_()) + " does not support stream task clearance");319 "AICPU stream " + std::to_string(stm->Id_()) + " does not support stream task clearance");
320 NULL_PTR_RETURN_MSG(stm->Model_(), RT_ERROR_STREAM_MODEL);320 NULL_PTR_RETURN_MSG(stm->Model_(), RT_ERROR_STREAM_MODEL);
321- Stream *captureStream = stm->GetCaptureStream();
322- if (captureStream != nullptr) {
323- COND_RETURN_WARN(captureStream->IsSubCaptureModel(), RT_ERROR_FEATURE_NOT_SUPPORT, "stream belongs to sub ACL Graph, does not support cleaning tasks");
324- }
325 COND_RETURN_AND_MSG_OUTER((!stm->Model_()->IsModelLoadComplete()), RT_ERROR_STREAM_INVALID, ErrorCode::EE1017, 321 COND_RETURN_AND_MSG_OUTER((!stm->Model_()->IsModelLoadComplete()), RT_ERROR_STREAM_INVALID, ErrorCode::EE1017,
326 __func__, "stream", "Model " + std::to_string(stm->Model_()->Id_()) + " where stream " + std::to_string(stm->Id_()) + " is located has not been loaded. Clear stream tasks after the model is loaded");322 __func__, "stream", "Model " + std::to_string(stm->Model_()->Id_()) + " where stream " + std::to_string(stm->Id_()) + " is located has not been loaded. Clear stream tasks after the model is loaded");
323+ COND_RETURN_WARN(IsStreamBindWithSubModel(stm), RT_ERROR_FEATURE_NOT_SUPPORT, "stream belongs to sub ACL Graph, does not support cleaning tasks");
327 return impl_->StreamTaskClean(stm);324 return impl_->StreamTaskClean(stm);
328}325}
329 326 
@@ -4961,10 +4961,7 @@ rtError_t ApiImpl::LabelSet(Label * const lbl, Stream * const stm)
4961 COND_RETURN_AND_MSG_INVALID_CONTEXT(stm->Context_() != curCtx, RT_ERROR_STREAM_CONTEXT, 4961 COND_RETURN_AND_MSG_INVALID_CONTEXT(stm->Context_() != curCtx, RT_ERROR_STREAM_CONTEXT,
4962 "stream " + std::to_string(stm->Id_()));4962 "stream " + std::to_string(stm->Id_()));
4963 4963 
4964- Stream *captureStream = stm->GetCaptureStream();4964+ COND_RETURN_WARN(IsStreamBindWithSubModel(stm), RT_ERROR_FEATURE_NOT_SUPPORT, "stream belongs to sub ACL Graph, does not support setting label");
4965- if (captureStream != nullptr) {
4966- COND_RETURN_WARN(captureStream->IsSubCaptureModel(), RT_ERROR_FEATURE_NOT_SUPPORT, "stream belongs to sub ACL Graph, does not support setting label");
4967- }
4968 4965 
4969 return lbl->Set(stm);4966 return lbl->Set(stm);
4970}4967}
@@ -4979,16 +4976,13 @@ rtError_t ApiImpl::LabelGoto(Label * const lbl, Stream * const stm)
4979 COND_RETURN_AND_MSG_INVALID_CONTEXT(stm->Context_() != curCtx, RT_ERROR_STREAM_CONTEXT, 4976 COND_RETURN_AND_MSG_INVALID_CONTEXT(stm->Context_() != curCtx, RT_ERROR_STREAM_CONTEXT,
4980 "stream " + std::to_string(stm->Id_()));4977 "stream " + std::to_string(stm->Id_()));
4981 4978 
4982- Stream *captureStream = stm->GetCaptureStream();
4983- if (captureStream != nullptr) {
4984- COND_RETURN_WARN(captureStream->IsSubCaptureModel(), RT_ERROR_FEATURE_NOT_SUPPORT, "stream belongs to sub ACL Graph, does not support goto label");
4985- }
4986- 
4987#ifndef CFG_DEV_PLATFORM_PC4979#ifndef CFG_DEV_PLATFORM_PC
4988 const uint32_t ver = curCtx->Device_()->GetTschVersion();4980 const uint32_t ver = curCtx->Device_()->GetTschVersion();
4989 COND_RETURN_ERROR_MSG_INNER(ver >= TS_VERSION_MORE_LABEL, RT_ERROR_FEATURE_NOT_SUPPORT,4981 COND_RETURN_ERROR_MSG_INNER(ver >= TS_VERSION_MORE_LABEL, RT_ERROR_FEATURE_NOT_SUPPORT,
4990 "Old label goto is not supported for 64K labels.");4982 "Old label goto is not supported for 64K labels.");
4991#endif4983#endif
4984+ 
4985+ COND_RETURN_WARN(IsStreamBindWithSubModel(stm), RT_ERROR_FEATURE_NOT_SUPPORT, "stream belongs to sub ACL Graph, does not support goto label");
4992 return lbl->Goto(stm);4986 return lbl->Goto(stm);
4993}4987}
4994 4988 
@@ -5323,10 +5317,7 @@ rtError_t ApiImpl::LabelSwitchByIndex(void * const ptr, const uint32_t maxVal, v
5323 COND_RETURN_AND_MSG_OUTER(stm->GetModelNum() == 0, RT_ERROR_STREAM_MODEL, ErrorCode::EE1011, __func__,5317 COND_RETURN_AND_MSG_OUTER(stm->GetModelNum() == 0, RT_ERROR_STREAM_MODEL, ErrorCode::EE1011, __func__,
5324 0, "stm->modelNum", "The stream is not bound to a model");5318 0, "stm->modelNum", "The stream is not bound to a model");
5325 5319 
5326- Stream *captureStream = stm->GetCaptureStream();5320+ COND_RETURN_WARN(IsStreamBindWithSubModel(stm), RT_ERROR_FEATURE_NOT_SUPPORT, "stream belongs to sub ACL Graph, does not support switching label by index");
5327- if (captureStream != nullptr) {
5328- COND_RETURN_WARN(captureStream->IsSubCaptureModel(), RT_ERROR_FEATURE_NOT_SUPPORT, "stream belongs to sub ACL Graph, does not support switching label by index");
5329- }
5330 5321 
5331 return CondLabelSwitchByIndex(ptr, maxVal, labelInfoPtr, stm);5322 return CondLabelSwitchByIndex(ptr, maxVal, labelInfoPtr, stm);
5332}5323}
@@ -5339,10 +5330,7 @@ rtError_t ApiImpl::LabelGotoEx(Label * const lbl, Stream * const stm)
5339 "stream " + std::to_string(stm->Id_()));5330 "stream " + std::to_string(stm->Id_()));
5340 COND_RETURN_AND_MSG_INVALID_CONTEXT(lbl->Context_() != curCtx, RT_ERROR_LABEL_CONTEXT, "label");5331 COND_RETURN_AND_MSG_INVALID_CONTEXT(lbl->Context_() != curCtx, RT_ERROR_LABEL_CONTEXT, "label");
5341 5332 
5342- Stream *captureStream = stm->GetCaptureStream();5333+ COND_RETURN_WARN(IsStreamBindWithSubModel(stm), RT_ERROR_FEATURE_NOT_SUPPORT, "stream belongs to sub ACL Graph, does not support goto label extended");
5343- if (captureStream != nullptr) {
5344- COND_RETURN_WARN(captureStream->IsSubCaptureModel(), RT_ERROR_FEATURE_NOT_SUPPORT, "stream belongs to sub ACL Graph, does not support goto label extended");
5345- }
5346 5334 
5347#ifndef CFG_DEV_PLATFORM_PC5335#ifndef CFG_DEV_PLATFORM_PC
5348 const uint32_t ver = curCtx->Device_()->GetTschVersion();5336 const uint32_t ver = curCtx->Device_()->GetTschVersion();
@@ -9156,6 +9144,9 @@ rtError_t ApiImpl::TaskGetParams(rtTask_t task, rtTaskParams* const params)
9156 return RT_ERROR_INVALID_VALUE;9144 return RT_ERROR_INVALID_VALUE;
9157 }9145 }
9158 9146 
9147+ COND_RETURN_WARN(IsTaskBelongToSubCaptureMdl(taskInfo),
9148+ RT_ERROR_FEATURE_NOT_SUPPORT, "task belongs to sub ACL Graph, does not support querying task type");
9149+ 
9159 (void)memset_s(params, sizeof(rtTaskParams), 0, sizeof(rtTaskParams));9150 (void)memset_s(params, sizeof(rtTaskParams), 0, sizeof(rtTaskParams));
9160 error = ConvertTaskType(taskInfo, &params->type);9151 error = ConvertTaskType(taskInfo, &params->type);
9161 ERROR_RETURN(error, "get task type failed, retCode=%d.", error);9152 ERROR_RETURN(error, "get task type failed, retCode=%d.", error);
@@ -9315,16 +9306,15 @@ rtError_t ApiImpl::StreamGetTasks(Stream * const stm, void **tasks, uint32_t *nu
9315 "The stream is not bound to a model.");9306 "The stream is not bound to a model.");
9316 Model* const mdl = stm->Model_();9307 Model* const mdl = stm->Model_();
9317 NULL_PTR_RETURN(mdl, RT_ERROR_MODEL_NULL);9308 NULL_PTR_RETURN(mdl, RT_ERROR_MODEL_NULL);
9318- Stream *captureStream = stm->GetCaptureStream();9309+ COND_RETURN_WARN(IsStreamBindWithSubModel(stm), RT_ERROR_FEATURE_NOT_SUPPORT, "stream belongs to sub ACL Graph, does not support getting tasks");
9319- if (captureStream != nullptr) {
9320- COND_RETURN_WARN(captureStream->IsSubCaptureModel(), RT_ERROR_FEATURE_NOT_SUPPORT, "stream belongs to sub ACL Graph, does not support getting tasks");
9321- }
9322 return stm->StreamGetTasks(tasks, numTasks);9310 return stm->StreamGetTasks(tasks, numTasks);
9323}9311}
9324 9312 
9325rtError_t ApiImpl::TaskGetType(rtTask_t task, rtTaskType *type)9313rtError_t ApiImpl::TaskGetType(rtTask_t task, rtTaskType *type)
9326{9314{
9327 const TaskInfo* const taskInfo = static_cast<const TaskInfo *>(task);9315 const TaskInfo* const taskInfo = static_cast<const TaskInfo *>(task);
9316+ COND_RETURN_WARN(IsTaskBelongToSubCaptureMdl(taskInfo),
9317+ RT_ERROR_FEATURE_NOT_SUPPORT, "task belongs to sub ACL Graph, does not support querying task type");
9328 return ConvertTaskType(taskInfo, type);9318 return ConvertTaskType(taskInfo, type);
9329}9319}
9330 9320 
@@ -160,7 +160,6 @@ void ErrorcodeManage::InitRtErrCodeMap()
160 "the capture was not initiated in this stream"};160 "the capture was not initiated in this stream"};
161 rtErrMap_[RT_ERROR_STREAM_CAPTURE_WRONG_THREAD] = {ACL_ERROR_RT_STREAM_CAPTURE_WRONG_THREAD,161 rtErrMap_[RT_ERROR_STREAM_CAPTURE_WRONG_THREAD] = {ACL_ERROR_RT_STREAM_CAPTURE_WRONG_THREAD,
162 "end capture in the wrong thread"};162 "end capture in the wrong thread"};
163- rtErrMap_[RT_ERROR_STREAM_NOT_SUPPORT_OPERA] = {ACL_ERROR_RT_STREAM_NOT_SUPPORT_OPERA, "stream does not support this operation"};
164 rtErrMap_[RT_ERROR_STREAM_SUB_ACLGRAPH_IS_CAPTURING] = {ACL_ERROR_RT_SUB_ACLGRAPH_IS_CAPTURING, "the sub ACL Graph is capturing"};163 rtErrMap_[RT_ERROR_STREAM_SUB_ACLGRAPH_IS_CAPTURING] = {ACL_ERROR_RT_SUB_ACLGRAPH_IS_CAPTURING, "the sub ACL Graph is capturing"};
165 164 
166 // model error165 // model error
@@ -1570,7 +1570,7 @@ rtError_t Context::ModelAddEndGraph(Model * const mdl, Stream * const stm, const
1570 1570 
1571 error = notify->Record(stm);1571 error = notify->Record(stm);
1572 if (error != RT_ERROR_NONE) {1572 if (error != RT_ERROR_NONE) {
1573- (void)ReleaseNotifyResWhenSendEndGraphFailed(mdl, notify);1573+ (void)ReleaseNotify(mdl, notify);
1574 RT_LOG(RT_LOG_ERROR, "Notify record failed, retCode=%#x", error);1574 RT_LOG(RT_LOG_ERROR, "Notify record failed, retCode=%#x", error);
1575 return error;1575 return error;
1576 }1576 }
@@ -68,13 +68,6 @@ rtError_t ConvertTaskType(const TaskInfo * const task, rtTaskType *type)
68 COND_RETURN_ERROR((task->stream == nullptr), RT_ERROR_INVALID_VALUE,68 COND_RETURN_ERROR((task->stream == nullptr), RT_ERROR_INVALID_VALUE,
69 "The stream associated with the task does not exist, taskId=%u.", task->id);69 "The stream associated with the task does not exist, taskId=%u.", task->id);
70 70 
71- Model* const mdl = task->stream->Model_();
72- if (mdl != nullptr && mdl->GetModelType() == RT_MODEL_CAPTURE_MODEL) {
73- CaptureModel *captureModel = dynamic_cast<CaptureModel *>(mdl);
74- COND_RETURN_WARN(((captureModel != nullptr) && captureModel->IsSubCaptureModel()),
75- RT_ERROR_FEATURE_NOT_SUPPORT, "task belongs to sub ACL Graph, does not support querying task type");
76- }
77- 
78 rtTaskType taskType = rtTaskType::RT_TASK_DEFAULT;71 rtTaskType taskType = rtTaskType::RT_TASK_DEFAULT;
79 if (task->taskOwner == static_cast<uint8_t>(TaskOwner::RT_TASK_INNER)) {72 if (task->taskOwner == static_cast<uint8_t>(TaskOwner::RT_TASK_INNER)) {
80 *type = taskType;73 *type = taskType;
@@ -256,7 +256,6 @@ rtError_t StreamAddCondTask(CondHandle *condHandle, rtCondTaskParams params, Str
256 std::function<void()> const errSubModelRecycle = [&condHandle, &params]() {256 std::function<void()> const errSubModelRecycle = [&condHandle, &params]() {
257 condHandle->SubModelDestroy();257 condHandle->SubModelDestroy();
258 memset_s(params.modelRIArray, params.size * sizeof(rtModel_t), 0x0U, params.size * sizeof(rtModel_t));258 memset_s(params.modelRIArray, params.size * sizeof(rtModel_t), 0x0U, params.size * sizeof(rtModel_t));
259- //condHandleTaskMap_也要清理 todo
260 };259 };
261 ScopeGuard subModelErrRecycle(errSubModelRecycle);260 ScopeGuard subModelErrRecycle(errSubModelRecycle);
262 261 
@@ -23,6 +23,7 @@
23#include "event.hpp"23#include "event.hpp"
24#include "kernel_utils.hpp"24#include "kernel_utils.hpp"
25#include "stream_jetty_handler.h"25#include "stream_jetty_handler.h"
26+#include "capture_model_utils.hpp"
26 27 
27namespace cce {28namespace cce {
28namespace runtime {29namespace runtime {
@@ -1910,6 +1911,9 @@ static rtError_t CheckUpdatingTaskParams(TaskInfo* const taskInfo, rtTaskParams*
1910 COND_RETURN_ERROR(params->opInfoPtr != nullptr, RT_ERROR_INVALID_VALUE, "opInfoPtr must be nullptr");1911 COND_RETURN_ERROR(params->opInfoPtr != nullptr, RT_ERROR_INVALID_VALUE, "opInfoPtr must be nullptr");
1911 COND_RETURN_ERROR(params->opInfoSize != 0U, RT_ERROR_INVALID_VALUE, "opInfoSize must be 0");1912 COND_RETURN_ERROR(params->opInfoSize != 0U, RT_ERROR_INVALID_VALUE, "opInfoSize must be 0");
1912 1913 
1914+ COND_RETURN_WARN(IsTaskBelongToSubCaptureMdl(taskInfo),
1915+ RT_ERROR_FEATURE_NOT_SUPPORT, "task belongs to sub ACL Graph, does not support updating task parameters");
1916+ 
1913 return RT_ERROR_NONE;1917 return RT_ERROR_NONE;
1914}1918}
1915 1919 
@@ -30,7 +30,7 @@ uint32_t GetSendSqeNum(TaskInfo * const taskInfo)
30 (type == TS_TASK_TYPE_IPC_WAIT)) {30 (type == TS_TASK_TYPE_IPC_WAIT)) {
31 return GetSendSqeNumForMemWaitTask(taskInfo);31 return GetSendSqeNumForMemWaitTask(taskInfo);
32 } else if (type == TS_TASK_TYPE_CAPTURE_CONDITION) {32 } else if (type == TS_TASK_TYPE_CAPTURE_CONDITION) {
33- return taskInfo->sqeNum;33+ return taskInfo->sqeNum; // 使用sqeNum必须在对应taskini中初始化
34 } else {34 } else {
35 return 1U;35 return 1U;
36 }36 }
@@ -296,7 +296,7 @@ rtError_t AllocNotifyIdForSubModel(Model * const mdl, Notify *notify)
296 return RT_ERROR_NONE;296 return RT_ERROR_NONE;
297}297}
298 298 
299-rtError_t ReleaseNotifyResWhenSendEndGraphFailed(Model * const mdl, Notify *notify)299+rtError_t ReleaseNotify(Model * const mdl, Notify *notify)
300{300{
301 /* 非aclgraph的,走老流程 */301 /* 非aclgraph的,走老流程 */
302 if (mdl->GetModelType() != RT_MODEL_CAPTURE_MODEL) {302 if (mdl->GetModelType() != RT_MODEL_CAPTURE_MODEL) {
@@ -350,5 +350,39 @@ uint32_t FindStreamIdInSubModels(CaptureModel * const parentModel, const uint16_
350 return UINT32_MAX;350 return UINT32_MAX;
351}351}
352 352 
353+bool IsTaskBelongToSubCaptureMdl(const TaskInfo * const task)
354+{
355+ Stream *stm = task->stream;
356+ COND_PROC((stm == nullptr), return false);
357+ 
358+ Model* const mdl = stm->Model_();
359+ COND_PROC(mdl == nullptr, return false;);
360+ 
361+ CaptureModel *captureModel = dynamic_cast<CaptureModel *>(mdl);
362+ COND_PROC(captureModel == nullptr, return false;);
363+ 
364+ COND_RETURN_WARN(captureModel->IsSubCaptureModel(), true,
365+ "model is sub ACL Graph, does not support current operation.");
366+ 
367+ return false;
368+}
369+ 
370+bool IsStreamBindWithSubModel(Stream * const stream)
371+{
372+ Stream *captureStream = stream->GetCaptureStream();
373+ COND_PROC(captureStream == nullptr, return false;);
374+ 
375+ Model * mdl = captureStream->Model_();
376+ COND_PROC(mdl == nullptr, return false;);
377+ 
378+ CaptureModel *captureModel = dynamic_cast<CaptureModel *>(mdl);
379+ COND_PROC(captureModel == nullptr, return false;);
380+ 
381+ COND_RETURN_WARN(captureModel->IsSubCaptureModel(), true,
382+ "stream belongs to sub ACL Graph, does not support current operation.");
383+ 
384+ return false;
385+}
386+ 
353} // namespace runtime387} // namespace runtime
354} // namespace cce388} // namespace cce
@@ -39,8 +39,10 @@ bool NeedReBuildSqe(const TaskInfo *const task) { UNUSED(task); return false; }
39 39 
40bool IsUseHardwareEvent(Device * const dev) { UNUSED(dev); return false; }40bool IsUseHardwareEvent(Device * const dev) { UNUSED(dev); return false; }
41rtError_t AllocNotifyIdForSubModel(Model * const mdl, Notify *notify) { UNUSED(mdl); UNUSED(notify); return RT_ERROR_FEATURE_NOT_SUPPORT; }41rtError_t AllocNotifyIdForSubModel(Model * const mdl, Notify *notify) { UNUSED(mdl); UNUSED(notify); return RT_ERROR_FEATURE_NOT_SUPPORT; }
42-rtError_t ReleaseNotifyResWhenSendEndGraphFailed(Model * const mdl, Notify *notify) { UNUSED(mdl); UNUSED(notify); return RT_ERROR_FEATURE_NOT_SUPPORT; }42+rtError_t ReleaseNotify(Model * const mdl, Notify *notify) { UNUSED(mdl); UNUSED(notify); return RT_ERROR_FEATURE_NOT_SUPPORT; }
43-uint32_t FindStreamIdInSubModels(CaptureModel * const parentModel, const uint16_t sqId) { UNUSED(parentModel); UNUSED(sqId); return RT_ERROR_FEATURE_NOT_SUPPORT; }43+uint32_t FindStreamIdInSubModels(CaptureModel * const parentModel, const uint16_t sqId) { UNUSED(parentModel); UNUSED(sqId); return UINT32_MAX; }
44+bool IsStreamBindWithSubModel(Stream * const stream) { UNUSED(stream); return false; }
45+bool IsTaskBelongToSubCaptureMdl(const TaskInfo * const task) { UNUSED(task); return false; }
44 46 
45}47}
46}48}
@@ -747,7 +747,7 @@ rtError_t MdlAddEndGraph(Model * const mdl, Stream * const stm, const uint32_t f
747 }747 }
748 748 
749 error = NtyRecord(notify, stm);749 error = NtyRecord(notify, stm);
750- ERROR_PROC_RETURN_MSG_INNER(error, (void)ReleaseNotifyResWhenSendEndGraphFailed(mdl, notify);,750+ ERROR_PROC_RETURN_MSG_INNER(error, (void)ReleaseNotify(mdl, notify);,
751 "Notify record failed, retCode=%#x.", static_cast<uint32_t>(error));751 "Notify record failed, retCode=%#x.", static_cast<uint32_t>(error));
752 752 
753 notify->SetEndGraphModel(mdl);753 notify->SetEndGraphModel(mdl);