GPUs and Array Operations

Craig Black craigblack2 at cox.net
Mon Jul 9 17:43:27 PDT 2007


Interesting syntax.  I like it, but in order to support GPU's there would 
have to be some way that the programmer specified GPU or CPU computation. 
Perhaps a new keyword or pragma?

I'm fuzzy on the details of how this could actually be done on the GPU.  The 
compiler would have to somehow generate either high-level or low-level 
shading language routines for each statement.  That means each function 
called would also have to be converted to GPU code.

There would obviously be some restrictions as to what kinds of language 
features could be used when the GPU option is enabled.  For example, no 
function pointers, no heap allocations, etc, etc.  I'm sure there would end 
up being a lot.

I suppose special floating point types could automatically be mapped.  For 
example the compiler could automatically convert the static array float[3] 
to the shading language type float3.

-Craig

"Knud Soerensen" <4tuu4k002 at sneakemail.com> wrote in message 
news:f6uiqk$2qad$2 at digitalmars.com...
> Take a look on the vectorization suggestion on the wish list
> http://all-technology.com/eigenpolls/dwishlist/index.php?it=10
> this notation lets you specify vector calculation in such
> a way that the compiler can optimize them and let them run on the GPU
> if that is preferred. 




More information about the Digitalmars-d mailing list