mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 07:43:03 +04:00
Merge branch 4.x
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -718,16 +718,13 @@ void Mat::create(int d0, const int* _sizes, int _type)
|
||||
if( total() > 0 )
|
||||
{
|
||||
MatAllocator *a = allocator, *a0 = getDefaultAllocator();
|
||||
#ifdef HAVE_TGPU
|
||||
if( !a || a == tegra::getAllocator() )
|
||||
a = tegra::getAllocator(d, _sizes, _type);
|
||||
#endif
|
||||
if(!a)
|
||||
a = a0;
|
||||
try
|
||||
{
|
||||
u = a->allocate(dims, size, _type, 0, step.p, ACCESS_RW /* ignored */, USAGE_DEFAULT);
|
||||
CV_Assert(u != 0);
|
||||
allocator = a;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
@@ -735,6 +732,7 @@ void Mat::create(int d0, const int* _sizes, int _type)
|
||||
throw;
|
||||
u = a0->allocate(dims, size, _type, 0, step.p, ACCESS_RW /* ignored */, USAGE_DEFAULT);
|
||||
CV_Assert(u != 0);
|
||||
allocator = a0;
|
||||
}
|
||||
CV_Assert( step[dims-1] == (size_t)CV_ELEM_SIZE(flags) );
|
||||
}
|
||||
|
||||
@@ -737,6 +737,8 @@ public:
|
||||
if( c != '\"' && c != '\'' )
|
||||
{
|
||||
ptr = skipSpaces( ptr, CV_XML_INSIDE_TAG );
|
||||
if(!ptr)
|
||||
CV_PARSE_ERROR_CPP("Invalid attribute value");
|
||||
if( *ptr != '\"' && *ptr != '\'' )
|
||||
CV_PARSE_ERROR_CPP( "Attribute value should be put into single or double quotes" );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user