AddConfig

Function

Registers the AI Processor model and OpAICoreConfig information supported by an operator.

Prototype

1
2
void AddConfig(const char *soc)
void AddConfig(const char *soc, OpAICoreConfig &aicore_config)

Parameters

Parameter

Input/Output

Description

soc

Input

Supported AI Processor model. For details about the rules, see the ASCEND_COMPUTE_UNIT field in the build configuration file CMakePresets.json in the operator project directory. The value of this field is automatically generated when msOpGen is used to create a project.

aicore_config

Input

For details about the AI Core configuration, see OpAICoreConfig.

Returns

None

Restrictions

If the aicore_config parameter is not passed, some parameters in the OpAICoreConfig structure are set to default values. The following table lists the parameters and their default values.

Table 1 Default configuration of OpAICoreConfig when the aicore_config parameter is not passed

Parameter

Description

Default

DynamicCompileStaticFlag

Indicates whether the operator implementation supports static shape compilation during graph building.

true

DynamicFormatFlag

Determines whether to automatically infer the dtype and format supported by the operator inputs and outputs based on the function configured in SetOpSelectFormat.

true

DynamicRankSupportFlag

Determines whether an operator supports dynamicRanK (dynamic dimension).

true

DynamicShapeSupportFlag

Indicates whether the operator supports the dynamic shape scenario during graph building.

true

NeedCheckSupportFlag

Determines whether to call the operator parameter verification function to verify the data type and shape during operator fusion.

false

PrecisionReduceFlag

Controls the operator precision mode during ATC-based model conversion or network debugging.

true