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 filling rules, see the value of the ASCEND_COMPUTE_UNIT field in the CMakePresets.json file in the operator project directory. The value of this field is automatically generated when the uses msOpGen 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 the default values. The following table lists the parameters and their default values.

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

Configuration parameters

Description

Default

DynamicCompileStaticFlag

Indicates whether the operator implementation supports static shape build during graph input.

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 dynamic shape scenarios during graph input.

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 commissioning.

true