From 50166d2734663d305a3931ee95c880edfb073606 Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Wed, 19 Jun 2013 15:29:20 +0400 Subject: [PATCH] fixed compilation with CUDA 4.2 --- modules/core/src/gpu_info.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/core/src/gpu_info.cpp b/modules/core/src/gpu_info.cpp index 7520380ca..e3400a538 100644 --- a/modules/core/src/gpu_info.cpp +++ b/modules/core/src/gpu_info.cpp @@ -569,7 +569,12 @@ int cv::gpu::DeviceInfo::maxTexture1DMipmap() const throw_no_cuda(); return 0; #else - return deviceProps().get(device_id_)->maxTexture1DMipmap; + #if CUDA_VERSION >= 5000 + return deviceProps().get(device_id_)->maxTexture1DMipmap; + #else + CV_Error(Error::StsNotImplemented, "This function requires CUDA 5.0"); + return 0; + #endif #endif } @@ -599,7 +604,12 @@ Vec2i cv::gpu::DeviceInfo::maxTexture2DMipmap() const throw_no_cuda(); return Vec2i(); #else - return Vec2i(deviceProps().get(device_id_)->maxTexture2DMipmap); + #if CUDA_VERSION >= 5000 + return Vec2i(deviceProps().get(device_id_)->maxTexture2DMipmap); + #else + CV_Error(Error::StsNotImplemented, "This function requires CUDA 5.0"); + return Vec2i(); + #endif #endif }