GetIrIndex
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Header File/Library File
- Header file: #include <graph/arg_desc_info.h>
- Library file: libgraph.so
Function Usage
Obtains the IR index of the operator in the current ArgDescInfo. The IR index can be obtained only when type is kIrInput, kIrOutput, kIrInputDesc, or kIrOutputDesc.
Prototype
1 | int32_t GetIrIndex() const |
Parameters
None
Returns
Input/Output IR index corresponding to the current Args address. The default value is -1.
Restrictions
None
Example
1 2 3 4 5 6 7 8 9 10 11 12 | 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; aicpu_args_format.emplace_back(ArgDescInfo(ArgDescType::kIrOutput, 0)); // Obtain the IR index in ArgDescInfo of the kIrOutput type. The obtained value is 0. auto ir_index = aicpu_args_format.back().GetIrIndex(); ... } |
Parent topic: ArgDescInfo