but GPU works in parallel, so it should be faster
Only if the required algorithm can be coded to make use of the inherent concurrency of the GPU instruction set.
And (without expending great effort into looking at what instructions are available) I see three problems:
- Instructions applicable to the task.
GPU are great at applying a single operation, or a restricted set of pairs of operations (multiply & add) to multiple values concurrently.
But unless a way can be devised to perform a boolean test & increment instruction using the usually mathematical instruction set; it's not gonna fly.
- Integers versus float/double operands.
Most GPU instructions deal with floating point values. The OPs problem revolves around integer values and boolean operations. If the data has to be converted first, if might kill any gains.
- Memory transfers.
Shipping large volumes of data from cpu to gpu memory and back can be a major sap on performance and throughput.
I'm not saying it isn't possible. I am saying that it might take considerable R&D to make it work.
Better, if you know how to do it, I'd love to learn :)
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.