7#include <infiniband/verbs.h>
9#include "rdmapp/device.h"
10#include "rdmapp/error.h"
12#include "rdmapp/detail/noncopyable.h"
23 std::shared_ptr<device> device_;
34 cq(std::shared_ptr<device>
device,
size_t num_cqe = 128);
45 bool poll(
struct ibv_wc &wc);
57 size_t poll(std::vector<struct ibv_wc> &wc_vec);
58 template <
class It>
size_t poll(It wc,
int count) {
59 int rc = ::ibv_poll_cq(cq_, count, wc);
61 throw_with(
"failed to poll cq: %s (rc=%d)", strerror(rc), rc);
65 template <
int N>
size_t poll(std::array<struct ibv_wc, N> &wc_array) {
66 return poll(&wc_array[0], N);
This class is an abstraction of a Completion Queue.
Definition cq.h:22
bool poll(struct ibv_wc &wc)
Poll the completion queue.
Definition cq.cc:23
This class is an abstraction of an Infiniband device.
Definition device.h:48
Definition noncopyable.h:5
This class is an abstraction of an Infiniband Queue Pair.
Definition qp.h:50