Skip to content

Commit

Permalink
fix(cuda): use decltype instead of typeof for cxx
Browse files Browse the repository at this point in the history
stack-info: PR: #565, branch: aws-nslick/stack/12
Signed-off-by: Nicholas Sielicki <nslick@amazon.com>
  • Loading branch information
aws-nslick committed Sep 4, 2024
1 parent 2c1f079 commit 743e062
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/nccl_ofi_cuda.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,24 @@ 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) { \
NCCL_OFI_WARN("Failed to load symbol " STRINGIFY(sym)); \
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)
Expand Down

0 comments on commit 743e062

Please sign in to comment.