   float  *d_D_temp;
   float * d_D;
   cudaMalloc((void**) &d_D, D_width*D_height*sizeof(float));    
-  cudaCalloc((void**) &d_D_temp,D_width*D_height,sizeof(float)); 
+
+  cudaCalloc( (void**) &d_D_temp,D_width*D_height,sizeof(float)  );
+
   cudaMemcpy(d_D, D, width*D_height*sizeof(float), cudaMemcpyHostToDevice); //copy input image to GPU
   // first step: horizontal median filter
   dim3 threadsPerBlock(16,16,1);

 // free(D1_copy);
  //free(D2_copy);
  cudaFree(d_D1);
  cudaFree(d_D1);
}



 */
void ElasGPU::computeDisparity(std::vector<support_pt> p_support, std::vector<triangle> tri, int32_t* disparity_grid, int32_t *grid_dims,
                                uint8_t* I1_desc, uint8_t* I2_desc, bool right_image, float* D) {
  // number of disparities
  const int32_t disp_num  = grid_dims[0]-1;
  
