NCCL Tree

NCCL Tree源码

https://github.com/NVIDIA/nccl/blob/master/src/misc/trees.c
https://github.com/NVIDIA/nccl/pull/172

为了让代码运行起来,进行了小改

#include 
using namespace std;

int GetBtree(int nranks, int rank, int* u, int* d0, int* d1);
int GetDtree(int nranks, int rank, int* s0, int* d0_0, int* d0_1, int* s1, int* d1_0, int* d1_1);

main()
{
    int nranks=12;
    int i=0, u=0, d0=0, d1=0, du=0, dd0=0, dd1=0;
    for ( i=0; i

你可能感兴趣的:(NCCL Tree)