diff options
Diffstat (limited to 'src/include/utils.h')
-rw-r--r-- | src/include/utils.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/include/utils.h b/src/include/utils.h index 5acccc2..266abca 100644 --- a/src/include/utils.h +++ b/src/include/utils.h @@ -10,6 +10,14 @@ #include "nccl.h" #include <stdint.h> +int ncclCudaCompCap(); + +// PCI Bus ID <-> int64 conversion functions +ncclResult_t int64ToBusId(int64_t id, char* busId); +ncclResult_t busIdToInt64(char* busId, int64_t* id); + +ncclResult_t getBusId(int cudaDev, int64_t *busId); + ncclResult_t getHostName(char* hostname, int maxlen, const char delim); uint64_t getHash(const char* string, int n); uint64_t getHostHash(); @@ -23,4 +31,10 @@ struct netIf { int parseStringList(const char* string, struct netIf* ifList, int maxList); bool matchIfList(const char* string, int port, struct netIf* ifList, int listSize, bool matchExact); +static long log2i(long n) { + long l = 0; + while (n>>=1) l++; + return l; +} + #endif |