From dac63aed35c84a27bfe53d7ff12444e45390a610 Mon Sep 17 00:00:00 2001 From: Nicholas Sielicki Date: Mon, 12 Aug 2024 12:48:37 -0700 Subject: [PATCH] fix(cuda): use decltype instead of typeof for cxx stack-info: PR: https://github.com/aws/aws-ofi-nccl/pull/565, branch: aws-nslick/stack/12 Signed-off-by: Nicholas Sielicki --- src/nccl_ofi_cuda.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/nccl_ofi_cuda.c b/src/nccl_ofi_cuda.c index 2e90168a6..0e6b2954d 100644 --- a/src/nccl_ofi_cuda.c +++ b/src/nccl_ofi_cuda.c @@ -25,6 +25,7 @@ void *nccl_net_ofi_cuFlushGPUDirectRDMAWrites = NULL; #define STRINGIFY(sym) # sym +#ifndef __cplusplus #define LOAD_SYM(sym) \ nccl_net_ofi_##sym = (typeof(sym) *)dlsym(cudadriver_lib, STRINGIFY(sym)); \ if (nccl_net_ofi_##sym == NULL) { \ @@ -32,6 +33,16 @@ void *nccl_net_ofi_cuFlushGPUDirectRDMAWrites = NULL; ret = -ENOTSUP; \ goto error; \ } +#else +#define LOAD_SYM(sym) \ + nccl_net_ofi_##sym = (decltype(sym) *)dlsym(cudadriver_lib, STRINGIFY(sym)); \ + if (nccl_net_ofi_##sym == NULL) { \ + NCCL_OFI_WARN("Failed to load symbol " STRINGIFY(sym)); \ + ret = -ENOTSUP; \ + goto error; \ + } +#endif + int nccl_net_ofi_cuda_init(void)