1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Expose BufferPool class for external use also

This commit is contained in:
Naba Kumar
2017-03-15 15:22:32 +02:00
parent c1007c7276
commit cdcf44b3ef
3 changed files with 45 additions and 18 deletions
+17 -4
View File
@@ -668,20 +668,33 @@ void cv::cuda::setBufferPoolConfig(int deviceId, size_t stackSize, int stackCoun
#endif
}
#ifdef HAVE_CUDA
cv::cuda::BufferPool::BufferPool(Stream& stream) : allocator_(stream.impl_->stackAllocator.get())
#ifndef HAVE_CUDA
cv::cuda::BufferPool::BufferPool(Stream& stream)
{
(void) stream;
throw_no_cuda();
}
#else
cv::cuda::BufferPool::BufferPool(Stream& stream) : allocator_(stream.impl_->stackAllocator)
{
}
#endif
GpuMat cv::cuda::BufferPool::getBuffer(int rows, int cols, int type)
{
#ifndef HAVE_CUDA
(void) rows;
(void) cols;
(void) type;
throw_no_cuda();
return GpuMat();
#else
GpuMat buf(allocator_);
buf.create(rows, cols, type);
return buf;
#endif
}
#endif
////////////////////////////////////////////////////////////////
// Event