1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

Adding getStdAllocator() to cv::cuda::GpuMat

To be on par with `cv::Mat`, let's add `cv::cuda::GpuMat::getStdAllocator()`
This is useful anyway, because when a user wants to use custom allocators, he might want to resort to the standard default allocator behaviour, not some other allocator that could have been set by `setDefaultAllocator()`
This commit is contained in:
chacha21
2024-08-01 09:36:08 +02:00
parent bef5a87680
commit 2db7f8e827
2 changed files with 8 additions and 0 deletions
+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