Commit 3b412b51 authored by Vladislav Vinogradov's avatar Vladislav Vinogradov

moved BufferPool management functions to public

parent 5ea80852
...@@ -276,6 +276,10 @@ CV_EXPORTS void ensureSizeIsEnough(int rows, int cols, int type, OutputArray arr ...@@ -276,6 +276,10 @@ CV_EXPORTS void ensureSizeIsEnough(int rows, int cols, int type, OutputArray arr
CV_EXPORTS GpuMat allocMatFromBuf(int rows, int cols, int type, GpuMat& mat); CV_EXPORTS GpuMat allocMatFromBuf(int rows, int cols, int type, GpuMat& mat);
//! BufferPool management (must be called before Stream creation)
CV_EXPORTS void setBufferPoolUsage(bool on);
CV_EXPORTS void setBufferPoolConfig(int deviceId, size_t stackSize, int stackCount);
//////////////////////////////// CudaMem //////////////////////////////// //////////////////////////////// CudaMem ////////////////////////////////
// CudaMem is limited cv::Mat with page locked memory allocation. // CudaMem is limited cv::Mat with page locked memory allocation.
......
...@@ -122,9 +122,6 @@ namespace cv { namespace cuda ...@@ -122,9 +122,6 @@ namespace cv { namespace cuda
GpuMat::Allocator* allocator_; GpuMat::Allocator* allocator_;
}; };
CV_EXPORTS void setBufferAllocatorUsage(bool on);
CV_EXPORTS void allocateMemoryPool(int deviceId, size_t stackSize, int stackCount);
static inline void checkNppError(int code, const char* file, const int line, const char* func) static inline void checkNppError(int code, const char* file, const int line, const char* func)
{ {
if (code < 0) if (code < 0)
......
...@@ -378,12 +378,12 @@ void cv::cuda::StackAllocator::free(uchar* devPtr, int* refcount) ...@@ -378,12 +378,12 @@ void cv::cuda::StackAllocator::free(uchar* devPtr, int* refcount)
fastFree(refcount); fastFree(refcount);
} }
void cv::cuda::setBufferAllocatorUsage(bool on) void cv::cuda::setBufferPoolUsage(bool on)
{ {
enableMemoryPool = on; enableMemoryPool = on;
} }
void cv::cuda::allocateMemoryPool(int deviceId, size_t stackSize, int stackCount) void cv::cuda::setBufferPoolConfig(int deviceId, size_t stackSize, int stackCount)
{ {
const int currentDevice = getDevice(); const int currentDevice = getDevice();
......
...@@ -95,10 +95,10 @@ PERF_TEST_P(Sz, BufferPool, CUDA_TYPICAL_MAT_SIZES) ...@@ -95,10 +95,10 @@ PERF_TEST_P(Sz, BufferPool, CUDA_TYPICAL_MAT_SIZES)
GpuMat src1(host_src), src2(host_src); GpuMat src1(host_src), src2(host_src);
GpuMat dst; GpuMat dst;
setBufferAllocatorUsage(useBufferPool); setBufferPoolUsage(useBufferPool);
if (useBufferPool && first) if (useBufferPool && first)
{ {
allocateMemoryPool(-1, 25 * 1024 * 1024, 2); setBufferPoolConfig(-1, 25 * 1024 * 1024, 2);
first = false; first = false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment