GetWindowsInAddr
Applicability
Product |
Supported |
|---|---|
√ |
|
√ |
|
x |
|
x |
|
x |
|
x |
Function
Obtains the WindowsIn start address of inter-card communication data, which can be directly used as the input and output address for computation, reducing copy operations. By default, this API works on all cores. You can also specify a core by setting GetBlockIdx before calling this API.
Prototype
1 | __aicore__ inline GM_ADDR GetWindowsInAddr(uint32_t rankId) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
rankId |
Input |
ID of the rank to be queried. |
Returns
Returns the WindowsIn start address of inter-card communication data of the corresponding rank. If rankId is invalid, nullptr is returned.
Restrictions
None
Example
1 2 3 4 5 6 7 8 9 10 | REGISTER_TILING_DEFAULT(ReduceScatterCustomTilingData); // ReduceScatterCustomTilingData is a structure defined in the operator header file. GET_TILING_DATA_WITH_STRUCT(ReduceScatterCustomTilingData, tilingData, tilingGM); Hccl hccl; GM_ADDR contextGM = AscendC::GetHcclContext<0>(); // Obtain the HCCL context on the kernel of the Ascend C custom operator. hccl.InitV2(contextGM, &tilingData); auto winInAddr = hccl.GetWindowsInAddr(0); auto winOutAddr = hccl.GetWindowsOutAddr(0); auto rankId = hccl.GetRankId(); auto rankDim = hccl.GetRankDim(); // Four cards |