WriteGmByPassDCache(ISASI)
产品支持情况
功能说明
不经过DCache向GM地址上写数据。
当多核操作GM地址时,如果数据无法对齐到Cache Line,经过DCache的方式下,由于按照Cache Line大小进行读写,会导致多核数据随机覆盖的问题。此时,可以采用不经过DCache直接读写GM地址的方式,从而避免上述随机覆盖的问题。
函数原型
template <typename T>
__aicore__ inline void WriteGmByPassDCache(__gm__ T* addr, T value)
参数说明
表 1 模板参数说明
|
Ascend 950PR/Ascend 950DT,支持的数据类型为:int8_t、uint8_t、int16_t、uint16_t、int32_t、uint32_t、int64_t、uint64_t。 |
表 2 接口参数说明
返回值说明
无
约束说明
无
调用示例
__gm__ int32_t* addr = dstGlobal.GetPhyAddr();
int32_t value = 2;
WriteGmByPassDCache(addr, value);