Commit 8237418b authored by Vladislav Vinogradov's avatar Vladislav Vinogradov

add Allocator parameter to cudev::GpuMat_ contructors

parent f054d631
...@@ -51,33 +51,33 @@ ...@@ -51,33 +51,33 @@
namespace cv { namespace cudev { namespace cv { namespace cudev {
template <typename T> template <typename T>
__host__ GpuMat_<T>::GpuMat_() __host__ GpuMat_<T>::GpuMat_(Allocator* allocator)
: GpuMat() : GpuMat(allocator)
{ {
flags = (flags & ~CV_MAT_TYPE_MASK) | DataType<T>::type; flags = (flags & ~CV_MAT_TYPE_MASK) | DataType<T>::type;
} }
template <typename T> template <typename T>
__host__ GpuMat_<T>::GpuMat_(int arows, int acols) __host__ GpuMat_<T>::GpuMat_(int arows, int acols, Allocator* allocator)
: GpuMat(arows, acols, DataType<T>::type) : GpuMat(arows, acols, DataType<T>::type, allocator)
{ {
} }
template <typename T> template <typename T>
__host__ GpuMat_<T>::GpuMat_(Size asize) __host__ GpuMat_<T>::GpuMat_(Size asize, Allocator* allocator)
: GpuMat(asize.height, asize.width, DataType<T>::type) : GpuMat(asize.height, asize.width, DataType<T>::type, allocator)
{ {
} }
template <typename T> template <typename T>
__host__ GpuMat_<T>::GpuMat_(int arows, int acols, Scalar val) __host__ GpuMat_<T>::GpuMat_(int arows, int acols, Scalar val, Allocator* allocator)
: GpuMat(arows, acols, DataType<T>::type, val) : GpuMat(arows, acols, DataType<T>::type, val, allocator)
{ {
} }
template <typename T> template <typename T>
__host__ GpuMat_<T>::GpuMat_(Size asize, Scalar val) __host__ GpuMat_<T>::GpuMat_(Size asize, Scalar val, Allocator* allocator)
: GpuMat(asize.height, asize.width, DataType<T>::type, val) : GpuMat(asize.height, asize.width, DataType<T>::type, val, allocator)
{ {
} }
...@@ -88,8 +88,8 @@ __host__ GpuMat_<T>::GpuMat_(const GpuMat_& m) ...@@ -88,8 +88,8 @@ __host__ GpuMat_<T>::GpuMat_(const GpuMat_& m)
} }
template <typename T> template <typename T>
__host__ GpuMat_<T>::GpuMat_(const GpuMat& m) __host__ GpuMat_<T>::GpuMat_(const GpuMat& m, Allocator* allocator)
: GpuMat() : GpuMat(allocator)
{ {
flags = (flags & ~CV_MAT_TYPE_MASK) | DataType<T>::type; flags = (flags & ~CV_MAT_TYPE_MASK) | DataType<T>::type;
...@@ -134,8 +134,8 @@ __host__ GpuMat_<T>::GpuMat_(const GpuMat_& m, Rect roi) ...@@ -134,8 +134,8 @@ __host__ GpuMat_<T>::GpuMat_(const GpuMat_& m, Rect roi)
} }
template <typename T> template <typename T>
__host__ GpuMat_<T>::GpuMat_(InputArray arr) __host__ GpuMat_<T>::GpuMat_(InputArray arr, Allocator* allocator)
: GpuMat() : GpuMat(allocator)
{ {
flags = (flags & ~CV_MAT_TYPE_MASK) | DataType<T>::type; flags = (flags & ~CV_MAT_TYPE_MASK) | DataType<T>::type;
upload(arr); upload(arr);
......
...@@ -63,21 +63,21 @@ public: ...@@ -63,21 +63,21 @@ public:
typedef T value_type; typedef T value_type;
//! default constructor //! default constructor
__host__ GpuMat_(); __host__ GpuMat_(Allocator* allocator = defaultAllocator());
//! constructs GpuMat of the specified size //! constructs GpuMat of the specified size
__host__ GpuMat_(int arows, int acols); __host__ GpuMat_(int arows, int acols, Allocator* allocator = defaultAllocator());
__host__ explicit GpuMat_(Size asize); __host__ explicit GpuMat_(Size asize, Allocator* allocator = defaultAllocator());
//! constucts GpuMat and fills it with the specified value //! constucts GpuMat and fills it with the specified value
__host__ GpuMat_(int arows, int acols, Scalar val); __host__ GpuMat_(int arows, int acols, Scalar val, Allocator* allocator = defaultAllocator());
__host__ GpuMat_(Size asize, Scalar val); __host__ GpuMat_(Size asize, Scalar val, Allocator* allocator = defaultAllocator());
//! copy constructor //! copy constructor
__host__ GpuMat_(const GpuMat_& m); __host__ GpuMat_(const GpuMat_& m);
//! copy/conversion contructor. If m is of different type, it's converted //! copy/conversion contructor. If m is of different type, it's converted
__host__ explicit GpuMat_(const GpuMat& m); __host__ explicit GpuMat_(const GpuMat& m, Allocator* allocator = defaultAllocator());
//! constructs a matrix on top of user-allocated data. step is in bytes(!!!), regardless of the type //! constructs a matrix on top of user-allocated data. step is in bytes(!!!), regardless of the type
__host__ GpuMat_(int arows, int acols, T* adata, size_t astep = Mat::AUTO_STEP); __host__ GpuMat_(int arows, int acols, T* adata, size_t astep = Mat::AUTO_STEP);
...@@ -88,7 +88,7 @@ public: ...@@ -88,7 +88,7 @@ public:
__host__ GpuMat_(const GpuMat_& m, Rect roi); __host__ GpuMat_(const GpuMat_& m, Rect roi);
//! builds GpuMat from host memory (Blocking call) //! builds GpuMat from host memory (Blocking call)
__host__ explicit GpuMat_(InputArray arr); __host__ explicit GpuMat_(InputArray arr, Allocator* allocator = defaultAllocator());
//! assignment operators //! assignment operators
__host__ GpuMat_& operator =(const GpuMat_& m); __host__ GpuMat_& operator =(const GpuMat_& m);
......
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