Skip to content

Commit

Permalink
feat(rdma): constrain C linkage to init
Browse files Browse the repository at this point in the history
On builds where lttng is enabled, the inclusion of nccl_ofi_tracepoint.h
pulls in <lttng/ust-utils.h>, 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: aws#591, branch: aws-nslick/stack/32
Signed-off-by: Nicholas Sielicki <[email protected]>
  • Loading branch information
aws-nslick committed Oct 4, 2024
1 parent 57f2f22 commit b288429
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions include/nccl_ofi_rdma.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
#ifndef NCCL_OFI_RDMA_H_
#define NCCL_OFI_RDMA_H_

#ifdef __cplusplus
extern "C" {
#endif
#include "config.h"

#include <uthash/uthash.h>
#include <rdma/fabric.h>
Expand All @@ -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 <nvtx3/nvToolsExt.h>
#endif

/* Maximum number of rails supported. This defines the size of
* messages exchanged during connection establishment (linear
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit b288429

Please sign in to comment.