From c323cb229a32d2ced20e0b898341669d760e840d Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Oct 2020 21:01:46 +0800 Subject: [PATCH] Support for custom operator. --- ge/graph/load/new_model_manager/model_manager.cc | 8 ++++---- ge/single_op/single_op_model.cc | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ge/graph/load/new_model_manager/model_manager.cc b/ge/graph/load/new_model_manager/model_manager.cc index 960b814e..bdcc40f9 100755 --- a/ge/graph/load/new_model_manager/model_manager.cc +++ b/ge/graph/load/new_model_manager/model_manager.cc @@ -1107,7 +1107,7 @@ Status ModelManager::LoadCustAicpuSo(const OpDescPtr op_desc, const string &so_n return RT_FAILED; } // use current context as resource key instead - resource_id = reinterpret_cast(rt_cur_ctx); + uintptr_t resource_id = reinterpret_cast(rt_cur_ctx); auto it = cust_aicpu_so_.find(resource_id); if (it == cust_aicpu_so_.end()) { GE_CHK_STATUS_RET(LaunchCustAicpuSo(op_desc, so_name), "LaunchCustAicpuSo failed. op name %s, so_name %s", @@ -1129,8 +1129,8 @@ Status ModelManager::LoadCustAicpuSo(const OpDescPtr op_desc, const string &so_n } Status ModelManager::ClearAICPUSo(void *ctx) { - auto ctx_id = reinterpret_cast(rt_cur_ctx); - GELOGI("ClearAICPUSo in. resource_id = 0x%lx.", static_cast(ctx_id)); + auto ctx_id = reinterpret_cast(ctx); + GELOGI("ClearAICPUSo in. resource_id = 0x%lx", static_cast(ctx_id)); std::lock_guard lock(cust_aicpu_mutex_); auto it = cust_aicpu_so_.find(ctx_id); if (it == cust_aicpu_so_.end()) { @@ -1140,7 +1140,7 @@ Status ModelManager::ClearAICPUSo(void *ctx) { return SUCCESS; } -Status ModelManager::LaunchCustAicpuSo(const OpDescPtr op_desc, string so_name) { +Status ModelManager::LaunchCustAicpuSo(const OpDescPtr op_desc, const string &so_name) { CustAICPUKernelPtr aicpu_kernel = op_desc->TryGetExtAttr(OP_EXTATTR_CUSTAICPU_KERNEL, CustAICPUKernelPtr()); if (aicpu_kernel == nullptr) { GELOGE(INTERNAL_ERROR, "cust aicpu op %s can't find kernel!", op_desc->GetName().c_str()); diff --git a/ge/single_op/single_op_model.cc b/ge/single_op/single_op_model.cc index 3c5043cc..a1e1e7dd 100755 --- a/ge/single_op/single_op_model.cc +++ b/ge/single_op/single_op_model.cc @@ -257,7 +257,7 @@ Status SingleOpModel::BuildTaskList(SingleOp &single_op) { } single_op.tasks_.emplace_back(task); } else { - GELOGE(UNSUPPORTED, "Only TBE kernel, AI_CPU, CUST_AI_CPU kernel are supported, but got %u", context.kernel_type()); + GELOGE(UNSUPPORTED, "Only TBE, AI_CPU, CUST_AI_CPU kernel are supported, but got %u", context.kernel_type()); return UNSUPPORTED; } } else if (task_type == RT_MODEL_TASK_KERNEL_EX) {