-
Notifications
You must be signed in to change notification settings - Fork 1
/
hccl_ofi_wrapper_interface.h
102 lines (91 loc) · 5.72 KB
/
hccl_ofi_wrapper_interface.h
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// Copyright (c) 2021 Habana Labs, Ltd.
// SPDX-License-Identifier: BSD-3-Clause
#pragma once
#include <iostream>
#include <sys/socket.h>
#include <set>
#include <map>
#include <memory>
#include <rdma/fabric.h>
#include <rdma/fi_errno.h>
#include <rdma/fi_domain.h>
#include <rdma/fi_endpoint.h>
#include <rdma/fi_cm.h>
#include <rdma/fi_tagged.h>
#include <rdma/fi_rma.h>
class ofi_plugin_interface;
using ofi_plugin_interface_handle = std::unique_ptr<ofi_plugin_interface>;
class ofi_plugin_interface
{
public:
virtual ~ofi_plugin_interface() = default;
virtual int w_fi_getinfo(int version,
const char* node,
const char* service,
uint64_t flags,
const struct fi_info* hints,
struct fi_info** info) = 0;
virtual struct fi_info* w_fi_allocinfo() = 0;
virtual void w_fi_freeinfo(struct fi_info* info) = 0;
virtual const char* w_fi_strerror(int err) = 0;
virtual char* w_fi_tostr(const void* data, enum fi_type datatype) = 0;
virtual int w_fi_close(fid_t domain) = 0;
virtual int w_fi_fabric(struct fi_fabric_attr* attr, struct fid_fabric** fabric, void* context) = 0;
virtual int
w_fi_domain(struct fid_fabric* fabric, struct fi_info* info, struct fid_domain** domain, void* context) = 0;
virtual int w_fi_endpoint(struct fid_domain* domain, struct fi_info* info, struct fid_ep** ep, void* context) = 0;
virtual int w_fi_cq_open(struct fid_domain* domain, struct fi_cq_attr* attr, struct fid_cq** cq, void* context) = 0;
virtual int w_fi_av_open(struct fid_domain* domain, struct fi_av_attr* attr, struct fid_av** av, void* context) = 0;
virtual int w_fi_ep_bind(struct fid_ep* ep, struct fid* fid, uint64_t flags) = 0;
virtual int w_fi_enable(struct fid_ep* ep) = 0;
virtual int w_fi_getname(fid_t fid, void* addr, size_t* addrlen) = 0;
virtual int
w_fi_av_insert(struct fid_av* av, void* addr, size_t count, fi_addr_t* fi_addrs, uint64_t flags, void* context) = 0;
virtual ssize_t w_fi_tsend(struct fid_ep* ep,
const void* buf,
size_t len,
void* desc,
fi_addr_t dest_addr,
uint64_t tag,
void* context) = 0;
virtual ssize_t w_fi_trecv(struct fid_ep* ep,
void* buf,
size_t len,
void* desc,
fi_addr_t src_addr,
uint64_t tag,
uint64_t ignore,
void* context) = 0;
virtual ssize_t w_fi_cq_read(struct fid_cq* cq, void* buf, size_t count) = 0;
virtual ssize_t w_fi_cq_readerr(struct fid_cq* cq, struct fi_cq_err_entry* buf, uint64_t flags) = 0;
virtual const char*
w_fi_cq_strerror(struct fid_cq* cq, int prov_errno, const void* err_data, char* buf, size_t len) = 0;
virtual void* w_fi_mr_desc(struct fid_mr* mr) = 0;
virtual int
w_fi_mr_regattr(struct fid_domain* domain, const struct fi_mr_attr* attr, uint64_t flags, struct fid_mr** mr) = 0;
virtual uint64_t w_fi_mr_key(struct fid_mr* mr) = 0;
virtual ssize_t w_fi_read(struct fid_ep* ep,
void* buf,
size_t len,
void* desc,
fi_addr_t src_addr,
uint64_t addr,
uint64_t key,
void* context) = 0;
virtual uint32_t w_fi_version() = 0;
virtual struct fi_info* w_fi_dupinfo(const struct fi_info* info) = 0;
virtual int w_fi_eq_open(struct fid_fabric* fabric, struct fi_eq_attr* attr, struct fid_eq** eq, void* context) = 0;
virtual ssize_t
w_fi_eq_sread(struct fid_eq* eq, uint32_t* event, void* buf, size_t len, int timeout, uint64_t flags) = 0;
virtual ssize_t w_fi_eq_readerr(struct fid_eq* eq, struct fi_eq_err_entry* buf, uint64_t flags) = 0;
virtual int
w_fi_passive_ep(struct fid_fabric* fabric, struct fi_info* info, struct fid_pep** pep, void* context) = 0;
virtual int w_fi_pep_bind(struct fid_pep* pep, struct fid* bfid, uint64_t flags) = 0;
virtual int w_fi_listen(struct fid_pep* pep) = 0;
virtual int w_fi_connect(struct fid_ep* ep, const void* addr, const void* param, size_t paramlen) = 0;
virtual int w_fi_accept(struct fid_ep* ep, const void* param, size_t paramlen) = 0;
virtual ssize_t
w_fi_send(struct fid_ep* ep, const void* buf, size_t len, void* desc, fi_addr_t dest_addr, void* context) = 0;
virtual ssize_t
w_fi_recv(struct fid_ep* ep, void* buf, size_t len, void* desc, fi_addr_t src_addr, void* context) = 0;
};