diff --git a/modules/gpu/CMakeLists.txt b/modules/gpu/CMakeLists.txt index 6459497871..3f7693a7ac 100644 --- a/modules/gpu/CMakeLists.txt +++ b/modules/gpu/CMakeLists.txt @@ -30,6 +30,7 @@ if (HAVE_CUDA) source_group("Src\\NVidia" FILES ${ncv_files}) ocv_include_directories("src/nvidia" "src/nvidia/core" "src/nvidia/NPP_staging" ${CUDA_INCLUDE_DIRS}) ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wmissing-declarations /wd4211 /wd4201 /wd4100 /wd4505 /wd4408) + string(REPLACE "-Wsign-promo" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") #set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-keep") #set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler;/EHsc-;") diff --git a/modules/gpu/src/arithm.cpp b/modules/gpu/src/arithm.cpp index 2a0dfeef0a..45196a522b 100644 --- a/modules/gpu/src/arithm.cpp +++ b/modules/gpu/src/arithm.cpp @@ -68,7 +68,7 @@ void cv::gpu::polarToCart(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, bool, void cv::gpu::gemm(const GpuMat& src1, const GpuMat& src2, double alpha, const GpuMat& src3, double beta, GpuMat& dst, int flags, Stream& stream) { #ifndef HAVE_CUBLAS - + (void)src1; (void)src2; (void)alpha; (void)src3; (void)beta; (void)dst; (void)flags; (void)stream; CV_Error(CV_StsNotImplemented, "The library was build without CUBLAS"); #else diff --git a/modules/gpu/src/cuda/bf_knnmatch.cu b/modules/gpu/src/cuda/bf_knnmatch.cu index 19dc9df1e4..8ee3c26c71 100644 --- a/modules/gpu/src/cuda/bf_knnmatch.cu +++ b/modules/gpu/src/cuda/bf_knnmatch.cu @@ -748,6 +748,7 @@ namespace cv { namespace gpu { namespace device const DevMem2Db& trainIdx, const DevMem2Db& distance, int cc, cudaStream_t stream) { + (void)cc; if (query.cols <= 64) { matchUnrolledCached<16, 64, Dist>(query, train, mask, static_cast< DevMem2D_ >(trainIdx), static_cast< DevMem2D_ > (distance), stream); @@ -779,6 +780,7 @@ namespace cv { namespace gpu { namespace device const DevMem2Db& trainIdx, const DevMem2Db& imgIdx, const DevMem2Db& distance, int cc, cudaStream_t stream) { + (void)cc; if (query.cols <= 64) { matchUnrolledCached<16, 64, Dist>(query, trains, n, mask, static_cast< DevMem2D_ >(trainIdx), static_cast< DevMem2D_ >(imgIdx), static_cast< DevMem2D_ > (distance), stream); @@ -943,6 +945,7 @@ namespace cv { namespace gpu { namespace device const DevMem2Df& allDist, int cc, cudaStream_t stream) { + (void)cc; if (query.cols <= 64) { calcDistanceUnrolled<16, 64, Dist>(query, train, mask, allDist, stream); diff --git a/modules/gpu/src/cuda/bf_match.cu b/modules/gpu/src/cuda/bf_match.cu index 0248dbf2d2..3068c81dc4 100644 --- a/modules/gpu/src/cuda/bf_match.cu +++ b/modules/gpu/src/cuda/bf_match.cu @@ -567,6 +567,7 @@ namespace cv { namespace gpu { namespace device const DevMem2Di& trainIdx, const DevMem2Df& distance, int cc, cudaStream_t stream) { + (void)cc; if (query.cols <= 64) { matchUnrolledCached<16, 64, Dist>(query, train, mask, trainIdx, distance, stream); @@ -598,6 +599,7 @@ namespace cv { namespace gpu { namespace device const DevMem2Di& trainIdx, const DevMem2Di& imgIdx, const DevMem2Df& distance, int cc, cudaStream_t stream) { + (void)cc; if (query.cols <= 64) { matchUnrolledCached<16, 64, Dist>(query, trains, n, mask, trainIdx, imgIdx, distance, stream); diff --git a/modules/gpu/src/cuda/bf_radius_match.cu b/modules/gpu/src/cuda/bf_radius_match.cu index 015ac0bdc5..0aa71913b2 100644 --- a/modules/gpu/src/cuda/bf_radius_match.cu +++ b/modules/gpu/src/cuda/bf_radius_match.cu @@ -281,6 +281,7 @@ namespace cv { namespace gpu { namespace device const DevMem2Di& trainIdx, const DevMem2Df& distance, const DevMem2D_& nMatches, int cc, cudaStream_t stream) { + (void)cc; if (query.cols <= 64) { matchUnrolled<16, 64, Dist>(query, train, maxDistance, mask, trainIdx, distance, nMatches, stream); @@ -312,6 +313,7 @@ namespace cv { namespace gpu { namespace device const DevMem2Di& trainIdx, const DevMem2Di& imgIdx, const DevMem2Df& distance, const DevMem2D_& nMatches, int cc, cudaStream_t stream) { + (void)cc; if (query.cols <= 64) { matchUnrolled<16, 64, Dist>(query, trains, n, maxDistance, masks, trainIdx, imgIdx, distance, nMatches, stream); diff --git a/modules/gpu/src/cuda/hog.cu b/modules/gpu/src/cuda/hog.cu index 27c550f7ed..8150bf91a7 100644 --- a/modules/gpu/src/cuda/hog.cu +++ b/modules/gpu/src/cuda/hog.cu @@ -619,6 +619,7 @@ namespace cv { namespace gpu { namespace device void compute_gradients_8UC4(int nbins, int height, int width, const DevMem2Db& img, float angle_scale, DevMem2Df grad, DevMem2Db qangle, bool correct_gamma) { + (void)nbins; const int nthreads = 256; dim3 bdim(nthreads, 1); @@ -691,6 +692,7 @@ namespace cv { namespace gpu { namespace device void compute_gradients_8UC1(int nbins, int height, int width, const DevMem2Db& img, float angle_scale, DevMem2Df grad, DevMem2Db qangle, bool correct_gamma) { + (void)nbins; const int nthreads = 256; dim3 bdim(nthreads, 1); diff --git a/modules/gpu/src/cuda/remap.cu b/modules/gpu/src/cuda/remap.cu index 80bdb2fe1a..a0b1e0d1c1 100644 --- a/modules/gpu/src/cuda/remap.cu +++ b/modules/gpu/src/cuda/remap.cu @@ -87,6 +87,9 @@ namespace cv { namespace gpu { namespace device { static void call(DevMem2D_ src, DevMem2D_ srcWhole, int xoff, int yoff, DevMem2Df mapx, DevMem2Df mapy, DevMem2D_ dst, const float* borderValue, int) { + (void)srcWhole; + (void)xoff; + (void)yoff; typedef typename TypeVec::cn>::vec_type work_type; dim3 block(32, 8); diff --git a/modules/gpu/src/cuda/resize.cu b/modules/gpu/src/cuda/resize.cu index c0f9d587ae..e0c8caefb4 100644 --- a/modules/gpu/src/cuda/resize.cu +++ b/modules/gpu/src/cuda/resize.cu @@ -131,6 +131,10 @@ namespace cv { namespace gpu { namespace device { static void call(DevMem2D_ src, DevMem2D_ srcWhole, int xoff, int yoff, float fx, float fy, DevMem2D_ dst) { + (void)srcWhole; + (void)xoff; + (void)yoff; + dim3 block(32, 8); dim3 grid(divUp(dst.cols, block.x), divUp(dst.rows, block.y)); @@ -219,6 +223,9 @@ namespace cv { namespace gpu { namespace device { static void call(DevMem2D_ src, DevMem2D_ srcWhole, int xoff, int yoff, float fx, float fy, DevMem2D_ dst, cudaStream_t stream) { + (void)srcWhole; + (void)xoff; + (void)yoff; int iscale_x = round(fx); int iscale_y = round(fy); diff --git a/modules/gpu/src/cuda/warp.cu b/modules/gpu/src/cuda/warp.cu index d40029ebbc..4757f9b4de 100644 --- a/modules/gpu/src/cuda/warp.cu +++ b/modules/gpu/src/cuda/warp.cu @@ -158,6 +158,10 @@ namespace cv { namespace gpu { namespace device { static void call(DevMem2D_ src, DevMem2D_ srcWhole, int xoff, int yoff, DevMem2D_ dst, const float* borderValue, int) { + (void)xoff; + (void)yoff; + (void)srcWhole; + typedef typename TypeVec::cn>::vec_type work_type; dim3 block(32, 8); diff --git a/modules/gpu/src/nvidia/NCVBroxOpticalFlow.cu b/modules/gpu/src/nvidia/NCVBroxOpticalFlow.cu index 6ade899c3d..e04ec844ac 100644 --- a/modules/gpu/src/nvidia/NCVBroxOpticalFlow.cu +++ b/modules/gpu/src/nvidia/NCVBroxOpticalFlow.cu @@ -1136,7 +1136,7 @@ NCVStatus NCVBroxOpticalFlow(const NCVBroxOpticalFlowDescriptor desc, ptrVNew->ptr(), dstSize, ns * sizeof (float), dstROI, 1.0f/scale_factor, 1.0f/scale_factor, nppStBicubic) ); ScaleVector(ptrVNew->ptr(), ptrVNew->ptr(), 1.0f/scale_factor, ns * nh, stream); - ncvAssertCUDALastErrorReturn(NCV_CUDA_ERROR); + ncvAssertCUDALastErrorReturn((int)NCV_CUDA_ERROR); cv::gpu::device::swap(ptrU, ptrUNew); cv::gpu::device::swap(ptrV, ptrVNew); @@ -1145,17 +1145,17 @@ NCVStatus NCVBroxOpticalFlow(const NCVBroxOpticalFlowDescriptor desc, } // end of warping iterations - ncvAssertCUDAReturn(cudaStreamSynchronize(stream), NCV_CUDA_ERROR); + ncvAssertCUDAReturn(cudaStreamSynchronize(stream), (int)NCV_CUDA_ERROR); ncvAssertCUDAReturn( cudaMemcpy2DAsync (uOut.ptr(), uOut.pitch(), ptrU->ptr(), - kSourcePitch, kSourceWidth*sizeof(float), kSourceHeight, cudaMemcpyDeviceToDevice, stream), NCV_CUDA_ERROR ); + kSourcePitch, kSourceWidth*sizeof(float), kSourceHeight, cudaMemcpyDeviceToDevice, stream), (int)NCV_CUDA_ERROR ); ncvAssertCUDAReturn( cudaMemcpy2DAsync (vOut.ptr(), vOut.pitch(), ptrV->ptr(), - kSourcePitch, kSourceWidth*sizeof(float), kSourceHeight, cudaMemcpyDeviceToDevice, stream), NCV_CUDA_ERROR ); + kSourcePitch, kSourceWidth*sizeof(float), kSourceHeight, cudaMemcpyDeviceToDevice, stream), (int)NCV_CUDA_ERROR ); - ncvAssertCUDAReturn(cudaStreamSynchronize(stream), NCV_CUDA_ERROR); + ncvAssertCUDAReturn(cudaStreamSynchronize(stream), (int)NCV_CUDA_ERROR); } return NCV_SUCCESS; diff --git a/modules/gpu/src/nvidia/NCVHaarObjectDetection.cu b/modules/gpu/src/nvidia/NCVHaarObjectDetection.cu index ad072ebfaf..3355503366 100644 --- a/modules/gpu/src/nvidia/NCVHaarObjectDetection.cu +++ b/modules/gpu/src/nvidia/NCVHaarObjectDetection.cu @@ -687,6 +687,7 @@ struct applyHaarClassifierAnchorParallelFunctor template void call(TList tl) { + (void)tl; applyHaarClassifierAnchorParallel < Loki::TL::TypeAt::Result::value, Loki::TL::TypeAt::Result::value, @@ -796,6 +797,7 @@ struct applyHaarClassifierClassifierParallelFunctor template void call(TList tl) { + (void)tl; applyHaarClassifierClassifierParallel < Loki::TL::TypeAt::Result::value, Loki::TL::TypeAt::Result::value, @@ -876,6 +878,7 @@ struct initializeMaskVectorFunctor template void call(TList tl) { + (void)tl; initializeMaskVector < Loki::TL::TypeAt::Result::value, Loki::TL::TypeAt::Result::value > diff --git a/modules/gpu/src/nvidia/core/NCV.cu b/modules/gpu/src/nvidia/core/NCV.cu index d877b585c4..2831877cb0 100644 --- a/modules/gpu/src/nvidia/core/NCV.cu +++ b/modules/gpu/src/nvidia/core/NCV.cu @@ -854,6 +854,7 @@ static NCVStatus drawRectsWrapperDevice(T *d_dst, T color, cudaStream_t cuStream) { + (void)cuStream; ncvAssertReturn(d_dst != NULL && d_rects != NULL, NCV_NULL_PTR); ncvAssertReturn(dstWidth > 0 && dstHeight > 0, NCV_DIMENSIONS_INVALID); ncvAssertReturn(dstStride >= dstWidth, NCV_INVALID_STEP); diff --git a/modules/gpu/src/nvidia/core/NCV.hpp b/modules/gpu/src/nvidia/core/NCV.hpp index 19003e3203..b359806231 100644 --- a/modules/gpu/src/nvidia/core/NCV.hpp +++ b/modules/gpu/src/nvidia/core/NCV.hpp @@ -1,7 +1,7 @@ /*M/////////////////////////////////////////////////////////////////////////////////////// // -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// // By downloading, copying, installing or using the software you agree to this license. // If you do not agree to this license, do not download, install, // copy or use the software. @@ -461,7 +461,7 @@ public: virtual NcvBool isInitialized(void) const = 0; virtual NcvBool isCounting(void) const = 0; - + virtual NCVMemoryType memType(void) const = 0; virtual Ncv32u alignment(void) const = 0; virtual size_t maxSize(void) const = 0; @@ -585,11 +585,11 @@ public: } else { - ncvAssertReturn(dst._length * sizeof(T) >= howMuch && + ncvAssertReturn(dst._length * sizeof(T) >= howMuch && this->_length * sizeof(T) >= howMuch && howMuch > 0, NCV_MEM_COPY_ERROR); } - ncvAssertReturn((this->_ptr != NULL || this->_memtype == NCVMemoryTypeNone) && + ncvAssertReturn((this->_ptr != NULL || this->_memtype == NCVMemoryTypeNone) && (dst._ptr != NULL || dst._memtype == NCVMemoryTypeNone), NCV_NULL_PTR); NCVStatus ncvStat = NCV_SUCCESS; @@ -766,18 +766,18 @@ public: } else { - ncvAssertReturn(dst._pitch * dst._height >= howMuch && + ncvAssertReturn(dst._pitch * dst._height >= howMuch && this->_pitch * this->_height >= howMuch && howMuch > 0, NCV_MEM_COPY_ERROR); } - ncvAssertReturn((this->_ptr != NULL || this->_memtype == NCVMemoryTypeNone) && + ncvAssertReturn((this->_ptr != NULL || this->_memtype == NCVMemoryTypeNone) && (dst._ptr != NULL || dst._memtype == NCVMemoryTypeNone), NCV_NULL_PTR); NCVStatus ncvStat = NCV_SUCCESS; if (this->_memtype != NCVMemoryTypeNone) { - ncvStat = memSegCopyHelper(dst._ptr, dst._memtype, - this->_ptr, this->_memtype, + ncvStat = memSegCopyHelper(dst._ptr, dst._memtype, + this->_ptr, this->_memtype, howMuch, cuStream); } @@ -788,7 +788,7 @@ public: { ncvAssertReturn(this->width() >= roi.width && this->height() >= roi.height && dst.width() >= roi.width && dst.height() >= roi.height, NCV_MEM_COPY_ERROR); - ncvAssertReturn((this->_ptr != NULL || this->_memtype == NCVMemoryTypeNone) && + ncvAssertReturn((this->_ptr != NULL || this->_memtype == NCVMemoryTypeNone) && (dst._ptr != NULL || dst._memtype == NCVMemoryTypeNone), NCV_NULL_PTR); NCVStatus ncvStat = NCV_SUCCESS; @@ -802,7 +802,7 @@ public: return ncvStat; } - T &at(Ncv32u x, Ncv32u y) const + T& at(Ncv32u x, Ncv32u y) const { NcvBool bOutRange = (x >= this->_width || y >= this->_height); ncvAssertPrintCheck(!bOutRange, "Error addressing matrix at [" << x << ", " << y << "]"); diff --git a/modules/gpu/src/nvidia/core/NCVRuntimeTemplates.hpp b/modules/gpu/src/nvidia/core/NCVRuntimeTemplates.hpp index a13d34489d..6d8277f798 100644 --- a/modules/gpu/src/nvidia/core/NCVRuntimeTemplates.hpp +++ b/modules/gpu/src/nvidia/core/NCVRuntimeTemplates.hpp @@ -211,6 +211,7 @@ namespace NCVRuntimeTemplateBool static void call(Func &functor, std::vector &templateParams) { + (void)templateParams; functor.call(TList()); } }; diff --git a/modules/gpu/src/opencv2/gpu/device/filters.hpp b/modules/gpu/src/opencv2/gpu/device/filters.hpp index 9294b5556e..c33a088cd8 100644 --- a/modules/gpu/src/opencv2/gpu/device/filters.hpp +++ b/modules/gpu/src/opencv2/gpu/device/filters.hpp @@ -55,7 +55,12 @@ namespace cv { namespace gpu { namespace device typedef typename Ptr2D::elem_type elem_type; typedef float index_type; - explicit __host__ __device__ __forceinline__ PointFilter(const Ptr2D& src_, float fx = 0.f, float fy = 0.f) : src(src_) {} + explicit __host__ __device__ __forceinline__ PointFilter(const Ptr2D& src_, float fx = 0.f, float fy = 0.f) + : src(src_) + { + (void)fx; + (void)fy; + } __device__ __forceinline__ elem_type operator ()(float y, float x) const { @@ -70,8 +75,12 @@ namespace cv { namespace gpu { namespace device typedef typename Ptr2D::elem_type elem_type; typedef float index_type; - explicit __host__ __device__ __forceinline__ LinearFilter(const Ptr2D& src_, float fx = 0.f, float fy = 0.f) : src(src_) {} - + explicit __host__ __device__ __forceinline__ LinearFilter(const Ptr2D& src_, float fx = 0.f, float fy = 0.f) + : src(src_) + { + (void)fx; + (void)fy; + } __device__ __forceinline__ elem_type operator ()(float y, float x) const { typedef typename TypeVec::cn>::vec_type work_type; @@ -107,7 +116,12 @@ namespace cv { namespace gpu { namespace device typedef float index_type; typedef typename TypeVec::cn>::vec_type work_type; - explicit __host__ __device__ __forceinline__ CubicFilter(const Ptr2D& src_, float fx = 0.f, float fy = 0.f) : src(src_) {} + explicit __host__ __device__ __forceinline__ CubicFilter(const Ptr2D& src_, float fx = 0.f, float fy = 0.f) + : src(src_) + { + (void)fx; + (void)fy; + } static __device__ __forceinline__ float bicubicCoeff(float x_) { diff --git a/modules/gpu/src/opencv2/gpu/device/functional.hpp b/modules/gpu/src/opencv2/gpu/device/functional.hpp index 32e6d0e37d..1b836c7a56 100644 --- a/modules/gpu/src/opencv2/gpu/device/functional.hpp +++ b/modules/gpu/src/opencv2/gpu/device/functional.hpp @@ -470,7 +470,7 @@ namespace cv { namespace gpu { namespace device template struct thresh_trunc_func : unary_function { - explicit __host__ __device__ __forceinline__ thresh_trunc_func(T thresh_, T maxVal_ = 0) : thresh(thresh_) {} + explicit __host__ __device__ __forceinline__ thresh_trunc_func(T thresh_, T maxVal_ = 0) : thresh(thresh_) {(void)maxVal_;} __device__ __forceinline__ T operator()(typename TypeTraits::ParameterType src) const { @@ -487,7 +487,7 @@ namespace cv { namespace gpu { namespace device template struct thresh_to_zero_func : unary_function { - explicit __host__ __device__ __forceinline__ thresh_to_zero_func(T thresh_, T maxVal_ = 0) : thresh(thresh_) {} + explicit __host__ __device__ __forceinline__ thresh_to_zero_func(T thresh_, T maxVal_ = 0) : thresh(thresh_) {(void)maxVal_;} __device__ __forceinline__ T operator()(typename TypeTraits::ParameterType src) const { @@ -503,7 +503,7 @@ namespace cv { namespace gpu { namespace device template struct thresh_to_zero_inv_func : unary_function { - explicit __host__ __device__ __forceinline__ thresh_to_zero_inv_func(T thresh_, T maxVal_ = 0) : thresh(thresh_) {} + explicit __host__ __device__ __forceinline__ thresh_to_zero_inv_func(T thresh_, T maxVal_ = 0) : thresh(thresh_) {(void)maxVal_;} __device__ __forceinline__ T operator()(typename TypeTraits::ParameterType src) const { diff --git a/modules/gpu/test/nvidia/TestHypothesesFilter.cpp b/modules/gpu/test/nvidia/TestHypothesesFilter.cpp index 4785abae41..bc60a5e13e 100644 --- a/modules/gpu/test/nvidia/TestHypothesesFilter.cpp +++ b/modules/gpu/test/nvidia/TestHypothesesFilter.cpp @@ -1,11 +1,11 @@ /* * Copyright 1993-2010 NVIDIA Corporation. All rights reserved. * - * NVIDIA Corporation and its licensors retain all intellectual - * property and proprietary rights in and to this software and - * related documentation and any modifications thereto. - * Any use, reproduction, disclosure, or distribution of this - * software and related documentation without an express license + * NVIDIA Corporation and its licensors retain all intellectual + * property and proprietary rights in and to this software and + * related documentation and any modifications thereto. + * Any use, reproduction, disclosure, or distribution of this + * software and related documentation without an express license * agreement from NVIDIA Corporation is strictly prohibited. */ @@ -13,14 +13,14 @@ #include "NCVHaarObjectDetection.hpp" -TestHypothesesFilter::TestHypothesesFilter(std::string testName, NCVTestSourceProvider &src, - Ncv32u numDstRects, Ncv32u minNeighbors, Ncv32f eps) +TestHypothesesFilter::TestHypothesesFilter(std::string testName, NCVTestSourceProvider &src_, + Ncv32u numDstRects_, Ncv32u minNeighbors_, Ncv32f eps_) : NCVTestProvider(testName), - src(src), - numDstRects(numDstRects), - minNeighbors(minNeighbors), - eps(eps) + src(src_), + numDstRects(numDstRects_), + minNeighbors(minNeighbors_), + eps(eps_) { } @@ -94,11 +94,11 @@ bool TestHypothesesFilter::process() for (Ncv32u j=0; jeps * (randVal - 0.5)); randVal = (1.0 * h_random32u.ptr()[randCnt++]) / 0xFFFFFFFF; randCnt = randCnt % h_random32u.length(); - h_vecSrc.ptr()[srcSlotSize * i + j].y = + h_vecSrc.ptr()[srcSlotSize * i + j].y = h_vecDst_groundTruth.ptr()[i].y + (Ncv32s)(h_vecDst_groundTruth.ptr()[i].height * this->eps * (randVal - 0.5)); h_vecSrc.ptr()[srcSlotSize * i + j].width = h_vecDst_groundTruth.ptr()[i].width; @@ -109,11 +109,11 @@ bool TestHypothesesFilter::process() for (Ncv32u j=numNeighbors; jcanvasWidth + h_vecDst_groundTruth.ptr()[i].x + (Ncv32s)(h_vecDst_groundTruth.ptr()[i].width * this->eps * (randVal - 0.5)); randVal = (1.0 * h_random32u.ptr()[randCnt++]) / 0xFFFFFFFF; randCnt = randCnt % h_random32u.length(); - h_vecSrc.ptr()[srcSlotSize * i + j].y = + h_vecSrc.ptr()[srcSlotSize * i + j].y = this->canvasHeight + h_vecDst_groundTruth.ptr()[i].y + (Ncv32s)(h_vecDst_groundTruth.ptr()[i].height * this->eps * (randVal - 0.5)); h_vecSrc.ptr()[srcSlotSize * i + j].width = h_vecDst_groundTruth.ptr()[i].width; @@ -124,8 +124,8 @@ bool TestHypothesesFilter::process() //shuffle for (Ncv32u i=0; inumDstRects*srcSlotSize-1; i++) { - Ncv32u randVal = h_random32u.ptr()[randCnt++]; randCnt = randCnt % h_random32u.length(); - Ncv32u secondSwap = randVal % (this->numDstRects*srcSlotSize-1 - i); + Ncv32u randValLocal = h_random32u.ptr()[randCnt++]; randCnt = randCnt % h_random32u.length(); + Ncv32u secondSwap = randValLocal % (this->numDstRects*srcSlotSize-1 - i); NcvRect32u tmp = h_vecSrc.ptr()[i + secondSwap]; h_vecSrc.ptr()[i + secondSwap] = h_vecSrc.ptr()[i]; h_vecSrc.ptr()[i] = tmp; diff --git a/modules/gpu/test/nvidia/TestResize.cpp b/modules/gpu/test/nvidia/TestResize.cpp index ff757700ff..c99c333235 100644 --- a/modules/gpu/test/nvidia/TestResize.cpp +++ b/modules/gpu/test/nvidia/TestResize.cpp @@ -1,11 +1,11 @@ /* * Copyright 1993-2010 NVIDIA Corporation. All rights reserved. * - * NVIDIA Corporation and its licensors retain all intellectual - * property and proprietary rights in and to this software and - * related documentation and any modifications thereto. - * Any use, reproduction, disclosure, or distribution of this - * software and related documentation without an express license + * NVIDIA Corporation and its licensors retain all intellectual + * property and proprietary rights in and to this software and + * related documentation and any modifications thereto. + * Any use, reproduction, disclosure, or distribution of this + * software and related documentation without an express license * agreement from NVIDIA Corporation is strictly prohibited. */ @@ -15,15 +15,15 @@ template -TestResize::TestResize(std::string testName, NCVTestSourceProvider &src, - Ncv32u width, Ncv32u height, Ncv32u scaleFactor, NcvBool bTextureCache) +TestResize::TestResize(std::string testName, NCVTestSourceProvider &src_, + Ncv32u width_, Ncv32u height_, Ncv32u scaleFactor_, NcvBool bTextureCache_) : NCVTestProvider(testName), - src(src), - width(width), - height(height), - scaleFactor(scaleFactor), - bTextureCache(bTextureCache) + src(src_), + width(width_), + height(height_), + scaleFactor(scaleFactor_), + bTextureCache(bTextureCache_) { } diff --git a/modules/gpu/test/nvidia/main_nvidia.cpp b/modules/gpu/test/nvidia/main_nvidia.cpp index 9957fda95b..bb61608946 100644 --- a/modules/gpu/test/nvidia/main_nvidia.cpp +++ b/modules/gpu/test/nvidia/main_nvidia.cpp @@ -248,6 +248,7 @@ void generateHaarLoaderTests(NCVAutoTestLister &testLister) void generateHaarApplicationTests(NCVAutoTestLister &testLister, NCVTestSourceProvider &src, Ncv32u maxWidth, Ncv32u maxHeight) { + (void)maxHeight; for (Ncv32u i=20; i<512; i+=11) { for (Ncv32u j=20; j<128; j+=5) @@ -268,11 +269,12 @@ void generateHaarApplicationTests(NCVAutoTestLister &testLister, NCVTestSourcePr static void devNullOutput(const std::string& msg) { + (void)msg; } bool nvidia_NPPST_Integral_Image(const std::string& test_data_path, OutputLevel outputLevel) { - path = test_data_path; + path = test_data_path.c_str(); ncvSetDebugOutputHandler(devNullOutput); NCVAutoTestLister testListerII("NPPST Integral Image", outputLevel); @@ -374,6 +376,7 @@ bool nvidia_NCV_Vector_Operations(const std::string& test_data_path, OutputLevel generateVectorTests(testListerVectorOperations, testSrcRandom_32u, 4096*4096); return testListerVectorOperations.invoke(); + } bool nvidia_NCV_Haar_Cascade_Loader(const std::string& test_data_path, OutputLevel outputLevel) diff --git a/modules/gpu/test/test_nvidia.cpp b/modules/gpu/test/test_nvidia.cpp index 7ce3192e51..386a66cfd7 100644 --- a/modules/gpu/test/test_nvidia.cpp +++ b/modules/gpu/test/test_nvidia.cpp @@ -58,15 +58,15 @@ struct NVidiaTest : TestWithParam { cv::gpu::DeviceInfo devInfo; - std::string path; + std::string _path; virtual void SetUp() { devInfo = GetParam(); cv::gpu::setDevice(devInfo.deviceID()); - - path = std::string(TS::ptr()->get_data_path()) + "haarcascade/"; + _path = TS::ptr()->get_data_path().c_str(); + _path = _path + "haarcascade/"; } }; @@ -84,63 +84,63 @@ OutputLevel nvidiaTestOutputLevel = OutputLevelCompact; TEST_P(NPPST, SquaredIntegral) { - bool res = nvidia_NPPST_Squared_Integral_Image(path, nvidiaTestOutputLevel); + bool res = nvidia_NPPST_Squared_Integral_Image(_path, nvidiaTestOutputLevel); ASSERT_TRUE(res); } TEST_P(NPPST, RectStdDev) { - bool res = nvidia_NPPST_RectStdDev(path, nvidiaTestOutputLevel); + bool res = nvidia_NPPST_RectStdDev(_path, nvidiaTestOutputLevel); ASSERT_TRUE(res); } TEST_P(NPPST, Resize) { - bool res = nvidia_NPPST_Resize(path, nvidiaTestOutputLevel); + bool res = nvidia_NPPST_Resize(_path, nvidiaTestOutputLevel); ASSERT_TRUE(res); } TEST_P(NPPST, VectorOperations) { - bool res = nvidia_NPPST_Vector_Operations(path, nvidiaTestOutputLevel); + bool res = nvidia_NPPST_Vector_Operations(_path, nvidiaTestOutputLevel); ASSERT_TRUE(res); } TEST_P(NPPST, Transpose) { - bool res = nvidia_NPPST_Transpose(path, nvidiaTestOutputLevel); + bool res = nvidia_NPPST_Transpose(_path, nvidiaTestOutputLevel); ASSERT_TRUE(res); } TEST_P(NCV, VectorOperations) { - bool res = nvidia_NCV_Vector_Operations(path, nvidiaTestOutputLevel); + bool res = nvidia_NCV_Vector_Operations(_path, nvidiaTestOutputLevel); ASSERT_TRUE(res); } TEST_P(NCV, HaarCascadeLoader) { - bool res = nvidia_NCV_Haar_Cascade_Loader(path, nvidiaTestOutputLevel); + bool res = nvidia_NCV_Haar_Cascade_Loader(_path, nvidiaTestOutputLevel); ASSERT_TRUE(res); } TEST_P(NCV, HaarCascadeApplication) { - bool res = nvidia_NCV_Haar_Cascade_Application(path, nvidiaTestOutputLevel); + bool res = nvidia_NCV_Haar_Cascade_Application(_path, nvidiaTestOutputLevel); ASSERT_TRUE(res); } TEST_P(NCV, HypothesesFiltration) { - bool res = nvidia_NCV_Hypotheses_Filtration(path, nvidiaTestOutputLevel); + bool res = nvidia_NCV_Hypotheses_Filtration(_path, nvidiaTestOutputLevel); ASSERT_TRUE(res); } @@ -148,7 +148,7 @@ TEST_P(NCV, HypothesesFiltration) TEST_P(NCV, Visualization) { // this functionality doesn't used in gpu module - bool res = nvidia_NCV_Visualization(path, nvidiaTestOutputLevel); + bool res = nvidia_NCV_Visualization(_path, nvidiaTestOutputLevel); ASSERT_TRUE(res); }