moved BufferPool management functions to public

This commit is contained in:
Vladislav Vinogradov 2013-10-07 18:31:33 +04:00
parent 5ea8085220
commit 3b412b51ac
4 changed files with 8 additions and 7 deletions

View File

@ -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);
//! 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 is limited cv::Mat with page locked memory allocation.

View File

@ -122,9 +122,6 @@ namespace cv { namespace cuda
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)
{
if (code < 0)

View File

@ -378,12 +378,12 @@ void cv::cuda::StackAllocator::free(uchar* devPtr, int* refcount)
fastFree(refcount);
}
void cv::cuda::setBufferAllocatorUsage(bool on)
void cv::cuda::setBufferPoolUsage(bool 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();

View File

@ -95,10 +95,10 @@ PERF_TEST_P(Sz, BufferPool, CUDA_TYPICAL_MAT_SIZES)
GpuMat src1(host_src), src2(host_src);
GpuMat dst;
setBufferAllocatorUsage(useBufferPool);
setBufferPoolUsage(useBufferPool);
if (useBufferPool && first)
{
allocateMemoryPool(-1, 25 * 1024 * 1024, 2);
setBufferPoolConfig(-1, 25 * 1024 * 1024, 2);
first = false;
}