From 8237418be661af4cd03257f786de32ac12e0d997 Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Fri, 19 Dec 2014 19:33:53 +0300 Subject: [PATCH] add Allocator parameter to cudev::GpuMat_ contructors --- .../include/opencv2/cudev/ptr2d/detail/gpumat.hpp | 28 +++++++++++----------- .../cudev/include/opencv2/cudev/ptr2d/gpumat.hpp | 14 +++++------ 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/modules/cudev/include/opencv2/cudev/ptr2d/detail/gpumat.hpp b/modules/cudev/include/opencv2/cudev/ptr2d/detail/gpumat.hpp index bc37b91..665840e 100644 --- a/modules/cudev/include/opencv2/cudev/ptr2d/detail/gpumat.hpp +++ b/modules/cudev/include/opencv2/cudev/ptr2d/detail/gpumat.hpp @@ -51,33 +51,33 @@ namespace cv { namespace cudev { template -__host__ GpuMat_::GpuMat_() - : GpuMat() +__host__ GpuMat_::GpuMat_(Allocator* allocator) + : GpuMat(allocator) { flags = (flags & ~CV_MAT_TYPE_MASK) | DataType::type; } template -__host__ GpuMat_::GpuMat_(int arows, int acols) - : GpuMat(arows, acols, DataType::type) +__host__ GpuMat_::GpuMat_(int arows, int acols, Allocator* allocator) + : GpuMat(arows, acols, DataType::type, allocator) { } template -__host__ GpuMat_::GpuMat_(Size asize) - : GpuMat(asize.height, asize.width, DataType::type) +__host__ GpuMat_::GpuMat_(Size asize, Allocator* allocator) + : GpuMat(asize.height, asize.width, DataType::type, allocator) { } template -__host__ GpuMat_::GpuMat_(int arows, int acols, Scalar val) - : GpuMat(arows, acols, DataType::type, val) +__host__ GpuMat_::GpuMat_(int arows, int acols, Scalar val, Allocator* allocator) + : GpuMat(arows, acols, DataType::type, val, allocator) { } template -__host__ GpuMat_::GpuMat_(Size asize, Scalar val) - : GpuMat(asize.height, asize.width, DataType::type, val) +__host__ GpuMat_::GpuMat_(Size asize, Scalar val, Allocator* allocator) + : GpuMat(asize.height, asize.width, DataType::type, val, allocator) { } @@ -88,8 +88,8 @@ __host__ GpuMat_::GpuMat_(const GpuMat_& m) } template -__host__ GpuMat_::GpuMat_(const GpuMat& m) - : GpuMat() +__host__ GpuMat_::GpuMat_(const GpuMat& m, Allocator* allocator) + : GpuMat(allocator) { flags = (flags & ~CV_MAT_TYPE_MASK) | DataType::type; @@ -134,8 +134,8 @@ __host__ GpuMat_::GpuMat_(const GpuMat_& m, Rect roi) } template -__host__ GpuMat_::GpuMat_(InputArray arr) - : GpuMat() +__host__ GpuMat_::GpuMat_(InputArray arr, Allocator* allocator) + : GpuMat(allocator) { flags = (flags & ~CV_MAT_TYPE_MASK) | DataType::type; upload(arr); diff --git a/modules/cudev/include/opencv2/cudev/ptr2d/gpumat.hpp b/modules/cudev/include/opencv2/cudev/ptr2d/gpumat.hpp index 02d8cb7..983652c 100644 --- a/modules/cudev/include/opencv2/cudev/ptr2d/gpumat.hpp +++ b/modules/cudev/include/opencv2/cudev/ptr2d/gpumat.hpp @@ -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); -- 2.7.4