     using Clustering::Tools::min_multiplicator;
     ASSUME_ALIGNED(coords);
     unsigned int n_radii = radii.size();
-    // square radii
-    for (float& r: radii) {
-      r *= r;
+    std::vector<float> rad2(n_radii);
+    for (std::size_t i=0; i < n_radii; ++i) {
+      rad2[i] = radii[i]*radii[i];
     }
     // GPU setup
     cudaSetDevice(i_gpu);
     float* d_coords;
-    float* d_radii2;
+    float* d_rad2;
     unsigned int* d_pops;
     cudaMalloc((void**) &d_coords
              , sizeof(float) * n_rows * n_cols);
     cudaMalloc((void**) &d_pops
              , sizeof(unsigned int) * n_rows * n_radii);
-    cudaMalloc((void**) &d_radii2
+    cudaMalloc((void**) &d_rad2
              , sizeof(float) * n_radii);
     cudaMemset(d_pops
              , 0

             , coords
             , sizeof(float) * n_rows * n_cols
             , cudaMemcpyHostToDevice);
    cudaMemcpy(d_radii2
             , radii.data()
             , sizeof(float) * n_radii
             , cudaMemcpyHostToDevice);
    int max_shared_mem;


// for pops
#define BSIZE_POPS 64

// for neighborhood search
#define BSIZE_NH 128
