1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

GPU module: minor interface changes

This commit is contained in:
Anatoly Baksheev
2010-09-17 17:18:41 +00:00
parent 1387bfcde0
commit 4ffb519cdd
6 changed files with 20 additions and 18 deletions
@@ -61,6 +61,8 @@ namespace cv
T* ptr;
size_t step;
DevMem2D_() : cols(0), rows(0), ptr(0), step(0) {}
DevMem2D_(int rows_, int cols_, T *ptr_, size_t step_)
: cols(cols_), rows(rows_), ptr(ptr_), step(step_) {}
+2 -2
View File
@@ -62,10 +62,10 @@ namespace cv
CV_EXPORTS void setDevice(int device);
CV_EXPORTS int getDevice();
CV_EXPORTS void getComputeCapability(int device, int* major, int* minor);
CV_EXPORTS void getComputeCapability(int device, int& major, int& minor);
CV_EXPORTS int getNumberOfSMs(int device);
CV_EXPORTS void getGpuMemInfo(size_t *free, size_t* total);
CV_EXPORTS void getGpuMemInfo(size_t& free, size_t& total);
//////////////////////////////// GpuMat ////////////////////////////////
class Stream;
+7 -7
View File
@@ -52,9 +52,9 @@ CV_EXPORTS int cv::gpu::getCudaEnabledDeviceCount() { 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 void cv::gpu::getComputeCapability(int /*device*/, int& /*major*/, int& /*minor*/) { throw_nogpu(); }
CV_EXPORTS int cv::gpu::getNumberOfSMs(int /*device*/) { throw_nogpu(); return 0; }
CV_EXPORTS void cv::gpu::getGpuMemInfo(size_t* /*free*/, size_t* /*total*/) { throw_nogpu(); }
CV_EXPORTS void cv::gpu::getGpuMemInfo(size_t& /*free*/, size_t& /*total*/) { throw_nogpu(); }
#else /* !defined (HAVE_CUDA) */
@@ -84,13 +84,13 @@ CV_EXPORTS int cv::gpu::getDevice()
return device;
}
CV_EXPORTS void cv::gpu::getComputeCapability(int device, int* major, int* minor)
CV_EXPORTS void cv::gpu::getComputeCapability(int device, int& major, int& minor)
{
cudaDeviceProp prop;
cudaSafeCall( cudaGetDeviceProperties( &prop, device) );
*major = prop.major;
*minor = prop.minor;
major = prop.major;
minor = prop.minor;
}
CV_EXPORTS int cv::gpu::getNumberOfSMs(int device)
@@ -101,9 +101,9 @@ CV_EXPORTS int cv::gpu::getNumberOfSMs(int device)
}
CV_EXPORTS void cv::gpu::getGpuMemInfo(size_t *free, size_t* total)
CV_EXPORTS void cv::gpu::getGpuMemInfo(size_t& free, size_t& total)
{
cudaSafeCall( cudaMemGetInfo( free, total ) );
cudaSafeCall( cudaMemGetInfo( &free, &total ) );
}
#endif
+1 -1
View File
@@ -89,7 +89,7 @@ bool cv::gpu::StereoBM_GPU::checkIfGpuCallReasonable()
int device = getDevice();
int minor, major;
getComputeCapability(device, &major, &minor);
getComputeCapability(device, major, minor);
int numSM = getNumberOfSMs(device);
if (major > 1 || numSM > 16)