1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Merge pull request #25978 from chacha21:cuda_stdallocator

Adding getStdAllocator() to cv::cuda::GpuMat
This commit is contained in:
Alexander Smorkalov
2024-08-05 10:58:33 +03:00
committed by GitHub
3 changed files with 13 additions and 0 deletions
@@ -118,6 +118,7 @@ public:
//! default allocator
CV_WRAP static GpuMat::Allocator* defaultAllocator();
CV_WRAP static void setDefaultAllocator(GpuMat::Allocator* allocator);
CV_WRAP static GpuMat::Allocator* getStdAllocator();
//! default constructor
CV_WRAP explicit GpuMat(GpuMat::Allocator* allocator = GpuMat::defaultAllocator());
+7
View File
@@ -135,6 +135,7 @@ namespace
DefaultAllocator cudaDefaultAllocator;
GpuMat::Allocator* g_defaultAllocator = &cudaDefaultAllocator;
GpuMat::Allocator* g_stdAllocator = &cudaDefaultAllocator;
}
GpuMat::Allocator* cv::cuda::GpuMat::defaultAllocator()
@@ -148,6 +149,12 @@ void cv::cuda::GpuMat::setDefaultAllocator(Allocator* allocator)
g_defaultAllocator = allocator;
}
GpuMat::Allocator* cv::cuda::GpuMat::getStdAllocator()
{
return g_stdAllocator;
}
/////////////////////////////////////////////////////
/// create
+5
View File
@@ -420,6 +420,11 @@ void cv::cuda::GpuMat::setDefaultAllocator(Allocator* allocator)
throw_no_cuda();
}
GpuMat::Allocator* cv::cuda::GpuMat::getStdAllocator()
{
return 0;
}
void cv::cuda::GpuMat::create(int _rows, int _cols, int _type)
{
CV_UNUSED(_rows);