   float bandwidth,
   float *query_point,
   int num_reference_points_in_this_tile,
+  float *reference_point_shared_mem,
   float *local_sum) {
-
-  extern __shared__ float reference_point_shared_mem[];
 
   int i;
   float *reference_point = reference_point_shared_mem;

__device__ void LoadReferencePoint_(
  int num_dimensions,
  float *reference,
  int reference_point_id) {

  extern __shared__ float reference_point_shared_mem[];

  int i;
  int source_pos = reference_point_id * num_dimensions;

  int i;
  float squared_distance = 0.0;
  for(i = 0; i < num_dimensions; i++) {
    float diff = (query_point[i] - reference_point[i]);
    squared_distance += diff * diff;
  }
  float kernel_value = exp(- squared_distance / (2 * bandwidth * bandwidth));
  (*local_sum) += kernel_value;
}

