added assertion on Compute Capability >= 1.1 to BruteForceMatcher_GPU_base::radiusMatch

This commit is contained in:
Vladislav Vinogradov
2010-12-06 14:51:47 +00:00
parent 50167f6c26
commit fadd19b976
3 changed files with 16 additions and 8 deletions

View File

@@ -492,6 +492,10 @@ void cv::gpu::BruteForceMatcher_GPU_base::radiusMatch(const GpuMat& queryDescs,
radiusMatchL2_gpu<short>, radiusMatchL2_gpu<int>, radiusMatchL2_gpu<float>, 0, 0
}
};
int major, minor;
getComputeCapability(getDevice(), major, minor);
CV_Assert(100 * major + 10 * minor >= 110); // works onle on device with CC >= 1.1
const int nQuery = queryDescs.rows;
const int nTrain = trainDescs.rows;

View File

@@ -1104,6 +1104,8 @@ namespace cv { namespace gpu { namespace bfmatcher
__global__ void radiusMatch(PtrStep_<T> queryDescs_, DevMem2D_<T> trainDescs_,
float maxDistance, Mask mask, DevMem2Di trainIdx_, unsigned int* nMatches, PtrStepf distance)
{
#if defined (__CUDA_ARCH__) && __CUDA_ARCH__ >= 110
__shared__ float sdiff[BLOCK_DIM_X * BLOCK_DIM_Y];
float* sdiff_row = sdiff + BLOCK_DIM_X * threadIdx.y;
@@ -1135,6 +1137,8 @@ namespace cv { namespace gpu { namespace bfmatcher
}
}
}
#endif
}
///////////////////////////////////////////////////////////////////////////////