implemented asynchronous call for GpuMat::upload() and GpuMat::download(). added test for asynchronous call.

This commit is contained in:
Andrey Morozov
2010-07-26 13:42:39 +00:00
parent bb2fe87b32
commit fff2160d1f
4 changed files with 153 additions and 4 deletions

View File

@@ -84,6 +84,12 @@ void cv::gpu::GpuMat::upload(const Mat& m)
cudaSafeCall( cudaMemcpy2D(data, step, m.data, m.step, cols * elemSize(), rows, cudaMemcpyHostToDevice) );
}
void cv::gpu::GpuMat::upload(const cv::Mat& m, CudaStream & stream)
{
CV_DbgAssert(!m.empty());
stream.enqueueUpload(m, *this);
}
void cv::gpu::GpuMat::download(cv::Mat& m) const
{
CV_DbgAssert(!this->empty());
@@ -91,6 +97,12 @@ void cv::gpu::GpuMat::download(cv::Mat& m) const
cudaSafeCall( cudaMemcpy2D(m.data, m.step, data, step, cols * elemSize(), rows, cudaMemcpyDeviceToHost) );
}
void cv::gpu::GpuMat::download(cv::Mat& m, CudaStream & stream) const
{
CV_DbgAssert(!m.empty());
stream.enqueueDownload(*this, m);
}
void cv::gpu::GpuMat::copyTo( GpuMat& m ) const
{
CV_DbgAssert(!this->empty());