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];
|
||||
}
|
||||
|
@@ -41,7 +41,6 @@
|
||||
//M*/
|
||||
|
||||
#include "precomp.hpp"
|
||||
#include "opencv2/core/gpumat.hpp"
|
||||
|
||||
using namespace cv;
|
||||
using namespace cv::gpu;
|
||||
@@ -272,7 +271,7 @@ void cv::gpu::Stream::enqueueConvert(const GpuMat& src, GpuMat& dst, int dtype,
|
||||
convertTo(src, dst, alpha, beta, stream);
|
||||
}
|
||||
|
||||
#if CUDA_VERSION >= 5000
|
||||
#if CUDART_VERSION >= 5000
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -295,7 +294,7 @@ namespace
|
||||
|
||||
void cv::gpu::Stream::enqueueHostCallback(StreamCallback callback, void* userData)
|
||||
{
|
||||
#if CUDA_VERSION >= 5000
|
||||
#if CUDART_VERSION >= 5000
|
||||
CallbackData* data = new CallbackData;
|
||||
data->callback = callback;
|
||||
data->userData = userData;
|
||||
|
@@ -41,24 +41,6 @@
|
||||
//M*/
|
||||
|
||||
#include "precomp.hpp"
|
||||
#include "opencv2/core/gpumat.hpp"
|
||||
#include <cctype>
|
||||
|
||||
#ifdef HAVE_CUDA
|
||||
#include <cuda_runtime.h>
|
||||
#include <npp.h>
|
||||
|
||||
#define CUDART_MINIMUM_REQUIRED_VERSION 4020
|
||||
#define NPP_MINIMUM_REQUIRED_VERSION 4200
|
||||
|
||||
#if (CUDART_VERSION < CUDART_MINIMUM_REQUIRED_VERSION)
|
||||
#error "Insufficient Cuda Runtime library version, please update it."
|
||||
#endif
|
||||
|
||||
#if (NPP_VERSION_MAJOR * 1000 + NPP_VERSION_MINOR * 100 + NPP_VERSION_BUILD < NPP_MINIMUM_REQUIRED_VERSION)
|
||||
#error "Insufficient NPP version, please update it."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
using namespace cv;
|
||||
using namespace cv::gpu;
|
||||
@@ -233,7 +215,7 @@ namespace
|
||||
int cur_value;
|
||||
int chars_read;
|
||||
int args_read = sscanf(set_as_str.c_str() + pos, "%d%n", &cur_value, &chars_read);
|
||||
CV_Assert(args_read == 2);
|
||||
CV_Assert(args_read == 1);
|
||||
|
||||
arr.push_back(cur_value);
|
||||
pos += chars_read;
|
||||
|
@@ -51,6 +51,7 @@
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/core/core_c.h"
|
||||
#include "opencv2/core/internal.hpp"
|
||||
#include "opencv2/core/gpumat.hpp"
|
||||
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
@@ -68,8 +69,20 @@
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CUDA
|
||||
# include <cuda_runtime_api.h>
|
||||
# include "opencv2/core/gpumat.hpp"
|
||||
|
||||
# include <cuda_runtime.h>
|
||||
# include <npp.h>
|
||||
|
||||
# define CUDART_MINIMUM_REQUIRED_VERSION 4020
|
||||
# define NPP_MINIMUM_REQUIRED_VERSION 4200
|
||||
|
||||
# if (CUDART_VERSION < CUDART_MINIMUM_REQUIRED_VERSION)
|
||||
# error "Insufficient Cuda Runtime library version, please update it."
|
||||
# endif
|
||||
|
||||
# if (NPP_VERSION_MAJOR * 1000 + NPP_VERSION_MINOR * 100 + NPP_VERSION_BUILD < NPP_MINIMUM_REQUIRED_VERSION)
|
||||
# error "Insufficient NPP version, please update it."
|
||||
# endif
|
||||
|
||||
# if defined(__GNUC__)
|
||||
# define cudaSafeCall(expr) ___cudaSafeCall(expr, __FILE__, __LINE__, __func__)
|
||||
|
Reference in New Issue
Block a user