IsFolded

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/arg_desc_info.h>

Function Usage

Checks whether the current Args address needs to be folded into a level-2 pointer.

Prototype

1
bool IsFolded() const

Parameters

None

Returns

Information about whether the current Args address needs to be folded into a level-2 pointer.

true: needed; false: not needed

Constraints

None

Examples

 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::kIrOutputDesc, 0, true));
  //Check whether an address needs to be folded into a level-2 pointer. Here, true is returned.
  auto is_folded = aicpu_args_format.back().IsFolded();
...
}