minor changes in gpu code (initialization interface)
This commit is contained in:
@@ -64,27 +64,15 @@ CV_EXPORTS void cv::gpu::setDevice(int device)
|
||||
cudaSafeCall( cudaSetDevice( device ) );
|
||||
}
|
||||
|
||||
CV_EXPORTS int cv::gpu::getComputeCapability(int device)
|
||||
{
|
||||
cudaDeviceProp prop;
|
||||
CV_EXPORTS void cv::gpu::getComputeCapability(int device, int* major, int* minor)
|
||||
{
|
||||
cudaDeviceProp prop;
|
||||
cudaSafeCall( cudaGetDeviceProperties( &prop, device) );
|
||||
|
||||
if (prop.major == 2)
|
||||
return CV_GPU_CC_20;
|
||||
|
||||
if (prop.major == 1)
|
||||
switch (prop.minor)
|
||||
{
|
||||
case 0: return CV_GPU_CC_10;
|
||||
case 1: return CV_GPU_CC_11;
|
||||
case 2: return CV_GPU_CC_12;
|
||||
case 3: return CV_GPU_CC_13;
|
||||
}
|
||||
|
||||
return -1;
|
||||
*major = prop.major;
|
||||
*minor = prop.minor;
|
||||
}
|
||||
|
||||
|
||||
CV_EXPORTS int cv::gpu::getNumberOfSMs(int device)
|
||||
{
|
||||
cudaDeviceProp prop;
|
||||
|
@@ -55,7 +55,11 @@
|
||||
|
||||
#include "cuda_shared.hpp"
|
||||
|
||||
#include "cuda_runtime.h"
|
||||
#if _MSC_VER >= 1200
|
||||
#pragma warning (disable : 4100 4211 4201 4408)
|
||||
#endif
|
||||
|
||||
#include "cuda_runtime_api.h"
|
||||
|
||||
|
||||
#define cudaSafeCall(err) __cudaSafeCall(err, __FILE__, __LINE__)
|
||||
|
@@ -49,7 +49,8 @@ using namespace cv::gpu;
|
||||
StereoBM_GPU::StereoBM_GPU() : preset(BASIC_PRESET), ndisp(64) {}
|
||||
StereoBM_GPU::StereoBM_GPU(int preset_, int ndisparities_) : preset(preset_), ndisp(ndisparities_)
|
||||
{
|
||||
CV_Assert(ndisp <= std::numeric_limits<unsigned char>::max());
|
||||
const int max_supported_ndisp = 1 << (sizeof(unsigned char) * 8);
|
||||
CV_Assert(ndisp <= max_supported_ndisp);
|
||||
}
|
||||
|
||||
void StereoBM_GPU::operator() ( const GpuMat& left, const GpuMat& right, GpuMat& disparity) const
|
||||
|
Reference in New Issue
Block a user