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 <[email protected]>
  • Loading branch information
shijin-aws committed Oct 23, 2023
1 parent e523b03 commit 9f604d6
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 @@ -251,7 +251,7 @@ static int efa_mr_hmem_setup(struct efa_mr *efa_mr,
efa_mr->peer.device.cuda = attr->device.cuda;

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 @@ -458,7 +458,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 @@ -851,7 +851,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 9f604d6

Please sign in to comment.