|
|
@@ -29,6 +29,7 @@ uint64_t kFakeSize = 0x10000000UL; |
|
|
|
REGISTER_TASK_COMPILER(AiCoreTaskCompiler); |
|
|
|
} |
|
|
|
std::mutex AiCoreTaskCompiler::mu_; |
|
|
|
std::mutex AiCoreTaskCompiler::init_mu_; |
|
|
|
|
|
|
|
Status AiCoreTaskCompiler::Initialize() { |
|
|
|
auto ge_lib = GELib::GetInstance(); |
|
|
@@ -41,6 +42,10 @@ Status AiCoreTaskCompiler::Initialize() { |
|
|
|
auto &kernel_manager = ge_lib->OpsKernelManagerObj(); |
|
|
|
aic_kernel_store_ = kernel_manager.GetOpsKernelInfoStore("AIcoreEngine"); |
|
|
|
GE_CHECK_NOTNULL(aic_kernel_store_); |
|
|
|
std::lock_guard<std::mutex> lk(init_mu_); |
|
|
|
{ |
|
|
|
is_initialized_ = true; |
|
|
|
} |
|
|
|
return SUCCESS; |
|
|
|
} |
|
|
|
|
|
|
@@ -57,6 +62,16 @@ Status AiCoreTaskCompiler::DoCompileOp(const NodePtr &node) const { |
|
|
|
} |
|
|
|
|
|
|
|
Status AiCoreTaskCompiler::CompileOp(const NodePtr &node, std::vector<domi::TaskDef> &tasks) { |
|
|
|
if (!is_initialized_) { |
|
|
|
Status ret; |
|
|
|
ret = Initialize(); |
|
|
|
if (ret != SUCCESS) { |
|
|
|
GELOGE(FAILED, "[Check][State][%s] Offline inference not support online compile.", ori_node_name.c_str()); |
|
|
|
REPORT_INNER_ERROR("E19999", "[%s] Offline inference not support online compile.", ori_node_name.c_str()); |
|
|
|
return ret; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
GE_CHECK_NOTNULL(node); |
|
|
|
GELOGI("AiCoreTaskCompiler(%s) CompileOp Start.", node->GetName().c_str()); |
|
|
|
|
|
|
|