GetStreamId

Applicability

Product

Supported or Not

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

Header File

#include <graph/kernel_launch_info.h>

Function Usage

Obtains the ID of the stream where the current task is located.

Prototype

1
uint32_t GetStreamId() const

Parameters

None

Returns

ID of the stream where the current task is located. The default value is 0.

If an exception occurs, int32_max is returned.

Constraints

None

Examples

1
2
3
4
5
6
7
graphStatus Mc2GenTaskCallback(const gert::ExeResGenerationContext *context,
    std::vector<std::vector<uint8_t>> &tasks) {
  ...
  auto aicore_task = KernelLaunchInfo::LoadFromData(context, tasks.back());
  auto stream_id = aicore_task.GetStreamId();
  ...
}