aclmdlSetExecConfigOpt

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Function Usage

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

This API must be used together with other APIs to implement model execution. The API call sequence is as follows:
  1. Call aclmdlCreateExecConfigHandle to create a configuration object for model execution.
  2. Call aclmdlSetExecConfigOpt multiple times to set the value of each attribute in the configuration object.
  3. Call aclmdlExecuteV2 or aclmdlExecuteAsyncV2 to specify the configuration information required for model execution and execute the model.
  4. After the model is successfully loaded, call aclmdlDestroyExecConfigHandle to destroy the configuration object.

Prototype

1
aclError aclmdlSetExecConfigOpt(aclmdlExecConfigHandle *handle, aclmdlExecConfigAttr attr, const void *attrValue, size_t valueSize)

Parameters

Parameter

Input/Output

Description

handle

Output

Pointer to the configuration object executed by the model. For details about the type definition, see aclmdlExecConfigHandle.

Call aclmdlCreateExecConfigHandle to create an object in advance.

attr

Input

Attribute to set. For details about the type definition, see aclmdlExecConfigAttr.

attrValue

Input

Pointer to the attr value to set.

If the attribute value itself is a pointer, pass the address of the pointer.

valueSize

Input

Data length of attrValue.

You can use the sizeof(*attrValue) function in the C/C++ standard library to query the data length.

Returns

0 on success; else, failure. For details, see aclError.