API List

This section mainly describes secure, easy-to-use graph construction APIs for app users or high-level frameworks to build models and set model graphs, operators in the graphs, and the inputs, outputs, and other operator attributes.

You can view the header file of the corresponding API in the include path in CANN component directory.

API Category

Header File Path/Library File

API List

Parser APIs

  • Header file
    • /include/parser/tensorflow_parser.h
    • /include/parser/caffe_parser.h

    Library file: libfmk_parser.so

  • Header file: /include/parser/onnx_parser.h

    Library file: libfmk_onnx_parser.so

aclgrphParseTensorFlow

aclgrphParseCaffe

aclgrphParseONNX

aclgrphParseONNXFromMem

Graph construction APIs

  • Header file: /include/graph/graph.h
  • Library file: libgraph.so

Graph Constructor and Destructor

SetInputs

SetOutputs

SetTargets

IsValid

SetNeedIteration

AddOp

FindOpByName

GetAllOpName

SaveToFile

LoadFromFile

FindOpByType

GetName

CopyFrom

LoadFromMem

SaveToMem

LoadFromSerializedModelArray

Graph modification APIs

Class Graph

  • Header file: /include/graph/graph.h
  • Library file: libgraph.so

GetAllNodes

GetDirectNode

RemoveNode

RemoveEdge

AddNodeByOp

AddDataEdge

AddControlEdge

ConstructFromInputs

Graph modification APIs

Class GNode

  • Header file: /include/graph/gnode.h
  • Library file: libgraph.so

GNode Constructor and Destructor

GetType

GetName

GetInDataNodesAndPortIndexs

GetInControlNodes

GetOutDataNodesAndPortIndexs

GetOutControlNodes

GetInputConstData

GetInputIndexByName

GetDynamicInputIndexesByName

GetOutputIndexByName

GetDynamicOutputIndexesByName

GetInputsSize

GetOutputsSize

GetInputDesc

UpdateInputDesc

GetOutputDesc

UpdateOutputDesc

SetAttr

GetAttr

HasAttr

GetSubgraph

GetALLSubgraphs

Graph Modification APIs > Class CustomPassContext

  • Header file: /include/register/register_custom_pass.h
  • Library file: libregister.so

CustomPassContext Constructor and Destructor

SetErrorMessage

Graph modification APIs > REGISTER_CUSTOM_PASS

  • Header file: /include/register/register_custom_pass.h
  • Library file: libregister.so

REGISTER_CUSTOM_PASS

Graph Modification APIs > PassRegistrationData

  • Header file: /include/register/register_custom_pass.h
  • Library file: libregister.so

PassRegistrationData Constructor and Destructor

CustomPassFn

Graph Modification APIs > Class PassReceiver

  • Header file: /include/register/register_custom_pass.h
  • Library file: libregister.so

PassReceiver Constructor and Destructor

Graph modification APIs

Class Session

  • Header file: /include/ge/ge_api.h
  • Library file: libge_runner.so

ShardGraphs

ShardGraphsToFile

SaveGraphsToPb

Graph modification APIs

Class GraphBuffer

  • Header file: /include/graph/graph_buffer.h
  • Library file: libgraph_base.so

GraphBuffer Constructor and Destructor

GetData

GetSize

Graph build APIs

  • Header file: /include/ge/ge_ir_build.h
  • Library file: libge_compiler.so

aclgrphBuildInitialize

aclgrphBuildModel

aclgrphSaveModel

aclgrphBuildFinalize

aclgrphConvertToWeightRefreshableGraphs

aclgrphBundleBuildModel

aclgrphBundleSaveModel

Graph running APIs

  • Header file: /include/ge/ge_api.h
  • Library file: libge_runner.so
  • Header file: /include/ge/ge_graph_compile_summary.h
  • Library file: libge_compiler.so

Atlas 200/300/500 Inference Product: APIs in this header file are not supported.

GEInitialize

GEFinalize

Session Constructor and Destructor

GetVariables

GetSessionId

AddGraph

AddGraphWithCopy

RemoveGraph

LoadGraph

GeSessionLoadGraph

RunGraph

RunGraphAsync

RunGraphWithStreamAsync

ExecuteGraphWithStreamAsync

GeSessionExecuteGraphWithStreamAsync

RunGraphDistribute

BuildGraph

CompileGraph

RegisterCallBackFunc

IsGraphNeedRebuild

GetCompiledGraphSummary

SetGraphConstMemoryBase

UpdateGraphFeatureMemoryBase

SetGraphFixedFeatureMemoryBase

SetGraphFixedFeatureMemoryBaseWithType

UpdateGraphRefreshableFeatureMemoryBase

RegisterExternalAllocator

UnregisterExternalAllocator

PaRemapped

GEGetErrorMsg

GEGetWarningMsg

GEGetErrorMsgV2

GEGetWarningMsgV2

Graph query APIs

  • Header file: /include/ge/ge_api.h
  • Library file: libge_runner.so

GetModelDistributeDesc

Quantization APIs

  • Header file: /include/amct/acl_graph_calibration.h
  • Library file: libamctacl.so

aclgrphCalibration

Maintenance and debugging APIs

  • Header file: /include/ge/ge_prof.h
  • Library file: libmsprofiler.so

Atlas 200/300/500 Inference Product: APIs in this header file are not supported.

aclgrphProfInit

aclgrphProfFinalize

aclgrphProfCreateConfig

aclgrphProfDestroyConfig

aclgrphProfStart

aclgrphProfStop

Other APIs

  • Header file: /include/ge/ge_ir_build.h
  • Library file: libge_compiler.so
  • Header file: /include/ge/ge_api_error_codes.h
  • Library file: libge_common_base.so

aclgrphDumpGraph

aclgrphSetOpAttr

aclgrphGetIRVersion

aclgrphGenerateForOp

GE_ERRORNO

Data types

  • Header file: /include/ge/ge_ir_build.h
  • Library file: libge_compiler.so

ModelBufferData

/include/ge/ge_api_types.h

aclgrphBuildInitialize Configuration Parameters

aclgrphBuildModel Configuration Parameters

Configuration Parameters of Model Parsing APIs

InputTensorInfo

OutputTensorInfo

MemoryType

  • Header file: /include/ge/ge_prof.h
  • Library file: libmsprofiler.so

Atlas 200/300/500 Inference Product: APIs in this header file are not supported.

ProfDataTypeConfig

ProfilingAicoreMetrics

/include/ge/ge_api_types.h

Atlas 200/300/500 Inference Product APIs in this header file are not supported.

Command-Line Options