CreateHcomRecordTask
Applicability
Product |
Supported or Not |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Header File
#include <graph/kernel_launch_info.h>
Function Usage
Creates a record task to wake up the wait task with the same group_name on other streams.
Prototype
1 | static KernelLaunchInfo CreateHcomRecordTask(const gert::ExeResGenerationContext *context, const char *group_name = "group") |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
context |
Input |
Input parameter of the GenerateTask function, which stores the basic information about the operator. |
group_name |
Input |
Group name of the record task. The default value is group. The name is used to match a wait task. |
Returns
Information about the created record task.
Constraints
The value of group_name must be the same as that of the attribute defined in the operator prototype. For example, if an MC2 operator defines an attribute group_ep, you can use group_name to create a record task and a wait task for group_ep.
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 record task. auto record_task = KernelLaunchInfo::CreateHcomRecordTask(context); // Set stream information. record_task.SetStreamId(stream_id); tasks.insert(tasks.begin() + aicore_index, record_task.Serialize()); aicore_index++; ... } |