Hello everyone!
I know this is not the place for ads, but I'd like to show the stuff, that we have been working on for some time now, which is a way to be able to write programs for the GPU through C++.
It's called Minotaurus, a compiler extension, which can make certain C++ code parts run on the GPU. It is currently very much in it's infancy, however it is usable to some extents.
It works through templates and uses C++0x.
A demo video is available on youtube:
http://www.youtube.com/watch?v=31xKQ_9MN_k
Currently it is not public yet, but it's yet to be decided.
I'm actually just curious whether you see any fantasy in it, so opinions are much welcomed.
--
Greets,
I.
Seems really cool. Can you say anything about how is this different than C++ AMP?
interesting. any example how that C++ code which is then compiled for GPU looks?
Hi!
An excerpt code from the video demo is attached below.
We decided to put our webcompiler prototype out for the public, so you can have a look at it here (uname is "webcompiler", passwd is "23gd9j08o34"):
http://robotlab.itk.ppke.hu/~webcompiler/
But don't complain if it doesn't work for you 🙂
--
Greets,
I.
//... mino::mino_for("Julia::update():julia_matrix", [XX,YY,tick, shift, speed,x1,y1,x2,y2, kx, ky,step,anim,mx1, mx2, my1, my2] (int i, float * julia_matrix) { int y = i / XX; int x = i - y * XX; float in = tick/speed+shift-(x+y)/400.0f; float jx=kx+anim*sin(in/11.0f)*(mx2-mx1)*0.6f; // where is the Julia set reference point float jy=ky+anim*cos(in/10.0f)*(my2-my1)*0.6f; float xx=x1+x/float(XX/(x2-x1)); // which pixel float yy=y1+y/float(YY/(y2-y1)); complex<float> c(jx, jy); complex<float> z(xx, yy); int k=0; do{ z = z*z + c; k++; }while (real(z)*real(z)+imag(z)*imag(z) < 4.0f && k < step*256.0f) ; julia_matrix[y * XX + x] = k; } , XX * YY, julia_matrix); mino::array_download(julia_matrix); //...
Well, it's quite similar. But here are some points:
C++ AMP uses DirectCompute, Minotaurus uses OpenCL.
Currently, C++ AMP is implemented in MS compiler, Minotaurus uses GCC+LLVM.
Minotaurus currently doesn't have a frozen API.
Actually, the first working prototype of Minotaurus has been completed about one year ago (look at the related videos).
--
Greets,
I.