Skip to content

Commit

Permalink
rdma: fi_{send,write}data: do arithmetic on uintptr
Browse files Browse the repository at this point in the history
void pointer arithmetic is illegal in c++; cast to uintptr, do the
offset, then cast to void* to pass to libfabric.

stack-info: PR: #558, branch: aws-nslick/stack/5
  • Loading branch information
aws-nslick committed Sep 4, 2024
1 parent 348761d commit 1906685
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/nccl_ofi_rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -4259,7 +4259,7 @@ static int post_rdma_write(nccl_net_ofi_rdma_req_t *req,

ssize_t rc;
/* Post RDMA write */
rc = fi_writedata(comm_rail->local_ep, send_data->buff + xfer_info->offset,
rc = fi_writedata(comm_rail->local_ep, (void*)((uintptr_t)send_data->buff + xfer_info->offset),
xfer_info->msg_size, desc, send_data->wdata,
comm_rail->remote_addr,
send_data->remote_buff + xfer_info->offset,
Expand Down Expand Up @@ -4287,7 +4287,7 @@ static int post_rdma_eager_send(nccl_net_ofi_rdma_req_t *req,

ssize_t rc;
/* Post eager send */
rc = fi_senddata(comm_rail->local_ep, send_data->buff + xfer_info->offset, xfer_info->msg_size, desc,
rc = fi_senddata(comm_rail->local_ep, (void*)(((uintptr_t)send_data->buff) + xfer_info->offset), xfer_info->msg_size, desc,
send_data->wdata, comm_rail->remote_addr, req);

if ((rc != 0) && (rc != -FI_EAGAIN)) {
Expand Down

0 comments on commit 1906685

Please sign in to comment.