aclmdlRIBuildBegin

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

Starts building a model runtime instance.

After aclmdlRIBuildBegin is called, call aclmdlRIBindStream to bind the model runtime instance to a stream, and then dispatch tasks to the stream. After all tasks are dispatched, call aclmdlRIEndTask to mark the end of task dispatch on the stream, and then call aclmdlRIBuildEnd to end model building. In this case, all tasks dispatched to the stream are not executed immediately. They are executed only when aclmdlRIExecute or aclmdlRIExecuteAsync is called to run model inference.

After all tasks are executed, if the model runtime instance is no longer used, call aclmdlRIUnbindStream to unbind it from the stream. If necessary, call aclmdlRIDestroy to destroy the resource.

Prototype

1
aclError aclmdlRIBuildBegin(aclmdlRI *modelRI, uint32_t flag)

Parameters

Parameter

Input/Output

Description

modelRI

Input

Model runtime instance, whose model is used to temporarily store the built tasks. For the type definition, see aclmdlRI.

flag

Input

Reserved parameter. The value is fixed at 0.

Returns

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