base.h 999 Bytes
Newer Older
lishen's avatar
lishen committed
1
2
3
4
5
6
7
8
9
#pragma once

#include <stdint.h>
#include <string.h>
#include "debug.h"
#include "check.h"
#include "param.h"
#include "alloc.h"
#include "utils.h"
10
#include "asm_ops.h"
lishen's avatar
lishen committed
11
12
13
14
15
16
17
18
19
20
21
22

/*
外部环境变量设置:

src/debug.h:
*/
namespace sccl {
#define WARP_SIZE warpSize
#define MAXCHANNELS 32
#define SCCL_MAX_NTHREADS 256
#define SCCL_MAX_OPS 2048
#define SCCL_STEPS 8
23
#define SCCL_LOCAL_MAX_NODES 8 // 每个节点内最多的卡数
lishen's avatar
lishen committed
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

typedef enum : uint8_t {
    scclInt8     = 0,
    scclChar     = 0,
    scclUint8    = 1,
    scclInt32    = 2,
    scclInt      = 2,
    scclUint32   = 3,
    scclInt64    = 4,
    scclUint64   = 5,
    scclFloat16  = 6,
    scclHalf     = 6,
    scclFloat32  = 7,
    scclFloat    = 7,
    scclFloat64  = 8,
    scclDouble   = 8,
    scclBfloat16 = 9,
} scclDataType_t;

#define SCCL_NUM_PROTOCOLS 3 // Simple/LL/LL128
typedef enum : uint8_t {
    SCCL_PROTO_LL     = 0,
    SCCL_PROTO_LL128  = 1,
    SCCL_PROTO_SIMPLE = 2
} scclProtocolType_t;

} // namespace sccl