compilation with no cuda re factored
This commit is contained in:
@@ -45,15 +45,18 @@
|
||||
using namespace cv;
|
||||
using namespace cv::gpu;
|
||||
|
||||
#ifndef HAVE_CUDA
|
||||
|
||||
#if !defined (HAVE_CUDA)
|
||||
|
||||
CV_EXPORTS int cv::gpu::getCudaEnabledDeviceCount() { return 0; }
|
||||
CV_EXPORTS string cv::gpu::getDeviceName(int /*device*/) { cudaSafeCall(0); return 0; }
|
||||
CV_EXPORTS void cv::gpu::setDevice(int /*device*/) { cudaSafeCall(0); }
|
||||
CV_EXPORTS void cv::gpu::getComputeCapability(int /*device*/, int* /*major*/, int* /*minor*/) { cudaSafeCall(0); }
|
||||
CV_EXPORTS int cv::gpu::getNumberOfSMs(int /*device*/) { cudaSafeCall(0); return 0; }
|
||||
CV_EXPORTS string cv::gpu::getDeviceName(int /*device*/) { throw_nogpu(); return 0; }
|
||||
CV_EXPORTS void cv::gpu::setDevice(int /*device*/) { throw_nogpu(); }
|
||||
CV_EXPORTS int cv::gpu::getDevice() { throw_nogpu(); return 0; }
|
||||
CV_EXPORTS void cv::gpu::getComputeCapability(int /*device*/, int* /*major*/, int* /*minor*/) { throw_nogpu(); }
|
||||
CV_EXPORTS int cv::gpu::getNumberOfSMs(int /*device*/) { throw_nogpu(); return 0; }
|
||||
|
||||
#else
|
||||
|
||||
#else /* !defined (HAVE_CUDA) */
|
||||
|
||||
CV_EXPORTS int cv::gpu::getCudaEnabledDeviceCount()
|
||||
{
|
||||
@@ -73,6 +76,12 @@ CV_EXPORTS void cv::gpu::setDevice(int device)
|
||||
{
|
||||
cudaSafeCall( cudaSetDevice( device ) );
|
||||
}
|
||||
CV_EXPORTS int cv::gpu::getDevice()
|
||||
{
|
||||
int device;
|
||||
cudaSafeCall( cudaGetDevice( &device ) );
|
||||
return device;
|
||||
}
|
||||
|
||||
CV_EXPORTS void cv::gpu::getComputeCapability(int device, int* major, int* minor)
|
||||
{
|
||||
@@ -90,4 +99,5 @@ CV_EXPORTS int cv::gpu::getNumberOfSMs(int device)
|
||||
return prop.multiProcessorCount;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user