GetStreamId

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

Header File/Library File

  • Header file: #include <graph/kernel_launch_info.h>
  • Library file: libregister.so

Function Usage

Obtains the ID of the stream associated with the current task.

Prototype

1
uint32_t GetStreamId() const

Parameters

None

Returns

ID of the stream associated with the current task. The default value is 0.

If an exception occurs, int32_max is returned.

Restrictions

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();
  ...
}