Merge pull request #719 from jet47:gpu-fix-build
This commit is contained in:
@@ -111,6 +111,9 @@
|
||||
#define CV_CPU_NEON 11
|
||||
#define CV_HARDWARE_MAX_FEATURE 255
|
||||
|
||||
// disable SSE/AVX/NEON headers for NVCC compiler
|
||||
#ifndef __CUDACC__
|
||||
|
||||
#if defined __SSE2__ || defined _M_X64 || (defined _M_IX86_FP && _M_IX86_FP >= 2)
|
||||
# include <emmintrin.h>
|
||||
# define CV_SSE 1
|
||||
@@ -149,6 +152,8 @@
|
||||
# define CV_NEON 1
|
||||
#endif
|
||||
|
||||
#endif // __CUDACC__
|
||||
|
||||
#ifndef CV_SSE
|
||||
# define CV_SSE 0
|
||||
#endif
|
||||
@@ -336,7 +341,7 @@ typedef signed char schar;
|
||||
|
||||
CV_INLINE int cvRound( double value )
|
||||
{
|
||||
#if (defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__ && defined __SSE2__ && !defined __APPLE__)
|
||||
#if ((defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__ && defined __SSE2__ && !defined __APPLE__)) && !defined(__CUDACC__)
|
||||
__m128d t = _mm_set_sd( value );
|
||||
return _mm_cvtsd_si32(t);
|
||||
#elif defined _MSC_VER && defined _M_IX86
|
||||
@@ -361,7 +366,7 @@ CV_INLINE int cvRound( double value )
|
||||
|
||||
CV_INLINE int cvFloor( double value )
|
||||
{
|
||||
#if defined _MSC_VER && defined _M_X64 || (defined __GNUC__ && defined __SSE2__ && !defined __APPLE__)
|
||||
#if (defined _MSC_VER && defined _M_X64 || (defined __GNUC__ && defined __SSE2__ && !defined __APPLE__)) && !defined(__CUDACC__)
|
||||
__m128d t = _mm_set_sd( value );
|
||||
int i = _mm_cvtsd_si32(t);
|
||||
return i - _mm_movemask_pd(_mm_cmplt_sd(t, _mm_cvtsi32_sd(t,i)));
|
||||
@@ -377,7 +382,7 @@ CV_INLINE int cvFloor( double value )
|
||||
|
||||
CV_INLINE int cvCeil( double value )
|
||||
{
|
||||
#if defined _MSC_VER && defined _M_X64 || (defined __GNUC__ && defined __SSE2__&& !defined __APPLE__)
|
||||
#if (defined _MSC_VER && defined _M_X64 || (defined __GNUC__ && defined __SSE2__&& !defined __APPLE__)) && !defined(__CUDACC__)
|
||||
__m128d t = _mm_set_sd( value );
|
||||
int i = _mm_cvtsd_si32(t);
|
||||
return i + _mm_movemask_pd(_mm_cmplt_sd(_mm_cvtsi32_sd(t,i), t));
|
||||
|
@@ -52,6 +52,7 @@
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstring>
|
||||
#include <cctype>
|
||||
|
||||
#ifndef OPENCV_NOSTL
|
||||
# include <string>
|
||||
@@ -166,6 +167,8 @@ public:
|
||||
friend String operator+ (const String& lhs, char rhs);
|
||||
friend String operator+ (char lhs, const String& rhs);
|
||||
|
||||
String toLowerCase() const;
|
||||
|
||||
#ifndef OPENCV_NOSTL
|
||||
String(const std::string& str);
|
||||
String(const std::string& str, size_t pos, size_t len = npos);
|
||||
@@ -482,6 +485,16 @@ inline size_t String::find_last_of(const char* s, size_t pos) const
|
||||
return npos;
|
||||
}
|
||||
|
||||
inline String String::toLowerCase() const
|
||||
{
|
||||
String res(cstr_, len_);
|
||||
|
||||
for (size_t i = 0; i < len_; ++i)
|
||||
res.cstr_[i] = (char) ::tolower(cstr_[i]);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
// ************************* cv::String non-member functions *************************
|
||||
|
||||
inline String operator+ (const String& lhs, const String& rhs)
|
||||
|
@@ -358,7 +358,7 @@ AutoBuffer<_Tp, fixed_size>::AutoBuffer(const AutoBuffer<_Tp, fixed_size>& abuf
|
||||
{
|
||||
ptr = buf;
|
||||
sz = fixed_size;
|
||||
allocate(abuf.size);
|
||||
allocate(abuf.size());
|
||||
for( size_t i = 0; i < sz; i++ )
|
||||
ptr[i] = abuf.ptr[i];
|
||||
}
|
||||
@@ -369,7 +369,7 @@ AutoBuffer<_Tp, fixed_size>::operator = (const AutoBuffer<_Tp, fixed_size>& abuf
|
||||
if( this != &abuf )
|
||||
{
|
||||
deallocate();
|
||||
allocate(abuf.size);
|
||||
allocate(abuf.size());
|
||||
for( size_t i = 0; i < sz; i++ )
|
||||
ptr[i] = abuf.ptr[i];
|
||||
}
|
||||
|
Reference in New Issue
Block a user