Skip to content

Commit

Permalink
cuda: cxx: use decltype instead of typeof for cxx
Browse files Browse the repository at this point in the history
  • Loading branch information
aws-nslick committed Sep 4, 2024
1 parent b9dc38e commit ca635a9
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 ca635a9

Please sign in to comment.