Skip to content

Commit ef6d661

Browse files
authored
Merge pull request #11372 from s417-lama/fix-ofi-rocr
ofi: check if libfabric has FI_HMEM_ROCR at configure time
2 parents 6e0653e + 25fee97 commit ef6d661

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

config/opal_check_ofi.m4

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,16 @@ AC_DEFUN([OPAL_CHECK_OFI],[
146146
147147
AC_DEFINE_UNQUOTED([OPAL_OFI_HAVE_FI_MR_IFACE],
148148
[${opal_check_fi_mr_attr_iface}],
149-
[check if iface avaiable in fi_mr_attr])])
149+
[check if iface avaiable in fi_mr_attr])
150+
151+
AC_CHECK_DECL([FI_HMEM_ROCR],
152+
[opal_check_fi_hmem_rocr=1],
153+
[opal_check_fi_hmem_rocr=0],
154+
[#include <rdma/fi_domain.h>])
155+
156+
AC_DEFINE_UNQUOTED([OPAL_OFI_HAVE_FI_HMEM_ROCR],
157+
[${opal_check_fi_hmem_rocr}],
158+
[check if FI_HMEM_ROCR avaiable in fi_hmem_iface])])
150159
151160
CPPFLAGS=${opal_check_ofi_save_CPPFLAGS}
152161
LDFLAGS=${opal_check_ofi_save_LDFLAGS}

ompi/mca/mtl/ofi/mtl_ofi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,11 @@ int ompi_mtl_ofi_register_buffer(struct opal_convertor_t *convertor,
326326
} else if (0 == strcmp(opal_accelerator_base_selected_component.base_version.mca_component_name, "cuda")) {
327327
attr.iface = FI_HMEM_CUDA;
328328
opal_accelerator.get_device(&attr.device.cuda);
329+
#if OPAL_OFI_HAVE_FI_HMEM_ROCR
329330
} else if (0 == strcmp(opal_accelerator_base_selected_component.base_version.mca_component_name, "rocm")) {
330331
attr.iface = FI_HMEM_ROCR;
331332
opal_accelerator.get_device(&attr.device.cuda);
333+
#endif
332334
} else {
333335
return OPAL_ERROR;
334336
}

opal/mca/btl/ofi/btl_ofi_module.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,11 @@ int mca_btl_ofi_reg_mem(void *reg_data, void *base, size_t size,
263263
if (0 == strcmp(opal_accelerator_base_selected_component.base_version.mca_component_name, "cuda")) {
264264
attr.iface = FI_HMEM_CUDA;
265265
opal_accelerator.get_device(&attr.device.cuda);
266+
#if OPAL_OFI_HAVE_FI_HMEM_ROCR
266267
} else if (0 == strcmp(opal_accelerator_base_selected_component.base_version.mca_component_name, "rocm")) {
267268
attr.iface = FI_HMEM_ROCR;
268269
opal_accelerator.get_device(&attr.device.cuda);
270+
#endif
269271
} else {
270272
return OPAL_ERROR;
271273
}

0 commit comments

Comments
 (0)