From 4ce8de5174c1cebf227dbba66aac1b4472556b60 Mon Sep 17 00:00:00 2001 From: Anatoly Baksheev Date: Fri, 25 May 2012 09:45:42 +0000 Subject: [PATCH] Merged revision(s) 8455 from trunk/opencv/modules/gpu/src: compilation with CUDA5.0 (#1982, thanks to Rodrigo) ........ --- modules/gpu/src/element_operations.cpp | 4 ++++ modules/gpu/src/matrix_reductions.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/modules/gpu/src/element_operations.cpp b/modules/gpu/src/element_operations.cpp index 68221c4e80..c614af836d 100644 --- a/modules/gpu/src/element_operations.cpp +++ b/modules/gpu/src/element_operations.cpp @@ -997,7 +997,11 @@ namespace typedef NppTypeTraits::npp_t npp_t; typedef Npp32u scalar_t; +#if (CUDA_VERSION <= 4020) typedef NppStatus (*func_t)(const Npp16u* pSrc1, int nSrc1Step, Npp16u* pDst, int nDstStep, NppiSize oSizeROI, Npp32u nConstant); +#else + typedef NppStatus (*func_t)(const Npp16u * pSrc1, int nSrc1Step, Npp16u * pDst, int nDstStep, NppiSize oSizeROI, Npp16u nConstant); +#endif }; template ::func_t func> struct NppAbsDiffC diff --git a/modules/gpu/src/matrix_reductions.cpp b/modules/gpu/src/matrix_reductions.cpp index 4fa81e1551..ab6e0054e7 100644 --- a/modules/gpu/src/matrix_reductions.cpp +++ b/modules/gpu/src/matrix_reductions.cpp @@ -128,7 +128,11 @@ void cv::gpu::meanStdDev(const GpuMat& src, Scalar& mean, Scalar& stddev, GpuMat DeviceBuffer dbuf(2); int bufSize; +#if (CUDA_VERSION <= 4020) nppSafeCall( nppiMeanStdDev8uC1RGetBufferHostSize(sz, &bufSize) ); +#else + nppSafeCall( nppiMeanStdDevGetBufferHostSize_8u_C1R(sz, &bufSize) ); +#endif ensureSizeIsEnough(1, bufSize, CV_8UC1, buf);