Skip to content

Commit

Permalink
prov/efa: Onboard ofi_hmem_dev_register API
Browse files Browse the repository at this point in the history
Signed-off-by: Shi Jin <sjina@amazon.com>
  • Loading branch information
shijin-aws committed Oct 19, 2023
1 parent 21c5b99 commit 14594ab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions prov/efa/src/efa_mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ static int efa_mr_hmem_setup(struct efa_mr *efa_mr,
}

if (cuda_is_gdrcopy_enabled()) {
err = cuda_gdrcopy_dev_register(attr->mr_iov->iov_base, attr->mr_iov->iov_len,
err = ofi_hmem_dev_register(FI_HMEM_CUDA, attr->mr_iov->iov_base, attr->mr_iov->iov_len,
(uint64_t *)&efa_mr->peer.hmem_data);
efa_mr->peer.flags |= OFI_HMEM_DATA_GDRCOPY_HANDLE;
if (err) {
Expand Down Expand Up @@ -465,7 +465,7 @@ static int efa_mr_dereg_impl(struct efa_mr *efa_mr)
if (efa_mr->peer.iface == FI_HMEM_CUDA &&
(efa_mr->peer.flags & OFI_HMEM_DATA_GDRCOPY_HANDLE)) {
assert(efa_mr->peer.hmem_data);
err = cuda_gdrcopy_dev_unregister((uint64_t)efa_mr->peer.hmem_data);
err = ofi_hmem_dev_unregister(FI_HMEM_CUDA, (uint64_t)efa_mr->peer.hmem_data);
if (err) {
EFA_WARN(FI_LOG_MR,
"Unable to de-register cuda handle\n");
Expand Down Expand Up @@ -857,7 +857,7 @@ static int efa_mr_reg_impl(struct efa_mr *efa_mr, uint64_t flags, const void *at
if (efa_mr->peer.iface == FI_HMEM_CUDA &&
(efa_mr->peer.flags & OFI_HMEM_DATA_GDRCOPY_HANDLE)) {
assert(efa_mr->peer.hmem_data);
cuda_gdrcopy_dev_unregister((uint64_t)efa_mr->peer.hmem_data);
ofi_hmem_dev_unregister(FI_HMEM_CUDA, (uint64_t)efa_mr->peer.hmem_data);
}

return -errno;
Expand Down

0 comments on commit 14594ab

Please sign in to comment.