implemented asynchronous call for GpuMat::upload() and GpuMat::download(). added test for asynchronous call.
This commit is contained in:
@@ -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());
|
||||
|
Reference in New Issue
Block a user