[opencv] 23/251: ocl_calcHist1: Use proper local size for merge_histogram kernel
Nobuhiro Iwamatsu
iwamatsu at moszumanska.debian.org
Sun Aug 27 23:27:19 UTC 2017
This is an automated email from the git hooks/post-receive script.
iwamatsu pushed a commit to annotated tag 3.3.0
in repository opencv.
commit 635342ab732c3e1036d67969e1691022db86e2e7
Author: wzw <zhiwen.wu at intel.com>
Date: Wed Jul 5 21:24:09 2017 +0800
ocl_calcHist1: Use proper local size for merge_histogram kernel
merge_histogram kernel only need "BINS" theads to accumulate the
histgrams, it is not efficient to directly use maxGroupSize as
local size if maxGroupSize is far greater then BINS.
---
modules/imgproc/src/histogram.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/modules/imgproc/src/histogram.cpp b/modules/imgproc/src/histogram.cpp
index cdd1086..33f15c5 100644
--- a/modules/imgproc/src/histogram.cpp
+++ b/modules/imgproc/src/histogram.cpp
@@ -1723,6 +1723,7 @@ static bool ocl_calcHist1(InputArray _src, OutputArray _hist, int ddepth = CV_32
if (!k1.run(1, &globalsize, &wgs, false))
return false;
+ wgs = std::min<size_t>(ocl::Device::getDefault().maxWorkGroupSize(), BINS);
char cvt[40];
ocl::Kernel k2("merge_histogram", ocl::imgproc::histogram_oclsrc,
format("-D BINS=%d -D HISTS_COUNT=%d -D WGS=%d -D convertToHT=%s -D HT=%s",
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/opencv.git
More information about the debian-science-commits
mailing list