tags:

views:

588

answers:

3

I'm investigating ways of using GPU in order to process streaming data. I had two choices but couldn't decide which way to go?

My criterias are as follows:

  1. Ease of use (good API)
  2. Community and Documentation
  3. Performance
  4. Future

I'll code in C and C++ under linux.

+14  A: 

OpenCL

  • interfaced from your production code
  • portable between different graphics hardware
  • limited operations but preprepared shortcuts

CUDA

  • separate language (CUDA C)
  • nVidia hardware only
  • almost full control over the code (coding in a C-like language)
  • lot of profiling and debugging tools

Bottom line -- OpenCL is portable, CUDA is nVidia only. However, being an independent language, CUDA is much more powerful and has a bunch of really good tools.

  1. Ease of use -- OpenCL is easier to use out of the box, but once you setup the CUDA coding environment it's almost like coding in C.
  2. Community and Documentation -- both have extensive documentation and examples, however I think CUDA has better.
  3. Performance -- CUDA allows for greater control, hence can be better fine-tuned for higher performance.
  4. Future -- hard to say really.
Kornel Kisielewicz
Actually there is one more advantage in using OpenCL, it can parallelize tasks in CPU too.
systemsfault
@holydiver, valid point, but you asked about GPU :)
Kornel Kisielewicz
Why i ask about the future of the both API's is that because I don't think that at this age, nonportable, closed source software will have a very bright future.
systemsfault
@holydiver, in this spirit you could say that neither Windows nor MacOS X has a bright future :>
Kornel Kisielewicz
@Kornel yes you are right, i didn't mentioned CPU and it is not a big issue for me :). I just point out that there is this feature that might be used as well. It may also be a good feature to use 1 API instead of using 2 seperate api's for CPU and GPU.
systemsfault
@Kornel After your answer, I'm more confused. Because i was likely leave out CUDA. But after I read the advantages of CUDA in your message, I stopped and started to think again :).A main reason for me leaving out CUDA is even its installation in linux is somewhat problematic and you need to downgrade to gcc 4.3 in order to use it.
systemsfault
@Kornel absolutely, i don't see a very bright future for MacOSX and Windows and i hope they'll burn in hell :p
systemsfault
@holydiver: nonportable closed-source software will never go away.
John Dibling
Qt are making it easier to go openCL http://labs.trolltech.com/blogs/2010/04/07/using-opencl-with-qt/
Martin Beckett
You list the fact that CUDA has it's own C like language yet you fail to mention the OpenCL C like language that is used to write OpenCL kernels.
Simon
+7  A: 

My personal experiences were:

  1. API: OpenCL has slightly more complex api. However most time you will spent in writing kernel code, and here both are almost identical.

  2. Community: CUDA has a much bigger community then OpenCL up til now, but this will probably about to even out.

  3. Documentation: Both are very well documented.

  4. Performance: We made the experience, that OpenCL drivers are not yet fully optimized.

  5. Future: The future lies with OpenCL as it is an open standard, not restricted to a vendor or specific hardware!

Danvil
+1  A: 

OpenCL all the way unless you have a specific reason to use CUDA. OpenCL runs well on multicores like Intel i7 in addition to running on GPUs. By using OpenCL you can run it on a much wider range of hardware from Droid cell phones to the IBM Power7 compute nodes of the world's largest supercomputer, Blue Waters, which is supposed to come online next year.

Chad Brewbaker