Skip to content

Commit

Permalink
prov/efa: Use ofi_dev_reg_copy_to_hmem_iov
Browse files Browse the repository at this point in the history
Use common dev reg copy API to replace the
hard-coded CUDA gdrcopy API.

Signed-off-by: Shi Jin <sjina@amazon.com>
  • Loading branch information
shijin-aws committed Feb 2, 2024
1 parent bedf721 commit fa9e5c0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions prov/efa/src/rdm/efa_rdm_pke_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,14 @@ int efa_rdm_ep_flush_queued_blocking_copy_to_hmem(struct efa_rdm_ep *ep)
desc = rxe->desc[0];
assert(desc && desc->peer.iface != FI_HMEM_SYSTEM);

if (FI_HMEM_CUDA == desc->peer.iface &&
(desc->peer.flags & OFI_HMEM_DATA_DEV_REG_HANDLE)) {
if (desc->peer.flags & OFI_HMEM_DATA_DEV_REG_HANDLE) {
assert(desc->peer.hmem_data);
bytes_copied[i] = ofi_gdrcopy_to_cuda_iov((uint64_t)desc->peer.hmem_data,
rxe->iov, rxe->iov_count,
segment_offset + ep->msg_prefix_size,
data, pkt_entry->payload_size);
bytes_copied[i] = ofi_dev_reg_copy_to_hmem_iov(
desc->peer.iface,
(uint64_t)desc->peer.hmem_data,
rxe->iov, rxe->iov_count,
segment_offset + ep->msg_prefix_size,
data, pkt_entry->payload_size);
} else {
bytes_copied[i] = ofi_copy_to_hmem_iov(desc->peer.iface,
desc->peer.device.reserved,
Expand Down

0 comments on commit fa9e5c0

Please sign in to comment.