Browse Source

Support for custom operator.

tags/v1.1.0
unknown 4 years ago
parent
commit
c323cb229a
2 changed files with 5 additions and 5 deletions
  1. +4
    -4
      ge/graph/load/new_model_manager/model_manager.cc
  2. +1
    -1
      ge/single_op/single_op_model.cc

+ 4
- 4
ge/graph/load/new_model_manager/model_manager.cc View File

@@ -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<uintptr_t>(rt_cur_ctx);
uintptr_t resource_id = reinterpret_cast<uintptr_t>(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<uintptr_t>(rt_cur_ctx);
GELOGI("ClearAICPUSo in. resource_id = 0x%lx.", static_cast<uint64_t>(ctx_id));
auto ctx_id = reinterpret_cast<uintptr_t>(ctx);
GELOGI("ClearAICPUSo in. resource_id = 0x%lx", static_cast<uint64_t>(ctx_id));
std::lock_guard<std::mutex> 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());


+ 1
- 1
ge/single_op/single_op_model.cc View File

@@ -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) {


Loading…
Cancel
Save