[Server-sky] CUDA versus optimization
Keith Lofstrom
keithl at kl-ic.com
Tue Apr 7 02:27:09 UTC 2009
When writing code, we probably should "keep it simple". For
problems that may migrate to heavy processing, such as observing
evolving orbits and hunting for collisions, we should avoid
complex code constructs that will be difficult to port to CUDA.
That said, the only complexity that I know to avoid is looping
on pointers for processing data vectors - CUDA doesn't unroll
pointers, it expects to do operations on whole vectors or arrays,
and figure out the thread assignment itself.
So in general, at this stage, avoid premature optimization, and
instead code solutions in the easiest-to-understand form. Even
if that costs some performance on uniprocessors. That will help
us (1) parallelize the code, (2) find errors in thinking, and
(3) explain what we are doing to others.
Break things into modules, objects, structures, as needed, but
please document them if you can, or leave an obvious place for
someone else to add documentation if you cannot. At the very
least, use comments to point to the URL for the documentation
of the libraries you are using.
Also, consider that a big reason why we are doing this right now
is to show off and create jobs. That won't happen if the only
people that can understand what we are doing are non-managerial
geeks. The audience we want to impress will be important managers
and entrepreneurs with large budgets, and making them feel stupid
is a losing proposition.
Keith
--
Keith Lofstrom keithl at keithl.com Voice (503)-520-1993
KLIC --- Keith Lofstrom Integrated Circuits --- "Your Ideas in Silicon"
Design Contracting in Bipolar and CMOS - Analog, Digital, and Scan ICs
More information about the Server-sky
mailing list