From 01c9ef9780fe47228af4bd73962733effc612f5d Mon Sep 17 00:00:00 2001 From: Nicholas Sielicki Date: Wed, 11 Sep 2024 17:08:17 -0700 Subject: [PATCH] feat(rdma): constrain C linkage to init On builds where lttng is enabled, the inclusion of nccl_ofi_tracepoint.h pulls in , which defines templates when __cplusplus is defined. Those templates cannot have C linkage. This file does not really need nccl_ofi_tracepoint.h; it only needs config.h to test for whether NVTX tracing is enabled and nvtx3 headers for conditionally defining the nvtx domain handles. It's also simultaneously true that the large majority of these headers are consumed only by rdma.c, so another option is to just move the guard down to where it's actually required. stack-info: PR: https://github.com/aws/aws-ofi-nccl/pull/591, branch: aws-nslick/stack/32 Signed-off-by: Nicholas Sielicki --- include/nccl_ofi_rdma.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/include/nccl_ofi_rdma.h b/include/nccl_ofi_rdma.h index f0206d945..7cacc3dff 100644 --- a/include/nccl_ofi_rdma.h +++ b/include/nccl_ofi_rdma.h @@ -5,9 +5,7 @@ #ifndef NCCL_OFI_RDMA_H_ #define NCCL_OFI_RDMA_H_ -#ifdef __cplusplus -extern "C" { -#endif +#include "config.h" #include #include @@ -21,7 +19,9 @@ extern "C" { #include "nccl_ofi_msgbuff.h" #include "nccl_ofi_scheduler.h" #include "nccl_ofi_topo.h" -#include "nccl_ofi_tracepoint.h" +#if HAVE_NVTX_TRACING +#include +#endif /* Maximum number of rails supported. This defines the size of * messages exchanged during connection establishment (linear @@ -840,6 +840,9 @@ typedef struct nccl_net_ofi_rdma_device { #endif } nccl_net_ofi_rdma_device_t; +#ifdef __cplusplus +extern "C" { +#endif struct nccl_net_ofi_rdma_plugin { nccl_net_ofi_plugin_t base;