  */
 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;
   

  delete valids;

  // Free big memory
  cudaFree(d_u_vals);
  cudaFree(d_v_vals);
  cudaFree(d_planes_a);
  cudaFree(d_planes_b);
  cudaFree(d_planes_c);

        cudaError_t __cudaCalloc_err = cudaMalloc(A, B*C); \
        if (__cudaCalloc_err == cudaSuccess) cudaMemset(*A, 0, B*C); \
    } while (0)

#define gpuErrchk(ans) { gpuAssert((ans), __FILE__, __LINE__); }
inline void gpuAssert(cudaError_t code, const char *file, int line, bool abort=true)
{
   if (code != cudaSuccess) 
   {
      fprintf(stderr,"GPUassert: %s %s %d\n", cudaGetErrorString(code), file, line);
      if (abort) exit(code);
   }
}

using namespace std;

