get rid of cuda.h usage

pull/3445/head
Vladislav Vinogradov 10 years ago
parent 3dd1afe4ec
commit eeb997261d
  1. 4
      modules/gpu/src/color.cpp
  2. 2
      modules/gpu/src/cu_safe_call.cpp
  3. 2
      modules/gpu/src/cu_safe_call.h
  4. 4
      modules/gpu/src/cudastream.cpp
  5. 8
      modules/gpu/src/graphcuts.cpp
  6. 6
      modules/gpu/src/matrix_reductions.cpp
  7. 3
      modules/gpu/src/precomp.hpp
  8. 4
      modules/gpu/test/test_color.cpp
  9. 1
      modules/gpu/test/test_precomp.hpp
  10. 2
      modules/gpu/test/test_stream.cpp

@ -1577,7 +1577,7 @@ namespace
void rgba_to_mbgra(const GpuMat& src, GpuMat& dst, int, Stream& st)
{
#if (CUDA_VERSION < 5000)
#if (CUDART_VERSION < 5000)
(void)src;
(void)dst;
(void)st;
@ -1947,7 +1947,7 @@ void cv::gpu::swapChannels(GpuMat& image, const int dstOrder[4], Stream& s)
void cv::gpu::gammaCorrection(const GpuMat& src, GpuMat& dst, bool forward, Stream& stream)
{
#if (CUDA_VERSION < 5000)
#if (CUDART_VERSION < 5000)
(void)src;
(void)dst;
(void)forward;

@ -42,7 +42,7 @@
#include "cu_safe_call.h"
#ifdef HAVE_CUDA
#if defined(HAVE_CUDA) && defined(HAVE_NVCUVID)
namespace
{

@ -45,7 +45,7 @@
#include "precomp.hpp"
#ifdef HAVE_CUDA
#if defined(HAVE_CUDA) && defined(HAVE_NVCUVID)
namespace cv { namespace gpu {
namespace detail

@ -270,7 +270,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
{
@ -293,7 +293,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;

@ -144,7 +144,7 @@ namespace
void cv::gpu::graphcut(GpuMat& terminals, GpuMat& leftTransp, GpuMat& rightTransp, GpuMat& top, GpuMat& bottom, GpuMat& labels, GpuMat& buf, Stream& s)
{
#if (CUDA_VERSION < 5000)
#if (CUDART_VERSION < 5000)
CV_Assert(terminals.type() == CV_32S);
#else
CV_Assert(terminals.type() == CV_32S || terminals.type() == CV_32F);
@ -181,7 +181,7 @@ void cv::gpu::graphcut(GpuMat& terminals, GpuMat& leftTransp, GpuMat& rightTrans
NppiGraphcutStateHandler state(sznpp, buf.ptr<Npp8u>(), nppiGraphcutInitAlloc);
#if (CUDA_VERSION < 5000)
#if (CUDART_VERSION < 5000)
nppSafeCall( nppiGraphcut_32s8u(terminals.ptr<Npp32s>(), leftTransp.ptr<Npp32s>(), rightTransp.ptr<Npp32s>(), top.ptr<Npp32s>(), bottom.ptr<Npp32s>(),
static_cast<int>(terminals.step), static_cast<int>(leftTransp.step), sznpp, labels.ptr<Npp8u>(), static_cast<int>(labels.step), state) );
#else
@ -204,7 +204,7 @@ void cv::gpu::graphcut(GpuMat& terminals, GpuMat& leftTransp, GpuMat& rightTrans
void cv::gpu::graphcut(GpuMat& terminals, GpuMat& leftTransp, GpuMat& rightTransp, GpuMat& top, GpuMat& topLeft, GpuMat& topRight,
GpuMat& bottom, GpuMat& bottomLeft, GpuMat& bottomRight, GpuMat& labels, GpuMat& buf, Stream& s)
{
#if (CUDA_VERSION < 5000)
#if (CUDART_VERSION < 5000)
CV_Assert(terminals.type() == CV_32S);
#else
CV_Assert(terminals.type() == CV_32S || terminals.type() == CV_32F);
@ -253,7 +253,7 @@ void cv::gpu::graphcut(GpuMat& terminals, GpuMat& leftTransp, GpuMat& rightTrans
NppiGraphcutStateHandler state(sznpp, buf.ptr<Npp8u>(), nppiGraphcut8InitAlloc);
#if (CUDA_VERSION < 5000)
#if (CUDART_VERSION < 5000)
nppSafeCall( nppiGraphcut8_32s8u(terminals.ptr<Npp32s>(), leftTransp.ptr<Npp32s>(), rightTransp.ptr<Npp32s>(),
top.ptr<Npp32s>(), topLeft.ptr<Npp32s>(), topRight.ptr<Npp32s>(),
bottom.ptr<Npp32s>(), bottomLeft.ptr<Npp32s>(), bottomRight.ptr<Npp32s>(),

@ -132,7 +132,7 @@ void cv::gpu::meanStdDev(const GpuMat& src, Scalar& mean, Scalar& stddev, GpuMat
DeviceBuffer dbuf(2);
int bufSize;
#if (CUDA_VERSION <= 4020)
#if (CUDART_VERSION <= 4020)
nppSafeCall( nppiMeanStdDev8uC1RGetBufferHostSize(sz, &bufSize) );
#else
nppSafeCall( nppiMeanStdDevGetBufferHostSize_8u_C1R(sz, &bufSize) );
@ -187,7 +187,7 @@ double cv::gpu::norm(const GpuMat& src1, const GpuMat& src2, int normType)
CV_Assert(src1.size() == src2.size() && src1.type() == src2.type());
CV_Assert(normType == NORM_INF || normType == NORM_L1 || normType == NORM_L2);
#if CUDA_VERSION < 5050
#if CUDART_VERSION < 5050
typedef NppStatus (*func_t)(const Npp8u* pSrc1, int nSrcStep1, const Npp8u* pSrc2, int nSrcStep2, NppiSize oSizeROI, Npp64f* pRetVal);
static const func_t funcs[] = {nppiNormDiff_Inf_8u_C1R, nppiNormDiff_L1_8u_C1R, nppiNormDiff_L2_8u_C1R};
@ -212,7 +212,7 @@ double cv::gpu::norm(const GpuMat& src1, const GpuMat& src2, int normType)
DeviceBuffer dbuf;
#if CUDA_VERSION < 5050
#if CUDART_VERSION < 5050
nppSafeCall( funcs[funcIdx](src1.ptr<Npp8u>(), static_cast<int>(src1.step), src2.ptr<Npp8u>(), static_cast<int>(src2.step), sz, dbuf) );
#else
int bufSize;

@ -82,8 +82,6 @@
#define OPENCV_GPU_UNUSED(x) (void)x
#ifdef HAVE_CUDA
#include <cuda.h>
#include <cuda_runtime.h>
#include <npp.h>
@ -96,6 +94,7 @@
#endif
#ifdef HAVE_NVCUVID
#include <cuda.h>
#include <nvcuvid.h>
#ifdef WIN32

@ -2048,7 +2048,7 @@ GPU_TEST_P(CvtColor, Luv2LRGBA)
EXPECT_MAT_NEAR(dst_gold, dst, depth == CV_8U ? 1 : 1e-4);
}
#if defined (CUDA_VERSION) && (CUDA_VERSION >= 5000)
#if defined (CUDART_VERSION) && (CUDART_VERSION >= 5000)
GPU_TEST_P(CvtColor, RGBA2mRGBA)
{
@ -2066,7 +2066,7 @@ GPU_TEST_P(CvtColor, RGBA2mRGBA)
EXPECT_MAT_NEAR(dst_gold, dst, 1);
}
#endif // defined (CUDA_VERSION) && (CUDA_VERSION >= 5000)
#endif // defined (CUDART_VERSION) && (CUDART_VERSION >= 5000)
GPU_TEST_P(CvtColor, BayerBG2BGR)
{

@ -67,7 +67,6 @@
#include "cvconfig.h"
#ifdef HAVE_CUDA
#include <cuda.h>
#include <cuda_runtime.h>
#include "opencv2/ts/ts.hpp"

@ -46,7 +46,7 @@
using namespace cvtest;
#if CUDA_VERSION >= 5000
#if CUDART_VERSION >= 5000
struct Async : testing::TestWithParam<cv::gpu::DeviceInfo>
{

Loading…
Cancel
Save