---
title: Attach
description: "昇腾AI处理器与昇腾产品的对应关系，请参见《昇腾产品形态说明(https://www.hiascend.com/document/detail/zh/AscendFAQ/ProduTech/productform/hardwaredesc_0001.html)》"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/devaids/Profiling/mindieprofiling_0064.html
sourcePath: /source/zh/canncommercial/900/devaids/Profiling/mindieprofiling_0064.html
indexId: fdaeddc9deccbcff446864e18414c29450e95c87ed70c11c02ea8323cebb17a973
---
# Attach

#### 产品支持情况

昇腾AI处理器与昇腾产品的对应关系，请参见《昇腾产品形态说明(https://www.hiascend.com/document/detail/zh/AscendFAQ/ProduTech/productform/hardwaredesc_0001.html)》


| 产品 | 是否支持 |
| --- | --- |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | x |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | x |
| Atlas 推理系列产品 | √ |
| Atlas 训练系列产品 | x |


针对 Atlas A2 训练系列产品 / Atlas A2 推理系列产品 ，当前仅支持该系列产品中的 Atlas 800I A2 推理产品 。

针对 Atlas 推理系列产品 ，当前仅支持该系列产品中的Atlas 300I Duo 推理卡+Atlas 800 推理服务器（型号：3000）。


#### 功能说明

附加Trace信息到当前上下文。


#### 函数原型

```
size_t Attach(const TraceId traceId, const SpanId spanId, const bool isSample = true)
```


#### 参数说明


**表1 参数说明**

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| traceId | 输入 | Trace ID。 |
| spanId | 输入 | 跨度ID。 |
| isSample | 输入 | 是否采样（默认true） |


#### 返回值说明

返回上下文索引，作为Unattach的调用参数。
