From 528ddb5647d5d4beca91527cd0f963feefbe3bd3 Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Wed, 15 Aug 2012 17:16:02 +0400 Subject: [PATCH] fixed block size for old CC --- modules/gpu/src/cuda/hough.cu | 4 ++-- modules/gpu/src/hough.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/gpu/src/cuda/hough.cu b/modules/gpu/src/cuda/hough.cu index 388223e..82bd04c 100644 --- a/modules/gpu/src/cuda/hough.cu +++ b/modules/gpu/src/cuda/hough.cu @@ -203,9 +203,9 @@ namespace cv { namespace gpu { namespace device accum(n + 1, i) = smem[i]; } - void linesAccum_gpu(const unsigned int* list, int count, DevMem2Di accum, float rho, float theta, size_t sharedMemPerBlock) + void linesAccum_gpu(const unsigned int* list, int count, DevMem2Di accum, float rho, float theta, size_t sharedMemPerBlock, bool has20) { - const dim3 block(1024); + const dim3 block(has20 ? 1024 : 512); const dim3 grid(accum.rows - 2); cudaSafeCall( cudaFuncSetCacheConfig(linesAccumShared, cudaFuncCachePreferShared) ); diff --git a/modules/gpu/src/hough.cpp b/modules/gpu/src/hough.cpp index 71d8ac0..ba61ad7 100644 --- a/modules/gpu/src/hough.cpp +++ b/modules/gpu/src/hough.cpp @@ -57,7 +57,7 @@ namespace cv { namespace gpu { namespace device namespace hough { int buildPointList_gpu(DevMem2Db src, unsigned int* list); - void linesAccum_gpu(const unsigned int* list, int count, DevMem2Di accum, float rho, float theta, size_t sharedMemPerBlock); + void linesAccum_gpu(const unsigned int* list, int count, DevMem2Di accum, float rho, float theta, size_t sharedMemPerBlock, bool has20); int linesGetResult_gpu(DevMem2Di accum, float2* out, int* votes, int maxSize, float rho, float theta, float threshold, bool doSort); } }}} @@ -85,7 +85,7 @@ void cv::gpu::HoughLinesTransform(const GpuMat& src, GpuMat& accum, GpuMat& buf, cv::gpu::DeviceInfo devInfo; if (count > 0) - linesAccum_gpu(buf.ptr(), count, accum, rho, theta, devInfo.sharedMemPerBlock()); + linesAccum_gpu(buf.ptr(), count, accum, rho, theta, devInfo.sharedMemPerBlock(), devInfo.supports(cv::gpu::FEATURE_SET_COMPUTE_20)); } void cv::gpu::HoughLinesGet(const GpuMat& accum, GpuMat& lines, float rho, float theta, int threshold, bool doSort, int maxLines) -- 2.7.4