昇腾社区首页
中文
注册
开发者
下载

Serialize

函数功能

将KernelLaunchInfo序列化成数据流。

函数原型

1
std::vector<uint8_t> Serialize()

参数说明

返回值说明

返回序列化后的数据流。

约束说明

调用示例

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
graphStatus Mc2GenTaskCallback(const gert::ExeResGenerationContext *context,
    std::vector<std::vector<uint8_t>> &tasks) {
  ...
  // 创建WaitTask
  auto wait_task = KernelLaunchInfo::CreateHcomWaitTask(context);
  wait_task.SetStreamId(attach_stream_id);
  // 序列化
  tasks.insert(tasks.begin() + aicore_index, wait_task.Serialize());
  aicore_index++;
  ...
}