mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
fixed ~200 warnings for windows
minor build system changes (now cuda code in opencv_core is compiled using CUDA_ARCH* cmake variables)
This commit is contained in:
@@ -10,19 +10,9 @@ if(HAVE_CUDA)
|
||||
file(GLOB lib_cuda "src/cuda/*.cu")
|
||||
source_group("Cuda" FILES "${lib_cuda}")
|
||||
|
||||
include_directories(${CUDA_INCLUDE_DIRS} "${OpenCV_SOURCE_DIR}/modules/gpu/src" "${OpenCV_SOURCE_DIR}/modules/gpu/src/cuda")
|
||||
|
||||
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -gencode arch=compute_10,code=sm_10
|
||||
-gencode arch=compute_11,code=sm_11
|
||||
-gencode arch=compute_12,code=sm_12
|
||||
-gencode arch=compute_13,code=sm_13
|
||||
-gencode arch=compute_20,code=sm_20
|
||||
-gencode arch=compute_20,code=sm_21)
|
||||
|
||||
include_directories(${CUDA_INCLUDE_DIRS} "${OpenCV_SOURCE_DIR}/modules/gpu/src" "${OpenCV_SOURCE_DIR}/modules/gpu/src/cuda")
|
||||
OCV_CUDA_COMPILE(cuda_objs ${lib_cuda})
|
||||
|
||||
unset(CUDA_npp_LIBRARY CACHE)
|
||||
find_cuda_helper_libs(npp)
|
||||
|
||||
set(cuda_link_libs ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY})
|
||||
else()
|
||||
set(lib_cuda "")
|
||||
|
||||
@@ -291,7 +291,7 @@ template<typename _Tp>
|
||||
buf = "";
|
||||
if (del_space(it->second[1]) != "") buf += del_space(it->second[1]);
|
||||
|
||||
while (true)
|
||||
for(;;)
|
||||
{
|
||||
bool tr = ((int)buf.length() > col_d-2) ? true: false;
|
||||
int pos;
|
||||
@@ -299,7 +299,7 @@ template<typename _Tp>
|
||||
if (tr)
|
||||
{
|
||||
pos = buf.find_first_of(' ');
|
||||
while (true)
|
||||
for(;;)
|
||||
{
|
||||
if ((int)buf.find_first_of(' ', pos + 1 ) < col_d-2 &&
|
||||
(int)buf.find_first_of(' ', pos + 1 ) != (int)std::string::npos)
|
||||
|
||||
@@ -161,9 +161,11 @@ void icvSetOpenGlFuncTab(const CvOpenGlFuncTab* tab)
|
||||
void cv::gpu::setGlDevice(int device)
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
(void)device;
|
||||
throw_nocuda;
|
||||
#else
|
||||
#ifndef HAVE_OPENGL
|
||||
(void)device;
|
||||
throw_nogl;
|
||||
#else
|
||||
if (!glFuncTab()->isGlContextInitialized())
|
||||
@@ -483,6 +485,7 @@ inline void cv::GlBuffer::Impl::unmapDevice(cudaStream_t stream)
|
||||
cv::GlBuffer::GlBuffer(Usage usage) : rows_(0), cols_(0), type_(0), usage_(usage)
|
||||
{
|
||||
#ifndef HAVE_OPENGL
|
||||
(void)usage;
|
||||
throw_nogl;
|
||||
#else
|
||||
impl_ = Impl::empty();
|
||||
@@ -492,6 +495,10 @@ cv::GlBuffer::GlBuffer(Usage usage) : rows_(0), cols_(0), type_(0), usage_(usage
|
||||
cv::GlBuffer::GlBuffer(int rows, int cols, int type, Usage usage) : rows_(0), cols_(0), type_(0), usage_(usage)
|
||||
{
|
||||
#ifndef HAVE_OPENGL
|
||||
(void)rows;
|
||||
(void)cols;
|
||||
(void)type;
|
||||
(void)usage;
|
||||
throw_nogl;
|
||||
#else
|
||||
impl_ = new Impl(rows, cols, type, usage);
|
||||
@@ -504,6 +511,9 @@ cv::GlBuffer::GlBuffer(int rows, int cols, int type, Usage usage) : rows_(0), co
|
||||
cv::GlBuffer::GlBuffer(Size size, int type, Usage usage) : rows_(0), cols_(0), type_(0), usage_(usage)
|
||||
{
|
||||
#ifndef HAVE_OPENGL
|
||||
(void)size;
|
||||
(void)type;
|
||||
(void)usage;
|
||||
throw_nogl;
|
||||
#else
|
||||
impl_ = new Impl(size.height, size.width, type, usage);
|
||||
@@ -516,6 +526,8 @@ cv::GlBuffer::GlBuffer(Size size, int type, Usage usage) : rows_(0), cols_(0), t
|
||||
cv::GlBuffer::GlBuffer(InputArray mat_, Usage usage) : rows_(0), cols_(0), type_(0), usage_(usage)
|
||||
{
|
||||
#ifndef HAVE_OPENGL
|
||||
(void)mat_;
|
||||
(void)usage;
|
||||
throw_nogl;
|
||||
#else
|
||||
int kind = mat_.kind();
|
||||
@@ -547,6 +559,10 @@ cv::GlBuffer::GlBuffer(InputArray mat_, Usage usage) : rows_(0), cols_(0), type_
|
||||
void cv::GlBuffer::create(int rows, int cols, int type, Usage usage)
|
||||
{
|
||||
#ifndef HAVE_OPENGL
|
||||
(void)rows;
|
||||
(void)cols;
|
||||
(void)type;
|
||||
(void)usage;
|
||||
throw_nogl;
|
||||
#else
|
||||
if (rows_ != rows || cols_ != cols || type_ != type || usage_ != usage)
|
||||
@@ -572,6 +588,7 @@ void cv::GlBuffer::release()
|
||||
void cv::GlBuffer::copyFrom(InputArray mat_)
|
||||
{
|
||||
#ifndef HAVE_OPENGL
|
||||
(void)mat_;
|
||||
throw_nogl;
|
||||
#else
|
||||
int kind = mat_.kind();
|
||||
@@ -910,6 +927,9 @@ cv::GlTexture::GlTexture() : rows_(0), cols_(0), type_(0)
|
||||
cv::GlTexture::GlTexture(int rows, int cols, int type) : rows_(0), cols_(0), type_(0)
|
||||
{
|
||||
#ifndef HAVE_OPENGL
|
||||
(void)rows;
|
||||
(void)cols;
|
||||
(void)type;
|
||||
throw_nogl;
|
||||
#else
|
||||
impl_ = new Impl(rows, cols, type);
|
||||
@@ -922,6 +942,8 @@ cv::GlTexture::GlTexture(int rows, int cols, int type) : rows_(0), cols_(0), typ
|
||||
cv::GlTexture::GlTexture(Size size, int type) : rows_(0), cols_(0), type_(0)
|
||||
{
|
||||
#ifndef HAVE_OPENGL
|
||||
(void)size;
|
||||
(void)type;
|
||||
throw_nogl;
|
||||
#else
|
||||
impl_ = new Impl(size.height, size.width, type);
|
||||
@@ -934,6 +956,8 @@ cv::GlTexture::GlTexture(Size size, int type) : rows_(0), cols_(0), type_(0)
|
||||
cv::GlTexture::GlTexture(InputArray mat_, bool bgra) : rows_(0), cols_(0), type_(0)
|
||||
{
|
||||
#ifndef HAVE_OPENGL
|
||||
(void)mat_;
|
||||
(void)bgra;
|
||||
throw_nogl;
|
||||
#else
|
||||
int kind = mat_.kind();
|
||||
@@ -977,6 +1001,9 @@ cv::GlTexture::GlTexture(InputArray mat_, bool bgra) : rows_(0), cols_(0), type_
|
||||
void cv::GlTexture::create(int rows, int cols, int type)
|
||||
{
|
||||
#ifndef HAVE_OPENGL
|
||||
(void)rows;
|
||||
(void)cols;
|
||||
(void)type;
|
||||
throw_nogl;
|
||||
#else
|
||||
if (rows_ != rows || cols_ != cols || type_ != type)
|
||||
@@ -1001,6 +1028,8 @@ void cv::GlTexture::release()
|
||||
void cv::GlTexture::copyFrom(InputArray mat_, bool bgra)
|
||||
{
|
||||
#ifndef HAVE_OPENGL
|
||||
(void)mat_;
|
||||
(void)bgra;
|
||||
throw_nogl;
|
||||
#else
|
||||
int kind = mat_.kind();
|
||||
@@ -1229,6 +1258,8 @@ cv::GlFont::GlFont(const string& family, int height, Weight weight, Style style)
|
||||
void cv::GlFont::draw(const char* str, int len) const
|
||||
{
|
||||
#ifndef HAVE_OPENGL
|
||||
(void)str;
|
||||
(void)len;
|
||||
throw_nogl;
|
||||
#else
|
||||
if (base_ && len > 0)
|
||||
@@ -1271,6 +1302,10 @@ namespace
|
||||
Ptr<GlFont> cv::GlFont::get(const std::string& family, int height, Weight weight, Style style)
|
||||
{
|
||||
#ifndef HAVE_OPENGL
|
||||
(void)family;
|
||||
(void)height;
|
||||
(void)weight;
|
||||
(void)style;
|
||||
throw_nogl;
|
||||
return Ptr<GlFont>();
|
||||
#else
|
||||
@@ -1296,6 +1331,9 @@ Ptr<GlFont> cv::GlFont::get(const std::string& family, int height, Weight weight
|
||||
void cv::render(const GlTexture& tex, Rect_<double> wndRect, Rect_<double> texRect)
|
||||
{
|
||||
#ifndef HAVE_OPENGL
|
||||
(void)tex;
|
||||
(void)wndRect;
|
||||
(void)texRect;
|
||||
throw_nogl;
|
||||
#else
|
||||
if (!tex.empty())
|
||||
@@ -1328,6 +1366,9 @@ void cv::render(const GlTexture& tex, Rect_<double> wndRect, Rect_<double> texRe
|
||||
void cv::render(const GlArrays& arr, int mode, Scalar color)
|
||||
{
|
||||
#ifndef HAVE_OPENGL
|
||||
(void)arr;
|
||||
(void)mode;
|
||||
(void)color;
|
||||
throw_nogl;
|
||||
#else
|
||||
glColor3d(color[0] / 255.0, color[1] / 255.0, color[2] / 255.0);
|
||||
@@ -1343,6 +1384,10 @@ void cv::render(const GlArrays& arr, int mode, Scalar color)
|
||||
void cv::render(const string& str, const Ptr<GlFont>& font, Scalar color, Point2d pos)
|
||||
{
|
||||
#ifndef HAVE_OPENGL
|
||||
(void)str;
|
||||
(void)font;
|
||||
(void)color;
|
||||
(void)pos;
|
||||
throw_nogl;
|
||||
#else
|
||||
glPushAttrib(GL_DEPTH_BUFFER_BIT);
|
||||
@@ -1497,6 +1542,9 @@ void cv::GlCamera::setupModelViewMatrix() const
|
||||
bool icvCheckGlError(const char* file, const int line, const char* func)
|
||||
{
|
||||
#ifndef HAVE_OPENGL
|
||||
(void)file;
|
||||
(void)line;
|
||||
(void)func;
|
||||
return true;
|
||||
#else
|
||||
GLenum err = glGetError();
|
||||
|
||||
@@ -82,7 +82,7 @@ private:
|
||||
void print_information(int right, int result);
|
||||
};
|
||||
|
||||
CV_CountNonZeroTest::CV_CountNonZeroTest(): eps_32(1e-8), eps_64(1e-16), src(Mat()), current_type(-1) {}
|
||||
CV_CountNonZeroTest::CV_CountNonZeroTest(): eps_32(1e-8f), eps_64(1e-16f), src(Mat()), current_type(-1) {}
|
||||
CV_CountNonZeroTest::~CV_CountNonZeroTest() {}
|
||||
|
||||
void CV_CountNonZeroTest::generate_src_data(cv::Size size, int type)
|
||||
|
||||
@@ -165,7 +165,7 @@ void Core_EigenTest_Scalar_64::run(int)
|
||||
void Core_EigenTest_32::run(int) { check_full(CV_32FC1); }
|
||||
void Core_EigenTest_64::run(int) { check_full(CV_64FC1); }
|
||||
|
||||
Core_EigenTest::Core_EigenTest() : eps_val_32(1e-3), eps_vec_32(1e-2), eps_val_64(1e-4), eps_vec_64(1e-3) {}
|
||||
Core_EigenTest::Core_EigenTest() : eps_val_32(1e-3f), eps_vec_32(1e-2f), eps_val_64(1e-4f), eps_vec_64(1e-3f) {}
|
||||
Core_EigenTest::~Core_EigenTest() {}
|
||||
|
||||
bool Core_EigenTest::check_pair_count(const cv::Mat& src, const cv::Mat& evalues, int low_index, int high_index)
|
||||
@@ -387,7 +387,7 @@ bool Core_EigenTest::check_full(int type)
|
||||
const int MATRIX_COUNT = 500;
|
||||
const int MAX_DEGREE = 7;
|
||||
|
||||
srand(time(0));
|
||||
srand((unsigned int)time(0));
|
||||
|
||||
for (int i = 1; i <= MATRIX_COUNT; ++i)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user