GetWindowsInAddr
产品支持情况
产品 |
是否支持 |
---|---|
√ |
|
√ |
|
x |
|
x |
|
x |
|
x |
|
x |
功能说明
获取卡间通信数据WindowsIn起始地址,可用来直接作为计算的输入输出地址,减少拷贝。该接口默认在所有核上工作,用户也可以在调用前通过GetBlockIdx指定其在某一个核上运行。
函数原型
1 | __aicore__ inline GM_ADDR GetWindowsInAddr(uint32_t rankId) |
参数说明
参数名 |
输入/输出 |
描述 |
---|---|---|
rankId |
输入 |
待查询的卡的Id。 |
返回值说明
返回对应卡的卡间通信数据WindowsIn起始地址。当rankId非法时,返回nullptr。
约束说明
无
调用示例
1 2 3 4 5 6 7 8 9 10 | REGISTER_TILING_DEFAULT(ReduceScatterCustomTilingData); //ReduceScatterCustomTilingData为对应算子头文件定义的结构体 GET_TILING_DATA_WITH_STRUCT(ReduceScatterCustomTilingData, tilingData, tilingGM); Hccl hccl; GM_ADDR contextGM = AscendC::GetHcclContext<0>(); // AscendC自定义算子kernel中,通过此方式获取Hccl context hccl.InitV2(contextGM, &tilingData); auto winInAddr = hccl.GetWindowsInAddr(0); auto winOutAddr = hccl.GetWindowsOutAddr(0); auto rankId = hccl.GetRankId(); auto rankDim = hccl.GetRankDim(); // 4张卡 |
父主题: Hccl