---
title: aicpu_args_handler
description: "本章接口为预留接口，后续有可能变更或废弃，不建议开发者使用，开发者无需关注。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/aolapi/atlasascendc_api_07_1164.html
sourcePath: /source/zh/canncommercial/900/API/aolapi/atlasascendc_api_07_1164.html
indexId: 75de60d58c9aa51cf2a80eebde50ac343dc8afb7fae798b52dae378098740e9470
---
# aicpu_args_handler

本章接口为预留接口，后续有可能变更或废弃，不建议开发者使用，开发者无需关注。


**表1 接口列表**

| 接口定义 | 功能说明 |
| --- | --- |
| AicpuArgsHandler(const std::string &opType, const std::string &nodeName, const uint32\_t ioNum, const bool needDeviceExt) | AI CPU框架用于构造AI CPU opTask时的辅助类。 |
| opType\_(opType) | 算子名称。 |
| nodeName\_(nodeName) | 预留参数，当前同算子名称。 |
| ioNum\_(ioNum) | 算子的输入和输出个数之和。 |
| needDeviceExt\_(needDeviceExt) | 标识是否需要分配额外device侧内存。 |
| args\_({}) | 与Runtime运行时交互的参数的对象，用于计算任务下发。 |
| GetIoAddr() | 获取args内存中存放input/output地址的内存指针。 |
| get() | 获取智能指针管理的内存的首地址。 |
| GetExtInfoAddr() | 获取args中存放拓展参数的内存指针。 |
| GetArgs() | 获取指向args内存的指针。 |
| GetArgsEx() | 获取与Runtime运行时交互的对象的指针。 |
| GetNodeName() | 获取节点名称，当前为算子名。 |
| GetIoNum() | 获取算子的输入和输出个数之和。 |
| GetHostInputSize() | 获取host侧输入的内存大小。 |
| GetInputAddrAlignBytes() | 获取指定的地址分配字节对齐参数。 |
| SetSpace(void \*space) | 记录此Args handle归属于哪个算子空间。 |
| MallocMem() | 申请args的内存。 |
| ResetHostInputInfo() | 重置host侧输入的统计信息。 |
| AddHostInput(const size\_t idx, void \*data, const size\_t srcSize, const size\_t alignSize) | 记录host侧输入信息。 |
| UpdateIoAddr(const FVector<const aclTensor \*> &inputs, const FVector<aclTensor \*> &outputs, const aclrtStream stream, aclOpExecutor \*executor, const uint64\_t deviceExtMemSize, const uint64\_t deviceCacheOffset) | 更新args中的input、output的地址信息。 |
| AicpuArgsHandler() | AI CPU框架用于构造AI CPU opTask时的辅助类。 |
| UpdateDeviceExtInfoAddr(void \*deviceExtInfoAddr) | 更新device侧存储拓展参数的地址。 |
| SetLaunchArgs(const size\_t argSize) | 设置args中参数大小。 |
| GetDeviceCacheAddr(void \*&deviceAddr, aclOpExecutor \*executor, const uint64\_t deviceCacheOffset) | 获取预留的device侧内存地址。 |
| AicpuCCArgsHandler(const std::string &opType, const std::string &nodeName, const uint32\_t ioNum, const bool needDeviceExt) | AI CPU CANN算子框架参数管理类。 |
| AicpuArgsHandler(opType, nodeName, ioNum, needDeviceExt) | AI CPU框架用于构造AI CPU opTask时的辅助类。 |
| GenCCArgs(const FVector<const aclTensor \*> &inputs, const FVector<aclTensor \*> &outputs, const AicpuAttrs &attrs, std::string &taskInfo) | 生成CANN算子args中nodedef及head信息。 |
| BuildCCArgs(const std::string &argData, const std::string &kernelName, const std::string &soName, const size\_t extInfoSize) | 封装CANN算子args中参数。 |
| SetHostArgs(const std::string &argData, const size\_t extInfoSize) | 设置args中内存的地址和长度信息。 |
| SetOffsetArgs() | 设置args中偏移值。 |
| AicpuTfArgsHandler(const std::string &opType, const std::string &nodeName, const uint32\_t ioNum, const bool needDeviceExt) | AI CPU Tensorflow算子框架参数管理类。 |
| GenTfArgs(const FVector<const aclTensor \*> &inputs, const FVector<aclTensor \*> &outputs, const AicpuAttrs &attrs, STR\_FWK\_OP\_KERNEL &fwkOpKernel, std::string &taskInfo) | 生成CANN算子args中nodedef及head信息。 |
| BuildTfArgs(STR\_FWK\_OP\_KERNEL &fwkOpKernel, const std::string &taskInfo, const size\_t extInfoSize) | 封装Tensorflow算子args中参数。 |
| GenNodeDef(const FVector<const aclTensor \*> &inputs, const AicpuAttrs &attrs, ge::Buffer &nodeDefBytes) | 生成算子的描述符信息，包含输入、输出的地址和shape等信息。 |
| UpdateKernelId() | 更新args中的Kernel字段，用于匹配Device侧的Kernel Cache。 |
