Function: set_exec_config_opt

Applicable Products

Product

Supported (√/x)

Ascend 950PR/Ascend 950DT

√

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas training products

√

Atlas inference products

√

Atlas 200I/500 A2 inference products

√

Function Usage

Sets the value of each attribute of the configuration object executed by the model.

Prototype

  • C Prototype
    1
    aclError aclmdlSetExecConfigOpt(aclmdlExecConfigHandle *handle, aclmdlExecConfigAttr attr, const void *attrValue, size_t valueSize)
    
  • Python Function
    1
    ret = acl.mdl.set_exec_config_opt(handle, attr, attrValue)
    

Parameter Description

Parameter

Description

handle

Int, pointer address of the configuration object executed by the model. Call acl.mdl.create_exec_config_handle to create the pointer address in advance.

attr

Int, attribute to be set. For details, see aclmdlExecConfigAttr.

attrValue

Int, value corresponding to attr.

Return Value Description

Return Value

Description

ret

Int, error code: 0 on success; else, failure.

Restrictions

This API must be used together with other APIs to implement model execution. The API call sequence is as follows:
  1. Call acl.mdl.create_exec_config_handle to create a configuration object for model execution.
  2. Call acl.mdl.set_exec_config_opt multiple times to set the value of each attribute in the configuration object.
  3. Call acl.mdl.execute_v2 to specify the configuration information required for model execution, and execute the model.
  4. Call acl.mdl.destroy_exec_config_handle to destroy the configuration object after the model is successfully loaded.