                     bytes_device[dev]=curr_pixels+buffer_pixels*!is_first_chunk+buffer_pixels*!is_last_chunk;
                 }
                 if(i==0){
-                    // Precompute indices and needed bytes
                     for (dev = 0; dev < deviceCount; dev++){
                         cudaSetDevice(dev);
                         cudaMemcpyAsync(d_src[dev]+offset_device[dev], src+offset_host[dev]  , bytes_device[dev]*sizeof(float), cudaMemcpyHostToDevice,stream[dev*nStream_device+1]);

        
        
        // %5 of free memory shoudl be enough, we have almsot no variables in these kernels
        size_t total_pixels              = image_size[0] * image_size[1]  * image_size[2] ;
        size_t mem_slice_image           = sizeof(float)* image_size[0] * image_size[1]  ;
        size_t mem_size_image            = sizeof(float)* total_pixels;
        
        // Decide how are we handling the distribution of computation
        size_t mem_img_each_GPU;

            }
            h_u=dst;
        }else{
            cudaMallocHost((void**)&buffer_u,  pixels_per_slice*sizeof(float));
            cudaMallocHost((void**)&buffer_px, pixels_per_slice*sizeof(float));
            cudaMallocHost((void**)&buffer_py, pixels_per_slice*sizeof(float));
            cudaMallocHost((void**)&buffer_pz, pixels_per_slice*sizeof(float));
            
        }
        // We shoudl be good to go memory wise.
