Skip to content
This repository was archived by the owner on Apr 24, 2022. It is now read-only.

Commit fb5c136

Browse files
committedJan 27, 2018
Fix another clang warning
1 parent 3d35b5e commit fb5c136

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed
 

‎libhwmon/wrapnvml.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ extern "C" {
3030
#endif
3131

3232
wrap_nvml_handle * wrap_nvml_create() {
33-
int i=0;
3433
wrap_nvml_handle *nvmlh = NULL;
3534

3635
/*
@@ -134,13 +133,13 @@ return NULL;
134133
nvmlh->cuda_nvml_device_id = (int*) calloc(nvmlh->cuda_gpucount, sizeof(int));
135134

136135
/* Obtain GPU device handles we're going to need repeatedly... */
137-
for (i=0; i<nvmlh->nvml_gpucount; i++) {
136+
for (int i=0; i<nvmlh->nvml_gpucount; i++) {
138137
nvmlh->nvmlDeviceGetHandleByIndex(i, &nvmlh->devs[i]);
139138
}
140139

141140
/* Query PCI info for each NVML device, and build table for mapping of */
142141
/* CUDA device IDs to NVML device IDs and vice versa */
143-
for (i=0; i<nvmlh->nvml_gpucount; i++) {
142+
for (int i=0; i<nvmlh->nvml_gpucount; i++) {
144143
wrap_nvmlPciInfo_t pciinfo;
145144
nvmlh->nvmlDeviceGetPciInfo(nvmlh->devs[i], &pciinfo);
146145
nvmlh->nvml_pci_domain_id[i] = pciinfo.domain;
@@ -149,10 +148,10 @@ return NULL;
149148
}
150149

151150
/* build mapping of NVML device IDs to CUDA IDs */
152-
for (i=0; i<nvmlh->nvml_gpucount; i++) {
151+
for (int i=0; i<nvmlh->nvml_gpucount; i++) {
153152
nvmlh->nvml_cuda_device_id[i] = -1;
154153
}
155-
for (i=0; i<nvmlh->cuda_gpucount; i++) {
154+
for (int i=0; i<nvmlh->cuda_gpucount; i++) {
156155
cudaDeviceProp props;
157156
nvmlh->cuda_nvml_device_id[i] = -1;
158157

0 commit comments

Comments
 (0)
This repository has been archived.