From 469b69a5d05645582f94ba08631fc46c3f458981 Mon Sep 17 00:00:00 2001 From: Sylvain Jeaugey Date: Tue, 11 Dec 2018 09:19:16 -0800 Subject: [PATCH] Fix #163 : remove warnings --- src/include/topo.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/include/topo.h b/src/include/topo.h index 971ae68..e824a81 100644 --- a/src/include/topo.h +++ b/src/include/topo.h @@ -12,13 +12,16 @@ #include #include +#define BUSID_SIZE (sizeof("0000:00:00.0")) +#define BUSID_REDUCED_SIZE (sizeof("0000:00")) + static ncclResult_t getCudaPath(int cudaDev, char** path) { - char busId[16]; - CUDACHECK(cudaDeviceGetPCIBusId(busId, 16, cudaDev)); - for (int i=0; i<16; i++) busId[i] = tolower(busId[i]); + char busId[BUSID_SIZE]; + CUDACHECK(cudaDeviceGetPCIBusId(busId, BUSID_SIZE, cudaDev)); + for (int i=0; i