Skip to content

Commit d01cad6

Browse files
authored
Merge pull request #11912 from hppritcha/ze_for_ofi
OFI: add Intel Level Zero (aka ZE) to OFI MTL/BTL
2 parents eda04d6 + 8337012 commit d01cad6

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

config/opal_check_ofi.m4

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ dnl Copyright (c) 2015-2020 Cisco Systems, Inc. All rights reserved.
44
dnl Copyright (c) 2016-2017 Los Alamos National Security, LLC. All rights
55
dnl reserved.
66
dnl Copyright (c) 2021-2022 Amazon.com, Inc. or its affiliates. All Rights reserved.
7+
dnl Copyright (c) 2023 Triad National Security, LLC. All rights
8+
dnl reserved.
79
dnl $COPYRIGHT$
810
dnl
911
dnl Additional copyrights may follow
@@ -155,7 +157,16 @@ AC_DEFUN([OPAL_CHECK_OFI],[
155157
156158
AC_DEFINE_UNQUOTED([OPAL_OFI_HAVE_FI_HMEM_ROCR],
157159
[${opal_check_fi_hmem_rocr}],
158-
[check if FI_HMEM_ROCR avaiable in fi_hmem_iface])])
160+
[check if FI_HMEM_ROCR avaiable in fi_hmem_iface])
161+
162+
AC_CHECK_DECL([FI_HMEM_ZE],
163+
[opal_check_fi_hmem_ze=1],
164+
[opal_check_fi_hmem_ze=0],
165+
[#include <rdma/fi_domain.h>])
166+
167+
AC_DEFINE_UNQUOTED([OPAL_OFI_HAVE_FI_HMEM_ZE],
168+
[${opal_check_fi_hmem_ze}],
169+
[check if FI_HMEM_ZE avaiable in fi_hmem_iface])])
159170
160171
CPPFLAGS=${opal_check_ofi_save_CPPFLAGS}
161172
LDFLAGS=${opal_check_ofi_save_LDFLAGS}

ompi/mca/mtl/ofi/mtl_ofi.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) 2013-2018 Intel, Inc. All rights reserved
33
* Copyright (c) 2017 Los Alamos National Security, LLC. All rights
44
* reserved.
5-
* Copyright (c) 2019-2022 Triad National Security, LLC. All rights
5+
* Copyright (c) 2019-2023 Triad National Security, LLC. All rights
66
* reserved.
77
* Copyright (c) 2018-2023 Amazon.com, Inc. or its affiliates. All Rights reserved.
88
* reserved.
@@ -327,6 +327,11 @@ int ompi_mtl_ofi_register_buffer(struct opal_convertor_t *convertor,
327327
} else if (0 == strcmp(opal_accelerator_base_selected_component.base_version.mca_component_name, "rocm")) {
328328
attr.iface = FI_HMEM_ROCR;
329329
opal_accelerator.get_device(&attr.device.cuda);
330+
#endif
331+
#if OPAL_OFI_HAVE_FI_HMEM_ZE
332+
} else if (0 == strcmp(opal_accelerator_base_selected_component.base_version.mca_component_name, "ze")) {
333+
attr.iface = FI_HMEM_ZE;
334+
opal_accelerator.get_device(&attr.device.ze);
330335
#endif
331336
} else {
332337
return OPAL_ERROR;

opal/mca/btl/ofi/btl_ofi_module.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,11 @@ int mca_btl_ofi_reg_mem(void *reg_data, void *base, size_t size,
267267
} else if (0 == strcmp(opal_accelerator_base_selected_component.base_version.mca_component_name, "rocm")) {
268268
attr.iface = FI_HMEM_ROCR;
269269
opal_accelerator.get_device(&attr.device.cuda);
270+
#endif
271+
#if OPAL_OFI_HAVE_FI_HMEM_ZE
272+
} else if (0 == strcmp(opal_accelerator_base_selected_component.base_version.mca_component_name, "ze")) {
273+
attr.iface = FI_HMEM_ZE;
274+
opal_accelerator.get_device(&attr.device.ze);
270275
#endif
271276
} else {
272277
return OPAL_ERROR;

0 commit comments

Comments
 (0)