11 uint32_t
volatile cnt;
12 uint32_t
volatile iteration;
16 volatile uint32_t *barrier_ptr;
20 uint32_t is_participant;
27 SNRT_COLLECTIVE_UNICAST = 0,
28 SNRT_COLLECTIVE_MULTICAST = 1,
29 SNRT_REDUCTION_BARRIER = 2,
30 SNRT_NUM_BUILTIN_COLLECTIVE_OPS = 6,
32} snrt_collective_opcode_t;
35 SNRT_REDUCTION_MAX = 0,
36 SNRT_REDUCTION_MIN = 1,
37 SNRT_REDUCTION_SUM = 2,
38 SNRT_REDUCTION_PROD = 3,
39} snrt_reduction_op_type_t;
42 SNRT_REDUCTION_FP8 = 0,
43 SNRT_REDUCTION_FP16 = 1,
44 SNRT_REDUCTION_FP16ALT = 2,
45 SNRT_REDUCTION_FP32 = 3,
46 SNRT_REDUCTION_FP64 = 4,
47 SNRT_NUM_REDUCTION_DATA_TYPES = 5,
48} snrt_reduction_data_type_t;
51#define SNRT_REDUCTION_DATA_TYPE_BITS \
52 ((int)(sizeof(unsigned int) * CHAR_BIT) - \
53 __builtin_clz(SNRT_NUM_REDUCTION_DATA_TYPES - 1))
56 struct __attribute__((__packed__)) {
57 snrt_collective_opcode_t opcode : SNRT_COLLECTIVE_OPCODE_WIDTH;
58 uint64_t mask : (64 - SNRT_COLLECTIVE_OPCODE_WIDTH);
63extern volatile uint32_t _snrt_mutex;
65extern volatile uint32_t _reduction_result;
67inline volatile uint32_t *snrt_mutex();
69inline void snrt_mutex_acquire(
volatile uint32_t *pmtx);
71inline void snrt_mutex_ttas_acquire(
volatile uint32_t *pmtx);
73inline void snrt_mutex_release(
volatile uint32_t *pmtx);
75inline void snrt_cluster_hw_barrier();
77inline void snrt_global_sw_barrier(
snrt_comm_t comm = NULL);
79inline void snrt_global_barrier(
snrt_comm_t comm = NULL);
81inline uint32_t snrt_global_all_to_all_reduction(uint32_t value);
83inline void snrt_wait_writeback(uint32_t val);
85inline uint64_t snrt_get_collective_mask(
snrt_comm_t comm);
87inline void snrt_enable_multicast(uint64_t mask);
89inline void snrt_disable_multicast();
91inline snrt_collective_opcode_t snrt_reduction_op(
92 snrt_reduction_op_type_t op, snrt_reduction_data_type_t type);
94inline void snrt_enable_reduction(uint64_t mask,
95 snrt_collective_opcode_t collective_opcode);
97inline void snrt_enable_reduction(uint64_t mask, snrt_reduction_op_type_t op,
98 snrt_reduction_data_type_t type);
100inline void snrt_disable_reduction();
Definition sync_decls.h:10
Definition sync_decls.h:15
Definition sync_decls.h:55