@@ -30,7 +30,6 @@ extern "C" {
30
30
#endif
31
31
32
32
wrap_nvml_handle * wrap_nvml_create () {
33
- int i=0 ;
34
33
wrap_nvml_handle *nvmlh = NULL ;
35
34
36
35
/*
@@ -134,13 +133,13 @@ return NULL;
134
133
nvmlh->cuda_nvml_device_id = (int *) calloc (nvmlh->cuda_gpucount , sizeof (int ));
135
134
136
135
/* 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++) {
138
137
nvmlh->nvmlDeviceGetHandleByIndex (i, &nvmlh->devs [i]);
139
138
}
140
139
141
140
/* Query PCI info for each NVML device, and build table for mapping of */
142
141
/* 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++) {
144
143
wrap_nvmlPciInfo_t pciinfo;
145
144
nvmlh->nvmlDeviceGetPciInfo (nvmlh->devs [i], &pciinfo);
146
145
nvmlh->nvml_pci_domain_id [i] = pciinfo.domain ;
@@ -149,10 +148,10 @@ return NULL;
149
148
}
150
149
151
150
/* 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++) {
153
152
nvmlh->nvml_cuda_device_id [i] = -1 ;
154
153
}
155
- for (i=0 ; i<nvmlh->cuda_gpucount ; i++) {
154
+ for (int i=0 ; i<nvmlh->cuda_gpucount ; i++) {
156
155
cudaDeviceProp props;
157
156
nvmlh->cuda_nvml_device_id [i] = -1 ;
158
157
0 commit comments