"official/modeling/grad_utils.py" did not exist on "b2f501e38fd7322b1a83a1f63d0568c4d4f31da9"
1_simple.cpp 1.27 KB
Newer Older
lishen's avatar
lishen committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <iostream>
#include "net.h"

using namespace sccl;

int main(int argc, char* argv[]) {
    INFO(SCCL_LOG_CODEALL, "Hello, World!");
    // SCCLCHECK(scclSystemError);
    // SCCLCHECK(sccl::hardware::net::device::scclIbInit());
    // SCCLCHECK(sccl::hardware::net::device::scclIbGetDevicesNum(&n_ib));
    // printf("device num=%d\n", n_ib);

    // ----------------------------------------------------------------------- //
    auto scclNet = sccl::hardware::net::initNet(sccl::hardware::net::NET_IB);
    // auto scclNet = sccl::hardware::net::initNet(sccl::hardware::net::NET_SOCKET);
    sccl::hardware::net::scclNetProperties_t props;

    int n_ib;
    scclNet->devices(&n_ib);
    printf("device num=%d\n", n_ib);

    scclNet->getProperties(0, &props);

    printf("device name=%s\n", props.name);
    printf("device pciPath=%s\n", props.pciPath);
    printf("device guid=%lu\n", props.guid);
    printf("device ptrSupport=%d\n", props.ptrSupport);
    printf("device speed=%d\n", props.speed);
    printf("device port=%d\n", props.port);
    printf("device latency=%f\n", props.latency);
    printf("device maxComms=%d\n", props.maxComms);
    printf("device maxRecvs=%d\n", props.maxRecvs);

    // 程序成功执行,返回0
    return 0;
}

// HIP_VISIBLE_DEVICES=1 ./1_simple