|
@@ -131,6 +131,16 @@ static void GetOpsProtoPath(string &opsproto_path) { |
|
|
opsproto_path = (path_base + "ops/op_proto/custom/" + ":") + (path_base + "ops/op_proto/built-in/"); |
|
|
opsproto_path = (path_base + "ops/op_proto/custom/" + ":") + (path_base + "ops/op_proto/built-in/"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void LoadOpsProto() { |
|
|
|
|
|
string opsproto_path; |
|
|
|
|
|
GetOpsProtoPath(opsproto_path); |
|
|
|
|
|
GELOGI("Get opsproto path is %s", opsproto_path.c_str()); |
|
|
|
|
|
OpsProtoManager *manager = OpsProtoManager::Instance(); |
|
|
|
|
|
map<string, string> option_tmp; |
|
|
|
|
|
option_tmp.emplace(std::pair<string, string>(string("ge.opsProtoLibPath"), opsproto_path)); |
|
|
|
|
|
(void)manager->Initialize(option_tmp); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
graphStatus aclgrphBuildInitialize(std::map<std::string, std::string> global_options) { |
|
|
graphStatus aclgrphBuildInitialize(std::map<std::string, std::string> global_options) { |
|
|
GELOGD("Enter aclgrphInitialize start!"); |
|
|
GELOGD("Enter aclgrphInitialize start!"); |
|
|
// check global options |
|
|
// check global options |
|
@@ -142,8 +152,7 @@ graphStatus aclgrphBuildInitialize(std::map<std::string, std::string> global_opt |
|
|
// print global option map |
|
|
// print global option map |
|
|
ge::PrintOptionMap(global_options, "global option"); |
|
|
ge::PrintOptionMap(global_options, "global option"); |
|
|
|
|
|
|
|
|
Impl builder; |
|
|
|
|
|
builder.LoadOpsProto(); |
|
|
|
|
|
|
|
|
LoadOpsProto(); |
|
|
|
|
|
|
|
|
std::shared_ptr<ge::GELib> instance_ptr = ge::GELib::GetInstance(); |
|
|
std::shared_ptr<ge::GELib> instance_ptr = ge::GELib::GetInstance(); |
|
|
if (instance_ptr == nullptr || !instance_ptr->InitFlag()) { |
|
|
if (instance_ptr == nullptr || !instance_ptr->InitFlag()) { |
|
@@ -198,7 +207,7 @@ class Impl { |
|
|
bool is_dynamic_input); |
|
|
bool is_dynamic_input); |
|
|
void SetRtSocVersion(); |
|
|
void SetRtSocVersion(); |
|
|
void UpdateThreadContext(); |
|
|
void UpdateThreadContext(); |
|
|
void LoadOpsProto();s |
|
|
|
|
|
|
|
|
void LoadOpsProto(); |
|
|
public: |
|
|
public: |
|
|
ge::GeGenerator generator_; |
|
|
ge::GeGenerator generator_; |
|
|
std::map<std::string, std::string> options_; |
|
|
std::map<std::string, std::string> options_; |
|
@@ -340,16 +349,6 @@ void Impl::UpdateThreadContext() { |
|
|
GetThreadLocalContext().SetGraphOption(options_); |
|
|
GetThreadLocalContext().SetGraphOption(options_); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void Impl::LoadOpsProto() { |
|
|
|
|
|
string opsproto_path; |
|
|
|
|
|
GetOpsProtoPath(opsproto_path); |
|
|
|
|
|
GELOGI("Get opsproto path is %s", opsproto_path.c_str()); |
|
|
|
|
|
OpsProtoManager *manager = OpsProtoManager::Instance(); |
|
|
|
|
|
map<string, string> option_tmp; |
|
|
|
|
|
option_tmp.emplace(std::pair<string, string>(string("ge.opsProtoLibPath"), opsproto_path)); |
|
|
|
|
|
(void)manager->Initialize(option_tmp); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
graphStatus Impl::CreateInputsForIRBuild(const ge::Graph &graph, vector<ge::GeTensor> &inputs) { |
|
|
graphStatus Impl::CreateInputsForIRBuild(const ge::Graph &graph, vector<ge::GeTensor> &inputs) { |
|
|
auto compute_graph = ge::GraphUtils::GetComputeGraph(graph); |
|
|
auto compute_graph = ge::GraphUtils::GetComputeGraph(graph); |
|
|
GE_CHECK_NOTNULL(compute_graph); |
|
|
GE_CHECK_NOTNULL(compute_graph); |
|
|