ArgDescInfo Constructor and Destructor

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Header File/Library File

  • Header file: #include <graph/arg_desc_info.h>
  • Library file: libgraph.so

Function Usage

Constructs and destructs an object of class ArgDescInfo.

Prototype

1
2
3
4
5
6
explicit ArgDescInfo(ArgDescType arg_type, int32_t ir_index = -1, bool is_folded = false)
~ArgDescInfo()
ArgDescInfo(const ArgDescInfo &other)
ArgDescInfo(ArgDescInfo &&other) noexcept
ArgDescInfo &operator=(const ArgDescInfo &other)
ArgDescInfo &operator=(ArgDescInfo &&other) noexcept

Parameters

Parameter

Input/Output

Description

arg_type

Input

Type of the current Args address. For details about the type definition, see ArgDescType.

ir_index

Input

Operator IR index corresponding to the current Args address.

is_folded

Input

Whether the current address needs to be folded into a level-2 pointer.

Returns

None

Restrictions

None

Example

1
2
3
4
5
6
7
8
9
graphStatus Mc2GenTaskCallback(const gert::ExeResGenerationContext *context, std::vector<std::vector<uint8_t>> &tasks) {
...
  // Set an AI CPU task.
  auto aicpu_task = KernelLaunchInfo::CreateAicpuKfcTask(context, "libccl_kernel.so", "RunAicpuKfcSrvLaunch");
  std::vector<ArgDescInfo> aicpu_args_format;
  // Construct an address description whose type is kIrOutputDesc and ir_index is 0. It needs to be folded into a level-2 pointer.
  aicpu_args_format.emplace_back(ArgDescInfo(ArgDescType::kIrOutputDesc, 0, true));
...
}