Skip to content

Commit

Permalink
fix(tree): import libfabric's container_of macro (#605)
Browse files Browse the repository at this point in the history
Newer versions of libfabric are no longer defining this in
"rdma/fabric.h", but we were relying on it transiently. Bring it in-tree
to unblock compilation against libfabric master.

Signed-off-by: Nicholas Sielicki <nslick@amazon.com>
  • Loading branch information
Nicholas Sielicki authored Sep 17, 2024
1 parent b64107a commit d459367
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/nccl_ofi_config_bottom.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@
#define PATH_MAX 4096
#endif

/* Copied from libfabric:rdma/fabric.h@30ec628: "libfabric: Initial commit" */
#ifndef container_of
#define container_of(ptr, type, field) \
((type *) ((char *)ptr - offsetof(type, field)))
#endif
/* end of copied libfabric macros */

/* Workaround for platforms without memfd_create */
#ifndef HAVE_MEMFD_CREATE
#include <sys/syscall.h>
Expand Down

0 comments on commit d459367

Please sign in to comment.