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

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


**表1 接口列表**

| 接口定义 | 功能说明 |
| --- | --- |
| AicpuExtInfoHandler(const std::string &nodeName, const uint32\_t inputNum, const uint32\_t outputNum, const ge::UnknowShapeOpType unknownType) | AI CPU拓展参数管理类构造函数。 |
| nodeName\_(nodeName) | 算子名称。 |
| inputNum\_(inputNum) | 算子的输入个数。 |
| outputNum\_(outputNum) | 算子的输出个数。 |
| unknownType\_(unknownType) | 标识算子是什么类型的算子。 |
| AicpuExtInfoHandler() | AI CPU拓展参数管理类构造函数。 |
| GenTfExtBuffer(const FVector<const aclTensor \*> &inputs, const FVector<aclTensor \*> &outputs, std::string &taskExtInfo) | 生成Tensorflow算子框架的拓展参数。 |
| GenCCExtBuffer( const FVector<const aclTensor \*> &inputs, const FVector<aclTensor \*> &outputs, std::string &taskExtInfo) | 生成CANN算子框架的拓展参数。 |
| Parse(const std::string &extInfo, uint8\_t \*hostAddr) | 解析拓展参数的函数。 |
| UpdateInputShape(const uint32\_t inputIndex, const gert::Shape &inputShape) | 更新拓展参数中的输入shape信息。 |
| UpdateOutputShape(const uint32\_t outputIndex, const gert::Shape &outputShape) | 更新拓展参数中的输出shape信息。 |
| GetOutputShapeAndType(const uint32\_t outputIndex, gert::Shape &shape, ge::DataType &dataType) | 获取拓展参数中的shape和数据类型等信息。 |
| CopyH2D(const aclrtStream stream, const aclOpExecutor \*executor, const uint64\_t deviceExtMemSize, uint64\_t &deviceCacheOffset) | 将拓展参数从host侧拷贝至device侧。 |
| CopyOutputShapeD2H() | 将device侧算子执行更新后的输出shape更新到host侧。 |
| GetExtInfoDeviceBuffer(const aclOpExecutor \*executor, const uint64\_t deviceExtMemSize, uint64\_t &deviceCacheOffset) | 获取device侧预留的拓展参数内存地址。 |
| GenerateKernelId() | 生成kernel id。 |
| UpdateOutputShapeFromExtInfo(const FVector<aclTensor \*> &outputs, aclrtStream stream) | 从device侧获取输出shape信息更新到host侧。 |
| UpdateInputAndOutputShape(const FVector<const aclTensor \*> &inputs, const FVector<aclTensor \*> &outputs, aclrtStream stream, const aclOpExecutor \*executor, const uint64\_t deviceExtMemSize, uint64\_t &deviceCacheOffset) | 二阶段执行前，刷新真实的输入、输出shape信息更新到device侧。 |
| SetSpace(void \*space) | 设置使用的task空间。 |
| ParseExtShapeType(AicpuExtInfo &aicpuExtInfo) | 解析拓展参数中的shape和数据类型信息。 |
| ParseExtInputShape(AicpuExtInfo &aicpuExtInfo) | 解析拓展参数中的输入shape。 |
| ParseExtOutputShape(AicpuExtInfo &aicpuExtInfo) | 解析拓展参数中的输出shape。 |
| AppendExtOpName(std::string &taskExtInfo) | 向拓展参数中拼接算子名称。 |
| AppendExtShapeType(std::string &taskExtInfo) | 向拓展参数中拼接shape和类型信息。 |
| AppendExtBitMap(std::string &taskExtInfo) | 向拓展参数中拼接bitmap信息。 |
| AppendExtInfoShape(const FVector<const aclTensor \*> &tensors, const aicpu::FWKAdapter::FWKTaskExtInfoType type, std::string &taskExtInfo, bool isTf = false) | 向拓展参数中拼接shape信息。 |
| AppendSessionInfo(std::string &taskExtInfo) | 向拓展参数中拼接session信息。 |
| UpdateShape(const gert::Shape &shape, AicpuShapeAndType \*const shapeAndType) | 更新shape信息。 |
| GetShapeAndType(const AicpuShapeAndType &shapeAndType, gert::Shape &shape, ge::DataType &dataType) | 获取拓展参数中的shape和数据类型信息。 |
