mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
changed kernel.set to support unsuccssful set
This commit is contained in:
@@ -599,17 +599,6 @@ protected:
|
||||
|
||||
CV_EXPORTS MatAllocator* getOpenCLAllocator();
|
||||
|
||||
#define SAFE_KERNEL_SET_ARG(idx, arg) \
|
||||
{\
|
||||
int idxNew = kernel.set(idx, arg); \
|
||||
if (-1 == idxNew)\
|
||||
{\
|
||||
printf("algorithm can't setup argument index = %d to kernel\n", idx); \
|
||||
return false; \
|
||||
}\
|
||||
idx = idxNew; \
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2796,7 +2796,8 @@ int Kernel::set(int i, const void* value, size_t sz)
|
||||
{
|
||||
if (!p || !p->handle)
|
||||
return -1;
|
||||
CV_Assert(i >= 0);
|
||||
if (i < 0)
|
||||
return i;
|
||||
if( i == 0 )
|
||||
p->cleanupUMats();
|
||||
|
||||
@@ -2822,7 +2823,8 @@ int Kernel::set(int i, const KernelArg& arg)
|
||||
{
|
||||
if( !p || !p->handle )
|
||||
return -1;
|
||||
CV_Assert( i >= 0 );
|
||||
if (i < 0)
|
||||
return i;
|
||||
if( i == 0 )
|
||||
p->cleanupUMats();
|
||||
if( arg.m )
|
||||
|
||||
Reference in New Issue
Block a user