Commit b8535d17 authored by Anatoly Baksheev's avatar Anatoly Baksheev

bixed bug in cudaSafeCall

parent 55b1e9cb
...@@ -65,7 +65,7 @@ namespace cv ...@@ -65,7 +65,7 @@ namespace cv
} }
#ifdef __CUDACC__ #ifdef __CUDACC__
#define cudaSafeCall(err) { if( cudaSuccess != err) cv::gpu::error(cudaGetErrorString(err), __FILE__, __LINE__); } #define cudaSafeCall(expr) { cudaError_t err = expr; if( cudaSuccess != err) cv::gpu::error(cudaGetErrorString(err), __FILE__, __LINE__); }
#endif #endif
#endif /* __OPENCV_CUDA_SHARED_HPP__ */ #endif /* __OPENCV_CUDA_SHARED_HPP__ */
...@@ -53,30 +53,28 @@ ...@@ -53,30 +53,28 @@
#include <iostream> #include <iostream>
#include "opencv2/gpu/gpu.hpp" #include "opencv2/gpu/gpu.hpp"
#include "opencv2/gpu/gpumat.hpp"
#include "cuda_shared.hpp" #include "cuda_shared.hpp"
#ifndef HAVE_CUDA #ifndef HAVE_CUDA
#define cudaSafeCall(err) CV_Error(CV_GpuNotFound, "The library is compilled with no GPU support") #define cudaSafeCall(expr) CV_Error(CV_GpuNotFound, "The library is compilled with no GPU support")
#define cudaCallerSafeCall(err) CV_Error(CV_GpuNotFound, "The library is compilled with no GPU support") #define cudaCallerSafeCall(expr) CV_Error(CV_GpuNotFound, "The library is compilled with no GPU support")
#else /* HAVE_CUDA */ #else /* HAVE_CUDA */
#if _MSC_VER >= 1200 #if _MSC_VER >= 1200
#pragma warning (disable : 4100 4211 4201 4408) #pragma warning (disable : 4100 4211 4201 4408)
#endif #endif
#include "cuda_runtime_api.h" #include "cuda_runtime_api.h"
#ifdef __GNUC__ #ifdef __GNUC__
#define cudaSafeCall(err) { if(cudaSuccess != err) cv::gpu::error(cudaGetErrorString(err), __FILE__, __LINE__, __func__); } #define cudaSafeCall(expr) { cudaError_t err = expr; if(cudaSuccess != err) cv::gpu::error(cudaGetErrorString(err), __FILE__, __LINE__, __func__); }
#else #else
#define cudaSafeCall(err) { if(cudaSuccess != err) cv::gpu::error(cudaGetErrorString(err), __FILE__, __LINE__); } #define cudaSafeCall(expr) { cudaError_t err = expr; if(cudaSuccess != err) cv::gpu::error(cudaGetErrorString(err), __FILE__, __LINE__); }
#endif #endif
#define cudaCallerSafeCall(err) err; #define cudaCallerSafeCall(expr) expr;
#endif /* HAVE_CUDA */ #endif /* HAVE_CUDA */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment