---
title: ReadGmByPassDCache(ISASI)
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendcopapi/atlasascendc_api_07_00090.html
sourcePath: /source/zh/canncommercial/900/API/ascendcopapi/atlasascendc_api_07_00090.html
indexId: 35c7c6e0f0242f0d6afe668493bf3de700aeca340b207ed327f458b83e05088577
---
# ReadGmByPassDCache(ISASI)

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | √ |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | x |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | x |
| Atlas 200I/500 A2 推理产品 | x |
| Atlas 推理系列产品 AI Core | x |
| Atlas 推理系列产品 Vector Core | x |
| Atlas 训练系列产品 | x |


#### 功能说明

不经过DCache从GM地址上读数据。

当多核操作GM地址时，如果数据无法对齐到Cache Line，经过DCache的方式下，由于按照Cache Line大小进行读写，会导致多核数据随机覆盖的问题。此时，可以采用不经过DCache直接读写GM地址的方式，从而避免上述随机覆盖的问题。


#### 函数原型

```
template <typename T>
__aicore__ inline T ReadGmByPassDCache(__gm__ T* addr)
```


#### 参数说明


**表1 模板参数说明**

| 参数名 | 描述 |
| --- | --- |
| T | 操作数的数据类型。 Atlas 350 加速卡，支持的数据类型为：int8\_t、uint8\_t、int16\_t、uint16\_t、int32\_t、uint32\_t、int64\_t、uint64\_t。 |


**表2 接口参数说明**

| 参数名 | 输入/输出 | 含义 |
| --- | --- | --- |
| addr | 输入 | 源GM地址。 |


#### 返回值说明

源GM地址上的数据。


#### 约束说明

无


#### 调用示例


```
__gm__ int32_t* addr = srcGlobal.GetPhyAddr();
int32_t value = ReadGmByPassDCache(addr);
```
