aclmdlRIGetTasksByStream

Note: This API is for trial use and may be changed in later versions. It is not available in production environments.

Applicable Products

Product

Supported

Ascend 950PR/Ascend 950DT

☓

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

☓

Atlas inference products

☓

Atlas training products

☓

Function

Obtains all tasks in a specified stream.

Before calling this API to obtain all tasks in a specified stream, call aclmdlRIGetStreams to obtain all streams associated with the model running instance.

You can call this API twice to obtain all tasks in a specified stream.

  1. First call: Pass a null pointer as tasks and any non-negative integer as numTasks to aclmdlRIGetTasksByStream to obtain the number of tasks in the specified stream via numTasks.
  2. Second call: Allocate an array for tasks with the size equal to the numTasks value from the first call. Then, pass tasks and numTasks as inputs to aclmdlRIGetTasksByStream to obtain all tasks in the specified stream.

Prototype

1
aclError aclmdlRIGetTasksByStream(aclrtStream stream, aclmdlRITask *tasks, uint32_t *numTasks)

Parameters

Parameter

Input/Output

Description

stream

Input

Stream. For details about the type definition, see aclrtStream.

The stream to be passed must be associated with the model running instance.

tasks

Input/Output

If a null pointer is passed as tasks, the number of tasks in the specified stream is obtained. This number is returned via numTasks.

If an array with the size equal to the numTasks value is passed as tasks, all tasks in the specified stream are obtained. For details about the type definition, see aclmdlRITask.

numTasks

Input/Output

When used as an input, it indicates the array size of tasks.

When used as an output, it indicates the number of tasks in the specified stream.

Returns

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