diff --git a/dicp/dicp/vendor/AscendGraph/codegen/graph_utils.h b/dicp/dicp/vendor/AscendGraph/codegen/graph_utils.h index 380670146..69e06fec8 100644 --- a/dicp/dicp/vendor/AscendGraph/codegen/graph_utils.h +++ b/dicp/dicp/vendor/AscendGraph/codegen/graph_utils.h @@ -12,6 +12,7 @@ #include #include +#include "acl/acl.h" #include "all_ops.h" #include "ascend_string.h" #include "ge_api.h" @@ -83,10 +84,9 @@ class AclgraphBuilder { public: explicit AclgraphBuilder() { // 1. system init - std::string kSocVersion = "Ascend910ProB"; + auto kSocVersion = aclrtGetSocName(); std::map global_options = { - {AscendString(ge::ir_option::SOC_VERSION), - AscendString(kSocVersion.c_str())}, + {AscendString(ge::ir_option::SOC_VERSION), AscendString(kSocVersion)}, {AscendString(ge::ir_option::PRECISION_MODE), "allow_fp32_to_fp16"}, }; auto status = aclgrphBuildInitialize(global_options); diff --git a/dicp/dicp/vendor/AscendGraph/compile_job.py b/dicp/dicp/vendor/AscendGraph/compile_job.py index 6b3b2b822..625dc3dfb 100644 --- a/dicp/dicp/vendor/AscendGraph/compile_job.py +++ b/dicp/dicp/vendor/AscendGraph/compile_job.py @@ -34,6 +34,7 @@ def __init__(self, source_code) -> None: '-std=c++11', '-O3', '-Wall', + '-I/usr/local/Ascend/ascend-toolkit/latest/include', '-I/usr/local/Ascend/ascend-toolkit/latest/opp/built-in/op_proto/inc', '-I/usr/local/Ascend/ascend-toolkit/latest/include/graph', '-I/usr/local/Ascend/ascend-toolkit/latest/include/ge', @@ -46,10 +47,10 @@ def __init__(self, source_code) -> None: '-lge_runner', source_path, '-o' + self._lib_path, - '-Wl,-rpath,/usr/local/Ascend/ascend-toolkit/latest/compiler/lib64/stub', '/usr/local/Ascend/ascend-toolkit/latest/compiler/lib64/stub/libgraph.so', '/usr/local/Ascend/ascend-toolkit/latest/compiler/lib64/stub/libge_runner.so', - '/usr/local/Ascend/ascend-toolkit/latest/lib64/libgraph_base.so'] + '/usr/local/Ascend/ascend-toolkit/latest/lib64/libgraph_base.so', + '/usr/local/Ascend/ascend-toolkit/latest/runtime/lib64/stub/libascendcl.so',] def _compile(self): if not os.path.exists(self._lib_path):