Please use `cv::cuda::BufferPool` for temporal buffers, since it is more safe in asynchronous execution:  ``` BufferPool pool(_stream); GpuMat devHist = pool.getBuffer(1, src.cols*histSize*partitions,CV_32SC1); GpuMat devCoarseHist = pool.getBuffer(1,src.cols*histCoarseSize*partitions,CV_32SC1); ```  and please remove unnecessary `release` calls. 