mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
build: unreachable code after CV_Error()
This commit is contained in:
@@ -79,7 +79,6 @@ int cv::cuda::getDevice()
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
int device;
|
||||
cudaSafeCall( cudaGetDevice(&device) );
|
||||
@@ -101,7 +100,6 @@ bool cv::cuda::deviceSupports(FeatureSet feature_set)
|
||||
#ifndef HAVE_CUDA
|
||||
(void) feature_set;
|
||||
throw_no_cuda();
|
||||
return false;
|
||||
#else
|
||||
static int versions[] =
|
||||
{
|
||||
@@ -231,7 +229,6 @@ bool cv::cuda::TargetArchs::builtWith(cv::cuda::FeatureSet feature_set)
|
||||
#ifndef HAVE_CUDA
|
||||
(void) feature_set;
|
||||
throw_no_cuda();
|
||||
return false;
|
||||
#else
|
||||
return cudaArch.builtWith(feature_set);
|
||||
#endif
|
||||
@@ -243,7 +240,6 @@ bool cv::cuda::TargetArchs::hasPtx(int major, int minor)
|
||||
(void) major;
|
||||
(void) minor;
|
||||
throw_no_cuda();
|
||||
return false;
|
||||
#else
|
||||
return cudaArch.hasPtx(major, minor);
|
||||
#endif
|
||||
@@ -255,7 +251,6 @@ bool cv::cuda::TargetArchs::hasBin(int major, int minor)
|
||||
(void) major;
|
||||
(void) minor;
|
||||
throw_no_cuda();
|
||||
return false;
|
||||
#else
|
||||
return cudaArch.hasBin(major, minor);
|
||||
#endif
|
||||
@@ -267,7 +262,6 @@ bool cv::cuda::TargetArchs::hasEqualOrLessPtx(int major, int minor)
|
||||
(void) major;
|
||||
(void) minor;
|
||||
throw_no_cuda();
|
||||
return false;
|
||||
#else
|
||||
return cudaArch.hasEqualOrLessPtx(major, minor);
|
||||
#endif
|
||||
@@ -279,7 +273,6 @@ bool cv::cuda::TargetArchs::hasEqualOrGreaterPtx(int major, int minor)
|
||||
(void) major;
|
||||
(void) minor;
|
||||
throw_no_cuda();
|
||||
return false;
|
||||
#else
|
||||
return cudaArch.hasEqualOrGreaterPtx(major, minor);
|
||||
#endif
|
||||
@@ -291,7 +284,6 @@ bool cv::cuda::TargetArchs::hasEqualOrGreaterBin(int major, int minor)
|
||||
(void) major;
|
||||
(void) minor;
|
||||
throw_no_cuda();
|
||||
return false;
|
||||
#else
|
||||
return cudaArch.hasEqualOrGreaterBin(major, minor);
|
||||
#endif
|
||||
@@ -350,7 +342,6 @@ const char* cv::cuda::DeviceInfo::name() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return "";
|
||||
#else
|
||||
return deviceProps().get(device_id_)->name;
|
||||
#endif
|
||||
@@ -360,7 +351,6 @@ size_t cv::cuda::DeviceInfo::totalGlobalMem() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->totalGlobalMem;
|
||||
#endif
|
||||
@@ -370,7 +360,6 @@ size_t cv::cuda::DeviceInfo::sharedMemPerBlock() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->sharedMemPerBlock;
|
||||
#endif
|
||||
@@ -380,7 +369,6 @@ int cv::cuda::DeviceInfo::regsPerBlock() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->regsPerBlock;
|
||||
#endif
|
||||
@@ -390,7 +378,6 @@ int cv::cuda::DeviceInfo::warpSize() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->warpSize;
|
||||
#endif
|
||||
@@ -400,7 +387,6 @@ size_t cv::cuda::DeviceInfo::memPitch() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->memPitch;
|
||||
#endif
|
||||
@@ -410,7 +396,6 @@ int cv::cuda::DeviceInfo::maxThreadsPerBlock() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->maxThreadsPerBlock;
|
||||
#endif
|
||||
@@ -420,7 +405,6 @@ Vec3i cv::cuda::DeviceInfo::maxThreadsDim() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return Vec3i();
|
||||
#else
|
||||
return Vec3i(deviceProps().get(device_id_)->maxThreadsDim);
|
||||
#endif
|
||||
@@ -430,7 +414,6 @@ Vec3i cv::cuda::DeviceInfo::maxGridSize() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return Vec3i();
|
||||
#else
|
||||
return Vec3i(deviceProps().get(device_id_)->maxGridSize);
|
||||
#endif
|
||||
@@ -440,7 +423,6 @@ int cv::cuda::DeviceInfo::clockRate() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->clockRate;
|
||||
#endif
|
||||
@@ -450,7 +432,6 @@ size_t cv::cuda::DeviceInfo::totalConstMem() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->totalConstMem;
|
||||
#endif
|
||||
@@ -460,7 +441,6 @@ int cv::cuda::DeviceInfo::majorVersion() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->major;
|
||||
#endif
|
||||
@@ -470,7 +450,6 @@ int cv::cuda::DeviceInfo::minorVersion() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->minor;
|
||||
#endif
|
||||
@@ -480,7 +459,6 @@ size_t cv::cuda::DeviceInfo::textureAlignment() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->textureAlignment;
|
||||
#endif
|
||||
@@ -490,7 +468,6 @@ size_t cv::cuda::DeviceInfo::texturePitchAlignment() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->texturePitchAlignment;
|
||||
#endif
|
||||
@@ -500,7 +477,6 @@ int cv::cuda::DeviceInfo::multiProcessorCount() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->multiProcessorCount;
|
||||
#endif
|
||||
@@ -510,7 +486,6 @@ bool cv::cuda::DeviceInfo::kernelExecTimeoutEnabled() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return false;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->kernelExecTimeoutEnabled != 0;
|
||||
#endif
|
||||
@@ -520,7 +495,6 @@ bool cv::cuda::DeviceInfo::integrated() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return false;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->integrated != 0;
|
||||
#endif
|
||||
@@ -530,7 +504,6 @@ bool cv::cuda::DeviceInfo::canMapHostMemory() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return false;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->canMapHostMemory != 0;
|
||||
#endif
|
||||
@@ -540,7 +513,6 @@ DeviceInfo::ComputeMode cv::cuda::DeviceInfo::computeMode() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return ComputeModeDefault;
|
||||
#else
|
||||
static const ComputeMode tbl[] =
|
||||
{
|
||||
@@ -558,7 +530,6 @@ int cv::cuda::DeviceInfo::maxTexture1D() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->maxTexture1D;
|
||||
#endif
|
||||
@@ -568,7 +539,6 @@ int cv::cuda::DeviceInfo::maxTexture1DMipmap() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
#if CUDA_VERSION >= 5000
|
||||
return deviceProps().get(device_id_)->maxTexture1DMipmap;
|
||||
@@ -583,7 +553,6 @@ int cv::cuda::DeviceInfo::maxTexture1DLinear() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->maxTexture1DLinear;
|
||||
#endif
|
||||
@@ -593,7 +562,6 @@ Vec2i cv::cuda::DeviceInfo::maxTexture2D() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return Vec2i();
|
||||
#else
|
||||
return Vec2i(deviceProps().get(device_id_)->maxTexture2D);
|
||||
#endif
|
||||
@@ -603,7 +571,6 @@ Vec2i cv::cuda::DeviceInfo::maxTexture2DMipmap() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return Vec2i();
|
||||
#else
|
||||
#if CUDA_VERSION >= 5000
|
||||
return Vec2i(deviceProps().get(device_id_)->maxTexture2DMipmap);
|
||||
@@ -618,7 +585,6 @@ Vec3i cv::cuda::DeviceInfo::maxTexture2DLinear() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return Vec3i();
|
||||
#else
|
||||
return Vec3i(deviceProps().get(device_id_)->maxTexture2DLinear);
|
||||
#endif
|
||||
@@ -628,7 +594,6 @@ Vec2i cv::cuda::DeviceInfo::maxTexture2DGather() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return Vec2i();
|
||||
#else
|
||||
return Vec2i(deviceProps().get(device_id_)->maxTexture2DGather);
|
||||
#endif
|
||||
@@ -638,7 +603,6 @@ Vec3i cv::cuda::DeviceInfo::maxTexture3D() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return Vec3i();
|
||||
#else
|
||||
return Vec3i(deviceProps().get(device_id_)->maxTexture3D);
|
||||
#endif
|
||||
@@ -648,7 +612,6 @@ int cv::cuda::DeviceInfo::maxTextureCubemap() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->maxTextureCubemap;
|
||||
#endif
|
||||
@@ -658,7 +621,6 @@ Vec2i cv::cuda::DeviceInfo::maxTexture1DLayered() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return Vec2i();
|
||||
#else
|
||||
return Vec2i(deviceProps().get(device_id_)->maxTexture1DLayered);
|
||||
#endif
|
||||
@@ -668,7 +630,6 @@ Vec3i cv::cuda::DeviceInfo::maxTexture2DLayered() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return Vec3i();
|
||||
#else
|
||||
return Vec3i(deviceProps().get(device_id_)->maxTexture2DLayered);
|
||||
#endif
|
||||
@@ -678,7 +639,6 @@ Vec2i cv::cuda::DeviceInfo::maxTextureCubemapLayered() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return Vec2i();
|
||||
#else
|
||||
return Vec2i(deviceProps().get(device_id_)->maxTextureCubemapLayered);
|
||||
#endif
|
||||
@@ -688,7 +648,6 @@ int cv::cuda::DeviceInfo::maxSurface1D() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->maxSurface1D;
|
||||
#endif
|
||||
@@ -698,7 +657,6 @@ Vec2i cv::cuda::DeviceInfo::maxSurface2D() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return Vec2i();
|
||||
#else
|
||||
return Vec2i(deviceProps().get(device_id_)->maxSurface2D);
|
||||
#endif
|
||||
@@ -708,7 +666,6 @@ Vec3i cv::cuda::DeviceInfo::maxSurface3D() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return Vec3i();
|
||||
#else
|
||||
return Vec3i(deviceProps().get(device_id_)->maxSurface3D);
|
||||
#endif
|
||||
@@ -718,7 +675,6 @@ Vec2i cv::cuda::DeviceInfo::maxSurface1DLayered() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return Vec2i();
|
||||
#else
|
||||
return Vec2i(deviceProps().get(device_id_)->maxSurface1DLayered);
|
||||
#endif
|
||||
@@ -728,7 +684,6 @@ Vec3i cv::cuda::DeviceInfo::maxSurface2DLayered() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return Vec3i();
|
||||
#else
|
||||
return Vec3i(deviceProps().get(device_id_)->maxSurface2DLayered);
|
||||
#endif
|
||||
@@ -738,7 +693,6 @@ int cv::cuda::DeviceInfo::maxSurfaceCubemap() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->maxSurfaceCubemap;
|
||||
#endif
|
||||
@@ -748,7 +702,6 @@ Vec2i cv::cuda::DeviceInfo::maxSurfaceCubemapLayered() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return Vec2i();
|
||||
#else
|
||||
return Vec2i(deviceProps().get(device_id_)->maxSurfaceCubemapLayered);
|
||||
#endif
|
||||
@@ -758,7 +711,6 @@ size_t cv::cuda::DeviceInfo::surfaceAlignment() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->surfaceAlignment;
|
||||
#endif
|
||||
@@ -768,7 +720,6 @@ bool cv::cuda::DeviceInfo::concurrentKernels() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return false;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->concurrentKernels != 0;
|
||||
#endif
|
||||
@@ -778,7 +729,6 @@ bool cv::cuda::DeviceInfo::ECCEnabled() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return false;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->ECCEnabled != 0;
|
||||
#endif
|
||||
@@ -788,7 +738,6 @@ int cv::cuda::DeviceInfo::pciBusID() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->pciBusID;
|
||||
#endif
|
||||
@@ -798,7 +747,6 @@ int cv::cuda::DeviceInfo::pciDeviceID() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->pciDeviceID;
|
||||
#endif
|
||||
@@ -808,7 +756,6 @@ int cv::cuda::DeviceInfo::pciDomainID() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->pciDomainID;
|
||||
#endif
|
||||
@@ -818,7 +765,6 @@ bool cv::cuda::DeviceInfo::tccDriver() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return false;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->tccDriver != 0;
|
||||
#endif
|
||||
@@ -828,7 +774,6 @@ int cv::cuda::DeviceInfo::asyncEngineCount() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->asyncEngineCount;
|
||||
#endif
|
||||
@@ -838,7 +783,6 @@ bool cv::cuda::DeviceInfo::unifiedAddressing() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return false;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->unifiedAddressing != 0;
|
||||
#endif
|
||||
@@ -848,7 +792,6 @@ int cv::cuda::DeviceInfo::memoryClockRate() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->memoryClockRate;
|
||||
#endif
|
||||
@@ -858,7 +801,6 @@ int cv::cuda::DeviceInfo::memoryBusWidth() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->memoryBusWidth;
|
||||
#endif
|
||||
@@ -868,7 +810,6 @@ int cv::cuda::DeviceInfo::l2CacheSize() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->l2CacheSize;
|
||||
#endif
|
||||
@@ -878,7 +819,6 @@ int cv::cuda::DeviceInfo::maxThreadsPerMultiProcessor() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return 0;
|
||||
#else
|
||||
return deviceProps().get(device_id_)->maxThreadsPerMultiProcessor;
|
||||
#endif
|
||||
@@ -906,7 +846,6 @@ bool cv::cuda::DeviceInfo::isCompatible() const
|
||||
{
|
||||
#ifndef HAVE_CUDA
|
||||
throw_no_cuda();
|
||||
return false;
|
||||
#else
|
||||
// Check PTX compatibility
|
||||
if (TargetArchs::hasEqualOrLessPtx(majorVersion(), minorVersion()))
|
||||
|
||||
Reference in New Issue
Block a user