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 <nslick@amazon.com>
  • Loading branch information
aws-nslick committed Oct 4, 2024
1 parent 37f1f11 commit c10dc1c
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 @@ -20,8 +18,10 @@ extern "C" {
#include "nccl_ofi_deque.h"
#include "nccl_ofi_freelist.h"
#include "nccl_ofi_idpool.h"
#include "nccl_ofi_tracepoint.h"
#include "nccl_ofi_ep_addr_list.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 c10dc1c

Please sign in to comment.