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
commit 9de2ebbec1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 0 deletions

View File

@ -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());

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

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);