mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
This commit is contained in:
@@ -390,6 +390,8 @@ CV_EXPORTS CV_NORETURN void error(int _code, const String& _err, const char* _fu
|
||||
#define CV_Error(...) do { abort(); } while (0)
|
||||
#define CV_Error_( code, args ) do { cv::format args; abort(); } while (0)
|
||||
#define CV_Assert( expr ) do { if (!(expr)) abort(); } while (0)
|
||||
#define CV_ErrorNoReturn CV_Error
|
||||
#define CV_ErrorNoReturn_ CV_Error_
|
||||
|
||||
#else // CV_STATIC_ANALYSIS
|
||||
|
||||
|
||||
@@ -368,6 +368,9 @@ inline unsigned int trailingZeros32(unsigned int value) {
|
||||
unsigned long index = 0;
|
||||
_BitScanForward(&index, value);
|
||||
return (unsigned int)index;
|
||||
#elif defined(__clang__)
|
||||
// clang-cl doesn't export _tzcnt_u32 for non BMI systems
|
||||
return value ? __builtin_ctz(value) : 32;
|
||||
#else
|
||||
return _tzcnt_u32(value);
|
||||
#endif
|
||||
|
||||
@@ -352,7 +352,8 @@ public:
|
||||
KernelArg(int _flags, UMat* _m, int wscale=1, int iwscale=1, const void* _obj=0, size_t _sz=0);
|
||||
KernelArg();
|
||||
|
||||
static KernelArg Local() { return KernelArg(LOCAL, 0); }
|
||||
static KernelArg Local(size_t localMemSize)
|
||||
{ return KernelArg(LOCAL, 0, 1, 1, 0, localMemSize); }
|
||||
static KernelArg PtrWriteOnly(const UMat& m)
|
||||
{ return KernelArg(PTR_ONLY+WRITE_ONLY, (UMat*)&m); }
|
||||
static KernelArg PtrReadOnly(const UMat& m)
|
||||
|
||||
@@ -142,9 +142,13 @@ namespace cv
|
||||
CV_EXPORTS void scalarToRawData(const cv::Scalar& s, void* buf, int type, int unroll_to = 0);
|
||||
|
||||
//! Allocate all memory buffers which will not be freed, ease filtering memcheck issues
|
||||
template <typename T>
|
||||
T* allocSingleton(size_t count) { return static_cast<T*>(fastMalloc(sizeof(T) * count)); }
|
||||
}
|
||||
CV_EXPORTS void* allocSingletonBuffer(size_t size);
|
||||
|
||||
//! Allocate all memory buffers which will not be freed, ease filtering memcheck issues
|
||||
template <typename T> static inline
|
||||
T* allocSingleton(size_t count = 1) { return static_cast<T*>(allocSingletonBuffer(sizeof(T) * count)); }
|
||||
|
||||
} // namespace
|
||||
|
||||
#if 1 // TODO: Remove in OpenCV 4.x
|
||||
|
||||
|
||||
Reference in New Issue
Block a user