www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - More on GPU's: RapidMind

reply "Craig Black" <craigblack2 cox.net> writes:
Has anyone looked at The RapidMind Development Platform?  They have created 
a C++ library that allows programmers to write C++ code that runs on a GPU. 
It's also being extended to take advantage of multi-cores as well.  I've 
been browsing the docs.  It seems about as clean as it gets for a C++ 
library that provides such an exotic capability.  They seem to keep 
everything very high level, and they have different backends.  Currently 
they support IBM's Cell processor and GLSL.  To me, this is an ideal kind of 
design for something like this.  Kudos to them.

As nice as this library seems, I'm sure a D implementation could be much 
better.  Anyway, I really think that this is a very, very important arena to 
pursue for D.

-Craig 
Jul 12 2007
parent reply Bill Baxter <dnewsgroup billbaxter.com> writes:
Craig Black wrote:
 Has anyone looked at The RapidMind Development Platform?  They have 
 created a C++ library that allows programmers to write C++ code that 
 runs on a GPU. It's also being extended to take advantage of multi-cores 
 as well.  I've been browsing the docs.  It seems about as clean as it 
 gets for a C++ library that provides such an exotic capability.  They 
 seem to keep everything very high level, and they have different 
 backends.  Currently they support IBM's Cell processor and GLSL.  To me, 
 this is an ideal kind of design for something like this.  Kudos to them.
 
 As nice as this library seems, I'm sure a D implementation could be much 
 better.  Anyway, I really think that this is a very, very important 
 arena to pursue for D.
 

Like I said in another thread, RapidMind is an extension/evolution of the open software research project called Sh. That would be a good place to look for more implementation details if the RapidMind source code is not easy to obtain. Sh is really meant for writing nifty looking visual shaders, but the basic idea is the same -- take an algorithmic description in C++, metaprogram it to death, and out pops on-the-fly generated GPU shader programs on the other end. With RapidMind they've apparently generalized it to work for other back ends, but I would bet the core ideas used in both are the same. And in any event, even if RapidMind in D is too big a project, something like Sh in D would still be a nice demo of D's power. If it doesn't come to a grinding halt because of symbol length limitations in OPTLINK. :-) --bb
Jul 13 2007
parent reply "Craig Black" <cblack ara.com> writes:
 Like I said in another thread, RapidMind is an extension/evolution of the 
 open software research project called Sh.  That would be a good place to 
 look for more implementation details if the RapidMind source code is not 
 easy to obtain.  Sh is really meant for writing nifty looking visual 
 shaders, but the basic idea is the same -- take an algorithmic description 
 in C++, metaprogram it to death, and out pops on-the-fly generated GPU 
 shader programs on the other end.

 With RapidMind they've apparently generalized it to work for other back 
 ends, but I would bet the core ideas used in both are the same.

 And in any event, even if RapidMind in D is too big a project, something 
 like Sh in D would still be a nice demo of D's power.  If it doesn't come 
 to a grinding halt because of symbol length limitations in OPTLINK. :-)

 --bb

I'm not so sure that they even use C++ metaprogramming features. I'm not exactly sure but I suspect that they use macros to turn the shader code into a text string, which they parse and compile to a real shading language. That way they can define the language however they want. I think the trick is that they make their syntax look like C++ syntax so that it seems to fit together properly. -Craig
Jul 13 2007
parent Bill Baxter <dnewsgroup billbaxter.com> writes:
Craig Black wrote:
 Like I said in another thread, RapidMind is an extension/evolution of the 
 open software research project called Sh.  That would be a good place to 
 look for more implementation details if the RapidMind source code is not 
 easy to obtain.  Sh is really meant for writing nifty looking visual 
 shaders, but the basic idea is the same -- take an algorithmic description 
 in C++, metaprogram it to death, and out pops on-the-fly generated GPU 
 shader programs on the other end.

 With RapidMind they've apparently generalized it to work for other back 
 ends, but I would bet the core ideas used in both are the same.

 And in any event, even if RapidMind in D is too big a project, something 
 like Sh in D would still be a nice demo of D's power.  If it doesn't come 
 to a grinding halt because of symbol length limitations in OPTLINK. :-)

 --bb

I'm not so sure that they even use C++ metaprogramming features. I'm not exactly sure but I suspect that they use macros to turn the shader code into a text string, which they parse and compile to a real shading language. That way they can define the language however they want. I think the trick is that they make their syntax look like C++ syntax so that it seems to fit together properly.

They may have changed that in RapidMind then. With Sh, part of the sales pitch was that the code you write *is* real C++. No external tools required. Just a library to link with. --bb
Jul 13 2007