PDA

View Full Version : QtConcurrent and CUDA or GPGPU



olidem
6th December 2009, 16:29
Hi,

I just read the introduction of the QtConcurrent package and I was wondering, whether there are already CUDA of GPGPU bindings available, that use all resources.

Or is QtConcurrent "just" making use of the "normal" cpus ?

Thanks,
Olli

axeljaeger
7th December 2009, 13:29
It is just making use of normal CPUs. It is a framework to let jobs be processed by some threads and get informed about the results.

Tanuki-no Torigava
8th December 2009, 05:58
It is just making use of normal CPUs. It is a framework to let jobs be processed by some threads and get informed about the results.


Yes, that is true. You cannot make use of QtConcurrent here because a few people requires to run threads on GPU and as far as I know you need to look into OpenCL.

Best wishes.

olidem
8th December 2009, 10:21
Well, but doesn't it suggest itself to think of cuda bindings for QtConcurrent? Is it due to (L)GPL restrictions that this isn't done, or am I missing something here?

Ok, usually such cuda programs are highly optimised for the cuda architecture they are run on. But I can imagine general rules how one could at least set up some general rules for the translation of those qtconcurrent operations to the gpu.

Please correct me if i am wrong.

wysota
8th December 2009, 10:24
Well, but doesn't it suggest itself to think of cuda bindings for QtConcurrent? Is it due to (L)GPL restrictions that this isn't done, or am I missing something here?
CUDA is pseudo-C, QtConcurrent is C++. CUDA requires data to be setup in a very specific way, execution is groupped into blocks, etc. It just doesn't fit into what QtConcurrent does.

axeljaeger
8th December 2009, 10:24
A Qt programm is written in C++. So is the code written in C++ that the QtConcurrent jobs run. The programm is then compiled to run on the host CPU architecture.

If you want to use CUDA, you have at least to compile the program again for the GPU. This implies that there is infrastructure to do so. Currently there is no such infrastructure in Qt. I think it could be done but it is not so easy that you could do it in 30 minutes as long as the license would permit it.

olidem
8th December 2009, 10:33
Yes, of course! I never said, it could be done in one day.

But, for me this is really an interesting topic and perspective for the coming years. And I do not want to restrict this idea just to cuda. There are several other techniques and languages out there being really promising, eg. as already mentioned OpenCL.

Perhaps this could be another direction the development of Qt go into. I am quite sure that there are a lot of people out there searching for one "standard" way how to port their code to such gpus and not wanting to develop 1 month for each architecture.

wysota
8th December 2009, 10:39
In my opinion there is not much here that Qt could improve in the subject. OpenCL is portable so you can use it directly. Providing a Qt wrapper over a C++ interface would probably be a waste of time.

Phlucious
27th February 2013, 22:07
Yes, this is an old thread, but a new search brought me here and there's been an update along these lines. Looks like someone's been working on integrating Qt with OpenCL to accomplish what the OP is talking about.

http://blog.qt.digia.com/blog/2010/04/07/using-opencl-with-qt/