core/ocl: OpenCLBufferPool
This commit is contained in:
26
modules/core/include/opencv2/core/bufferpool.hpp
Normal file
26
modules/core/include/opencv2/core/bufferpool.hpp
Normal file
@@ -0,0 +1,26 @@
|
||||
// This file is part of OpenCV project.
|
||||
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||
// of this distribution and at http://opencv.org/license.html.
|
||||
//
|
||||
// Copyright (C) 2014, Advanced Micro Devices, Inc., all rights reserved.
|
||||
|
||||
#ifndef __OPENCV_CORE_BUFFER_POOL_HPP__
|
||||
#define __OPENCV_CORE_BUFFER_POOL_HPP__
|
||||
|
||||
namespace cv
|
||||
{
|
||||
|
||||
class BufferPoolController
|
||||
{
|
||||
protected:
|
||||
~BufferPoolController() { }
|
||||
public:
|
||||
virtual size_t getReservedSize() const = 0;
|
||||
virtual size_t getMaxReservedSize() const = 0;
|
||||
virtual void setMaxReservedSize(size_t size) = 0;
|
||||
virtual void freeAllReservedBuffers() = 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __OPENCV_CORE_BUFFER_POOL_HPP__
|
@@ -51,6 +51,7 @@
|
||||
#include "opencv2/core/matx.hpp"
|
||||
#include "opencv2/core/types.hpp"
|
||||
|
||||
#include "opencv2/core/bufferpool.hpp"
|
||||
|
||||
namespace cv
|
||||
{
|
||||
@@ -299,6 +300,9 @@ public:
|
||||
virtual void copy(UMatData* srcdata, UMatData* dstdata, int dims, const size_t sz[],
|
||||
const size_t srcofs[], const size_t srcstep[],
|
||||
const size_t dstofs[], const size_t dststep[], bool sync) const;
|
||||
|
||||
// default implementation returns DummyBufferPoolController
|
||||
virtual BufferPoolController* getBufferPoolController() const;
|
||||
};
|
||||
|
||||
|
||||
@@ -363,7 +367,7 @@ struct CV_EXPORTS UMatData
|
||||
int refcount;
|
||||
uchar* data;
|
||||
uchar* origdata;
|
||||
size_t size;
|
||||
size_t size, capacity;
|
||||
|
||||
int flags;
|
||||
void* handle;
|
||||
|
@@ -596,6 +596,9 @@ protected:
|
||||
Impl* p;
|
||||
};
|
||||
|
||||
|
||||
CV_EXPORTS MatAllocator* getOpenCLAllocator();
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user