add Allocator parameter to cudev::GpuMat_ contructors
authorVladislav Vinogradov <vlad.vinogradov@itseez.com>
Fri, 19 Dec 2014 16:33:53 +0000 (19:33 +0300)
committerVladislav Vinogradov <vlad.vinogradov@itseez.com>
Tue, 23 Dec 2014 14:42:49 +0000 (17:42 +0300)
modules/cudev/include/opencv2/cudev/ptr2d/detail/gpumat.hpp
modules/cudev/include/opencv2/cudev/ptr2d/gpumat.hpp

index bc37b91..665840e 100644 (file)
 namespace cv { namespace cudev {
 
 template <typename T>
-__host__ GpuMat_<T>::GpuMat_()
-    : GpuMat()
+__host__ GpuMat_<T>::GpuMat_(Allocator* allocator)
+    : GpuMat(allocator)
 {
     flags = (flags & ~CV_MAT_TYPE_MASK) | DataType<T>::type;
 }
 
 template <typename T>
-__host__ GpuMat_<T>::GpuMat_(int arows, int acols)
-    : GpuMat(arows, acols, DataType<T>::type)
+__host__ GpuMat_<T>::GpuMat_(int arows, int acols, Allocator* allocator)
+    : GpuMat(arows, acols, DataType<T>::type, allocator)
 {
 }
 
 template <typename T>
-__host__ GpuMat_<T>::GpuMat_(Size asize)
-    : GpuMat(asize.height, asize.width, DataType<T>::type)
+__host__ GpuMat_<T>::GpuMat_(Size asize, Allocator* allocator)
+    : GpuMat(asize.height, asize.width, DataType<T>::type, allocator)
 {
 }
 
 template <typename T>
-__host__ GpuMat_<T>::GpuMat_(int arows, int acols, Scalar val)
-    : GpuMat(arows, acols, DataType<T>::type, val)
+__host__ GpuMat_<T>::GpuMat_(int arows, int acols, Scalar val, Allocator* allocator)
+    : GpuMat(arows, acols, DataType<T>::type, val, allocator)
 {
 }
 
 template <typename T>
-__host__ GpuMat_<T>::GpuMat_(Size asize, Scalar val)
-    : GpuMat(asize.height, asize.width, DataType<T>::type, val)
+__host__ GpuMat_<T>::GpuMat_(Size asize, Scalar val, Allocator* allocator)
+    : GpuMat(asize.height, asize.width, DataType<T>::type, val, allocator)
 {
 }
 
@@ -88,8 +88,8 @@ __host__ GpuMat_<T>::GpuMat_(const GpuMat_& m)
 }
 
 template <typename T>
-__host__ GpuMat_<T>::GpuMat_(const GpuMat& m)
-    : GpuMat()
+__host__ GpuMat_<T>::GpuMat_(const GpuMat& m, Allocator* allocator)
+    : GpuMat(allocator)
 {
     flags = (flags & ~CV_MAT_TYPE_MASK) | DataType<T>::type;
 
@@ -134,8 +134,8 @@ __host__ GpuMat_<T>::GpuMat_(const GpuMat_& m, Rect roi)
 }
 
 template <typename T>
-__host__ GpuMat_<T>::GpuMat_(InputArray arr)
-    : GpuMat()
+__host__ GpuMat_<T>::GpuMat_(InputArray arr, Allocator* allocator)
+    : GpuMat(allocator)
 {
     flags = (flags & ~CV_MAT_TYPE_MASK) | DataType<T>::type;
     upload(arr);
index 02d8cb7..983652c 100644 (file)
@@ -63,21 +63,21 @@ public:
     typedef T value_type;
 
     //! default constructor
-    __host__ GpuMat_();
+    __host__ GpuMat_(Allocator* allocator = defaultAllocator());
 
     //! constructs GpuMat of the specified size
-    __host__ GpuMat_(int arows, int acols);
-    __host__ explicit GpuMat_(Size asize);
+    __host__ GpuMat_(int arows, int acols, Allocator* allocator = defaultAllocator());
+    __host__ explicit GpuMat_(Size asize, Allocator* allocator = defaultAllocator());
 
     //! constucts GpuMat and fills it with the specified value
-    __host__ GpuMat_(int arows, int acols, Scalar val);
-    __host__ GpuMat_(Size asize, Scalar val);
+    __host__ GpuMat_(int arows, int acols, Scalar val, Allocator* allocator = defaultAllocator());
+    __host__ GpuMat_(Size asize, Scalar val, Allocator* allocator = defaultAllocator());
 
     //! copy constructor
     __host__ GpuMat_(const GpuMat_& m);
 
     //! 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
     __host__ GpuMat_(int arows, int acols, T* adata, size_t astep = Mat::AUTO_STEP);
@@ -88,7 +88,7 @@ public:
     __host__ GpuMat_(const GpuMat_& m, Rect roi);
 
     //! builds GpuMat from host memory (Blocking call)
-    __host__ explicit GpuMat_(InputArray arr);
+    __host__ explicit GpuMat_(InputArray arr, Allocator* allocator = defaultAllocator());
 
     //! assignment operators
     __host__ GpuMat_& operator =(const GpuMat_& m);