Serialize

Applicable Products

All processors

Header File/Library File

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

Function Usage

Serializes KernelLaunchInfo into a data stream.

Prototype

1
std::vector<uint8_t> Serialize()

Parameters

None

Returns

Serialized data stream.

Restrictions

None

Example

 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++;
  ...
}