Serialize

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

Serializes KernelLaunchInfo into a data stream.

Prototype

1
std::vector<uint8_t> Serialize()

Parameters

None

Returns

Serialized data stream.

Constraints

None

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
graphStatus Mc2GenTaskCallback(const gert::ExeResGenerationContext *context,
    std::vector<std::vector<uint8_t>> &tasks) {
  ...
  // Create a wait task.
  auto wait_task = KernelLaunchInfo::CreateHcomWaitTask(context);
  wait_task.SetStreamId(attach_stream_id);
  // Perform serialization.
  tasks.insert(tasks.begin() + aicore_index, wait_task.Serialize());
  aicore_index++;
  ...
}