mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
moved common gpu utility functionality to gpu_private.hpp
This commit is contained in:
@@ -46,8 +46,10 @@
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/core/core_c.h"
|
||||
#include "opencv2/core/gpumat.hpp"
|
||||
#include "opencv2/core/opengl.hpp"
|
||||
|
||||
#include "opencv2/core/private.hpp"
|
||||
#include "opencv2/core/gpu_private.hpp"
|
||||
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
@@ -64,37 +66,6 @@
|
||||
#define GET_OPTIMIZED(func) (func)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CUDA
|
||||
|
||||
# include <cuda_runtime.h>
|
||||
# include <npp.h>
|
||||
|
||||
# define CUDART_MINIMUM_REQUIRED_VERSION 4020
|
||||
# define NPP_MINIMUM_REQUIRED_VERSION 4200
|
||||
|
||||
# if (CUDART_VERSION < CUDART_MINIMUM_REQUIRED_VERSION)
|
||||
# error "Insufficient Cuda Runtime library version, please update it."
|
||||
# endif
|
||||
|
||||
# if (NPP_VERSION_MAJOR * 1000 + NPP_VERSION_MINOR * 100 + NPP_VERSION_BUILD < NPP_MINIMUM_REQUIRED_VERSION)
|
||||
# error "Insufficient NPP version, please update it."
|
||||
# endif
|
||||
|
||||
# if defined(__GNUC__)
|
||||
# define cudaSafeCall(expr) ___cudaSafeCall(expr, __FILE__, __LINE__, __func__)
|
||||
# else
|
||||
# define cudaSafeCall(expr) ___cudaSafeCall(expr, __FILE__, __LINE__)
|
||||
# endif
|
||||
|
||||
static inline void ___cudaSafeCall(cudaError_t err, const char *file, const int line, const char *func = "")
|
||||
{
|
||||
if (cudaSuccess != err) cv::gpu::error(cudaGetErrorString(err), file, line, func);
|
||||
}
|
||||
|
||||
#else
|
||||
# define cudaSafeCall(expr)
|
||||
#endif //HAVE_CUDA
|
||||
|
||||
namespace cv
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user