OCV_OPTION(ENABLE_SSE42 "Enable SSE4.2 instructions" OFF IF (CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) )
OCV_OPTION(ENABLE_NOISY_WARNINGS "Show all warnings even if they are too noisy" OFF )
OCV_OPTION(OPENCV_WARNINGS_ARE_ERRORS "Treat warnings as errors" OFF )
+OCV_OPTION(ENABLE_MULTI_PROCESSOR_COMPILATION "Enabling multi-processory compilation" OFF IF MSVC)
+
# uncategorized options
# ===================================================
status(" Use CUBLAS:" HAVE_CUBLAS THEN YES ELSE NO)
status(" NVIDIA GPU arch:" ${OPENCV_CUDA_ARCH_BIN})
status(" NVIDIA PTX archs:" ${OPENCV_CUDA_ARCH_BIN})
- status(" NVIDIA GPU features:" ${OPENCV_CUDA_ARCH_FEATURES})
endif()
# ========================== python ==========================
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251") #class 'std::XXX' needs to have dll-interface to be used by clients of YYY
endif()
endif()
+
+
+if (MSVC AND ENABLE_MULTI_PROCESSOR_COMPILATION)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
+endif()
cv::Size ncvMinSize = this->getClassifierCvSize();
- if (ncvMinSize.width < (unsigned)minSize.width && ncvMinSize.height < (unsigned)minSize.height)
+ if (ncvMinSize.width < minSize.width && ncvMinSize.height < minSize.height)
{
ncvMinSize.width = minSize.width;
ncvMinSize.height = minSize.height;
#include <opencv2/gpu/device/vec_traits.hpp>
#include <opencv2/gpu/device/vec_math.hpp>
#include <opencv2/gpu/device/emulation.hpp>
+
#include <iostream>
#include <stdio.h>
template<typename T> struct InInterval<T, 1>
{
- __host__ __device__ __forceinline__ InInterval(const float4& _lo, const float4& _hi) : lo(-_lo.x), hi(_hi.x) {};
+ typedef typename VecTraits<T>::elem_type E;
+ __host__ __device__ __forceinline__ InInterval(const float4& _lo, const float4& _hi) : lo((E)(-_lo.x)), hi((E)_hi.x) {};
T lo, hi;
template<typename I> __device__ __forceinline__ bool operator() (const I& a, const I& b) const
}
};
+
template<typename T> struct InInterval<T, 3>
{
+ typedef typename VecTraits<T>::elem_type E;
__host__ __device__ __forceinline__ InInterval(const float4& _lo, const float4& _hi)
- : lo (VecTraits<T>::make(-_lo.x, -_lo.y, -_lo.z)), hi (VecTraits<T>::make(_hi.x, _hi.y, _hi.z)){};
+ : lo (VecTraits<T>::make((E)(-_lo.x), (E)(-_lo.y), (E)(-_lo.z))), hi (VecTraits<T>::make((E)_hi.x, (E)_hi.y, (E)_hi.z)){};
T lo, hi;
template<typename I> __device__ __forceinline__ bool operator() (const I& a, const I& b) const
template<typename T> struct InInterval<T, 4>
{
+ typedef typename VecTraits<T>::elem_type E;
__host__ __device__ __forceinline__ InInterval(const float4& _lo, const float4& _hi)
- : lo (VecTraits<T>::make(-_lo.x, -_lo.y, -_lo.z, -_lo.w)), hi (VecTraits<T>::make(_hi.x, _hi.y, _hi.z, -_hi.w)){};
+ : lo (VecTraits<T>::make((E)(-_lo.x), (E)(-_lo.y), (E)(-_lo.z), (E)(-_lo.w))), hi (VecTraits<T>::make((E)_hi.x, (E)_hi.y, (E)_hi.z, (E)_hi.w)){};
T lo, hi;
template<typename I> __device__ __forceinline__ bool operator() (const I& a, const I& b) const
int tileSizeX = TILE_COLS, tileSizeY = TILE_ROWS;
while (grid.x > 1 || grid.y > 1)
{
- dim3 mergeGrid(ceilf(grid.x / 2.0), ceilf(grid.y / 2.0));
+ dim3 mergeGrid((int)ceilf(grid.x / 2.f), (int)ceilf(grid.y / 2.f));
dim3 mergeBlock(STA_SIZE_MERGE_X, STA_SIZE_MERGE_Y);
// debug log
// std::cout << "merging: " << grid.y << " x " << grid.x << " ---> " << mergeGrid.y << " x " << mergeGrid.x << " for tiles: " << tileSizeY << " x " << tileSizeX << std::endl;
- crossMerge<<<mergeGrid, mergeBlock, 0, stream>>>(2, 2, tileSizeY, tileSizeX, edges, comps, ceilf(grid.y / 2.0) - grid.y / 2, ceilf(grid.x / 2.0) - grid.x / 2);
+ crossMerge<<<mergeGrid, mergeBlock, 0, stream>>>(2, 2, tileSizeY, tileSizeX, edges, comps, (int)ceilf(grid.y / 2.f) - grid.y / 2, (int)ceilf(grid.x / 2.f) - grid.x / 2);
tileSizeX <<= 1;
tileSizeY <<= 1;
grid = mergeGrid;
(void)srcWhole;\r
(void)xoff;\r
(void)yoff;\r
- int iscale_x = round(fx);\r
- int iscale_y = round(fy);\r
+ int iscale_x = (int)round(fx);\r
+ int iscale_y = (int)round(fy);\r
\r
if( std::abs(fx - iscale_x) < FLT_MIN && std::abs(fy - iscale_y) < FLT_MIN)\r
ResizeDispatcherStream<IntegerAreaFilter, T>::call(src, fx, fy, dst, stream);\r
changeMask.setTo(cv::Scalar::all(0));
- funcs[prevFrame.channels() - 1][curFrame.channels() - 1](prevFrame, curFrame, make_uchar3(bestThres[0], bestThres[1], bestThres[2]), changeMask, 0);
+ funcs[prevFrame.channels() - 1][curFrame.channels() - 1](prevFrame, curFrame, make_uchar3((uchar)bestThres[0], (uchar)bestThres[1], (uchar)bestThres[2]), changeMask, 0);
}
// performs change detection for Foreground detection algorithm
}
}}}
-
-float4 scalarToCudaType(const cv::Scalar& in)
+static float4 scalarToCudaType(const cv::Scalar& in)
{
- float4 res;
- res.x = in[0]; res.y = in[1]; res.z = in[2]; res.w = in[3];
- return res;
+ return make_float4((float)in[0], (float)in[1], (float)in[2], (float)in[3]);
}
-
void cv::gpu::connectivityMask(const GpuMat& image, GpuMat& mask, const cv::Scalar& lo, const cv::Scalar& hi, Stream& s)
{
CV_Assert(!image.empty());
ensureSizeIsEnough(2, maxLines, CV_32FC2, lines);
- int count = linesGetResult_gpu(accum, lines.ptr<float2>(0), lines.ptr<int>(1), maxLines, rho, theta, threshold, doSort);
+ int count = linesGetResult_gpu(accum, lines.ptr<float2>(0), lines.ptr<int>(1), maxLines, rho, theta, (float)threshold, doSort);
if (count > 0)
lines.cols = count;
switch (map1_type)
{
case CV_32FC1:
- map1.at<float>(j, i) = src.cols - i;
- map2.at<float>(j, i) = j;
+ map1.at<float>(j, i) = (float)(src.cols - i);
+ map2.at<float>(j, i) = (float)j;
break;
case CV_32FC2:
- map1.at<Vec2f>(j, i)[0] = src.cols - i;
- map1.at<Vec2f>(j, i)[1] = j;
+ map1.at<Vec2f>(j, i)[0] = (float)(src.cols - i);
+ map1.at<Vec2f>(j, i)[1] = (float)j;
break;
case CV_16SC2:
- map1.at<Vec2s>(j, i)[0] = src.cols - i;
- map1.at<Vec2s>(j, i)[1] = j;
+ map1.at<Vec2s>(j, i)[0] = (float)(src.cols - i);
+ map1.at<Vec2s>(j, i)[1] = (float)j;
break;
default:
CV_Assert(0);