Make getWc not return a void pointer

This commit is contained in:
Olli Saarikivi
2023-05-16 22:52:17 +00:00
parent dee55997e9
commit d83343ef4e
4 changed files with 4 additions and 4 deletions

View File

@@ -113,7 +113,7 @@ void IBConnection::flush() {
ErrorCode::InternalError);
}
for (int i = 0; i < wcNum; ++i) {
const struct ibv_wc* wc = reinterpret_cast<const struct ibv_wc*>(qp->getWc(i));
const ibv_wc* wc = qp->getWc(i);
if (wc->status != IBV_WC_SUCCESS) {
throw mscclpp::IbError("pollCq failed: status " + std::to_string(wc->status), wc->status);
}

View File

@@ -247,7 +247,7 @@ int IbQp::pollCq() { return ibv_poll_cq(this->cq, MSCCLPP_IB_CQ_POLL_NUM, this->
IbQpInfo& IbQp::getInfo() { return this->info; }
const void* IbQp::getWc(int idx) const { return &this->wcs[idx]; }
const ibv_wc* IbQp::getWc(int idx) const { return &this->wcs[idx]; }
IbCtx::IbCtx(const std::string& devName) : devName(devName) {
int num;

View File

@@ -72,7 +72,7 @@ class IbQp {
int pollCq();
IbQpInfo& getInfo();
const void* getWc(int idx) const;
const ibv_wc* getWc(int idx) const;
private:
IbQp(ibv_context* ctx, ibv_pd* pd, int port);

View File

@@ -79,7 +79,7 @@ int main(int argc, const char* argv[])
return 1;
}
for (int i = 0; i < wcNum; ++i) {
const struct ibv_wc* wc = reinterpret_cast<const struct ibv_wc*>(qp->getWc(i));
const ibv_wc* wc = qp->getWc(i);
if (wc->status != IBV_WC_SUCCESS) {
WARN("wc status %d", wc->status);
return 1;