in reply to Re^3: Challenge: CPU-optimized byte-wise or-equals (for a meter of beer)
in thread Challenge: CPU-optimized byte-wise or-equals (for a meter of beer)
If you're working with 3-byte groups, that suspiciously sounds to me like you're treating RGB-data, and even if you're not, there is a crazy yet highly efficient (I believe) way of manipulating such data if you have the hardware (and software) to do it:
Using OpenGL and a chroma-key filter, you can "draw" the two strings over each other in parallel and then retrieve the resulting "image" from the massively parallel hardware again. It's not always certain that the parallelism you gain by offloading the work to the GPU outweighs the cost of transferring the data over the bus and the result back again, especially when benchmarked against the C versions you already have. See http://www.gpgpu.org/ for more information on the concept.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Challenge: CPU-optimized byte-wise or-equals (for a meter of beer)
by dragonchild (Archbishop) on Sep 13, 2007 at 12:49 UTC | |
by Corion (Patriarch) on Sep 13, 2007 at 12:56 UTC | |
by dragonchild (Archbishop) on Sep 13, 2007 at 15:18 UTC | |
|
Re^5: Challenge: CPU-optimized byte-wise or-equals (for a meter of beer)
by szbalint (Friar) on Sep 13, 2007 at 08:03 UTC |