added CUDA_DISABLER preprocessor commands
This commit is contained in:
@@ -40,6 +40,8 @@
|
||||
//
|
||||
//M*/
|
||||
|
||||
#if !defined CUDA_DISABLER
|
||||
|
||||
#include "opencv2/gpu/device/saturate_cast.hpp"
|
||||
#include "opencv2/gpu/device/transform.hpp"
|
||||
#include "opencv2/gpu/device/functional.hpp"
|
||||
@@ -340,3 +342,5 @@ namespace cv { namespace gpu { namespace device
|
||||
# pragma clang diagnostic pop
|
||||
#endif
|
||||
}}} // namespace cv { namespace gpu { namespace device
|
||||
|
||||
#endif /* CUDA_DISABLER */
|
@@ -94,7 +94,7 @@ namespace
|
||||
|
||||
bool cv::gpu::TargetArchs::builtWith(cv::gpu::FeatureSet feature_set)
|
||||
{
|
||||
#ifdef HAVE_CUDA
|
||||
#if defined HAVE_CUDA && !defined(CUDA_DISABLER)
|
||||
return ::compareToSet(CUDA_ARCH_FEATURES, feature_set, std::greater_equal<int>());
|
||||
#else
|
||||
(void)feature_set;
|
||||
@@ -109,7 +109,7 @@ bool cv::gpu::TargetArchs::has(int major, int minor)
|
||||
|
||||
bool cv::gpu::TargetArchs::hasPtx(int major, int minor)
|
||||
{
|
||||
#ifdef HAVE_CUDA
|
||||
#if defined HAVE_CUDA && !defined(CUDA_DISABLER)
|
||||
return ::compareToSet(CUDA_ARCH_PTX, major * 10 + minor, std::equal_to<int>());
|
||||
#else
|
||||
(void)major;
|
||||
@@ -120,7 +120,7 @@ bool cv::gpu::TargetArchs::hasPtx(int major, int minor)
|
||||
|
||||
bool cv::gpu::TargetArchs::hasBin(int major, int minor)
|
||||
{
|
||||
#if defined (HAVE_CUDA)
|
||||
#if defined (HAVE_CUDA) && !defined(CUDA_DISABLER)
|
||||
return ::compareToSet(CUDA_ARCH_BIN, major * 10 + minor, std::equal_to<int>());
|
||||
#else
|
||||
(void)major;
|
||||
@@ -131,7 +131,7 @@ bool cv::gpu::TargetArchs::hasBin(int major, int minor)
|
||||
|
||||
bool cv::gpu::TargetArchs::hasEqualOrLessPtx(int major, int minor)
|
||||
{
|
||||
#ifdef HAVE_CUDA
|
||||
#if defined HAVE_CUDA && !defined(CUDA_DISABLER)
|
||||
return ::compareToSet(CUDA_ARCH_PTX, major * 10 + minor,
|
||||
std::less_equal<int>());
|
||||
#else
|
||||
@@ -149,7 +149,7 @@ bool cv::gpu::TargetArchs::hasEqualOrGreater(int major, int minor)
|
||||
|
||||
bool cv::gpu::TargetArchs::hasEqualOrGreaterPtx(int major, int minor)
|
||||
{
|
||||
#ifdef HAVE_CUDA
|
||||
#if defined HAVE_CUDA && !defined(CUDA_DISABLER)
|
||||
return ::compareToSet(CUDA_ARCH_PTX, major * 10 + minor,
|
||||
std::greater_equal<int>());
|
||||
#else
|
||||
@@ -161,7 +161,7 @@ bool cv::gpu::TargetArchs::hasEqualOrGreaterPtx(int major, int minor)
|
||||
|
||||
bool cv::gpu::TargetArchs::hasEqualOrGreaterBin(int major, int minor)
|
||||
{
|
||||
#ifdef HAVE_CUDA
|
||||
#if defined HAVE_CUDA && !defined(CUDA_DISABLER)
|
||||
return ::compareToSet(CUDA_ARCH_BIN, major * 10 + minor,
|
||||
std::greater_equal<int>());
|
||||
#else
|
||||
@@ -171,7 +171,7 @@ bool cv::gpu::TargetArchs::hasEqualOrGreaterBin(int major, int minor)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef HAVE_CUDA
|
||||
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
|
||||
|
||||
#define throw_nogpu CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support")
|
||||
|
||||
@@ -728,7 +728,7 @@ namespace
|
||||
};
|
||||
}
|
||||
|
||||
#ifndef HAVE_CUDA
|
||||
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@@ -70,7 +70,7 @@ using namespace cv::gpu;
|
||||
#else
|
||||
#define throw_nogl CV_Error(CV_OpenGlNotSupported, "OpenGL context doesn't exist")
|
||||
|
||||
#ifndef HAVE_CUDA
|
||||
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
|
||||
#define throw_nocuda CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support")
|
||||
#else
|
||||
#if defined(__GNUC__)
|
||||
@@ -162,7 +162,7 @@ void icvSetOpenGlFuncTab(const CvOpenGlFuncTab* tab)
|
||||
|
||||
void cv::gpu::setGlDevice(int device)
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
|
||||
(void)device;
|
||||
throw_nocuda;
|
||||
#else
|
||||
@@ -538,7 +538,7 @@ cv::GlBuffer::GlBuffer(InputArray mat_, Usage _usage) : rows_(0), cols_(0), type
|
||||
|
||||
if (kind == _InputArray::GPU_MAT)
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
|
||||
throw_nocuda;
|
||||
#else
|
||||
GpuMat d_mat = mat_.getGpuMat();
|
||||
@@ -609,7 +609,7 @@ void cv::GlBuffer::copyFrom(InputArray mat_)
|
||||
}
|
||||
case _InputArray::GPU_MAT:
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
|
||||
throw_nocuda;
|
||||
#else
|
||||
GpuMat d_mat = mat_.getGpuMat();
|
||||
@@ -670,7 +670,7 @@ GpuMat cv::GlBuffer::mapDevice()
|
||||
throw_nogl;
|
||||
return GpuMat();
|
||||
#else
|
||||
#ifndef HAVE_CUDA
|
||||
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
|
||||
throw_nocuda;
|
||||
return GpuMat();
|
||||
#else
|
||||
@@ -684,7 +684,7 @@ void cv::GlBuffer::unmapDevice()
|
||||
#ifndef HAVE_OPENGL
|
||||
throw_nogl;
|
||||
#else
|
||||
#ifndef HAVE_CUDA
|
||||
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
|
||||
throw_nocuda;
|
||||
#else
|
||||
impl_->unmapDevice();
|
||||
@@ -976,7 +976,7 @@ cv::GlTexture::GlTexture(InputArray mat_, bool bgra) : rows_(0), cols_(0), type_
|
||||
}
|
||||
case _InputArray::GPU_MAT:
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
|
||||
throw_nocuda;
|
||||
#else
|
||||
GpuMat d_mat = mat_.getGpuMat();
|
||||
@@ -1056,7 +1056,7 @@ void cv::GlTexture::copyFrom(InputArray mat_, bool bgra)
|
||||
}
|
||||
case _InputArray::GPU_MAT:
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
|
||||
throw_nocuda;
|
||||
#else
|
||||
GpuMat d_mat = mat_.getGpuMat();
|
||||
|
Reference in New Issue
Block a user