From a hardware design perspective, how does one optimize histogram operation (array index accumulation)?
-
The histogram operation is defined as: Input array = N integers (ranged 0 ... 2**K - 1) Initialize histogram array = (2 ** K) integers, all initialized to zero. For each integer V in input array, increment histogram[V] by one Current architectures (CPU and GPU) can be used as starting point for the discussion, but the intention is to bring the discussion further than that.
-
Answer:
This is counting sort. See the wiki entry http://en.wikipedia.org/wiki/Counting_sort. You could probably parallelize it by having multiple threads and using one of the concurrent containers from Intel Thread Building Blocks.
Nathan Doromal at Quora Visit the source
Related Q & A:
- How do I add to an array from a static method?Best solution by stackoverflow.com
- How can I get a web design job in Toronto?Best solution by Yahoo! Answers
- How to become a web design freelancer?Best solution by howdesign.com
- How can I start a graphic design portfolio?Best solution by Yahoo! Answers
- How do you fix a paper jam in a hp psc 1610 all in one?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.