CreateAicpuKfcTask

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

Creates a KFC task for the AI CPU.

Prototype

1
static KernelLaunchInfo CreateAicpuKfcTask(const gert::ExeResGenerationContext *context, const char *so_name, const char *kernel_name)

Parameters

Parameter

Input/Output

Description

context

Input

Input parameter of the GenerateTask function, which stores the basic information about the operator.

so_name

Input

Name of the .so file packaged by the AI CPU operator.

kernel_name

Input

Entrypoint function name of the AI CPU operator.

Returns

Information about the created AI CPU KFC task.

Constraints

None

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
graphStatus Mc2GenTaskCallback(const gert::ExeResGenerationContext *context,
    std::vector<std::vector<uint8_t>> &tasks) {
  ...
  // Create an AI CPU task.
  auto aicpu_task = KernelLaunchInfo::CreateAicpuKfcTask(context,
      "libccl_kernel.so", "RunAicpuKfcSrvLaunch");
  // Obtain the attach stream.
  auto stream_infos = context->GetAttachedStreamInfos();
  GE_ASSERT_TRUE(!stream_infos.empty());
  const int64_t attach_stream_id = stream_infos[0].stream_id;
  // Add information to the AI CPU KFC task.
  aicpu_task->SetStreamId(attach_stream_id);
  ...
}