Advertisement Jump to content
Sign in to follow this  
fir

opencl usability

This topic is 1823 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I recently was playing with some setup code for opencl 

(running kernels and getting results), it seem to work,

but i do not know downsides etc, I am also tottaly new

to that so i got no idea how to use it as kind of afterburner

or something in the normal programs/ games..

Is this opencl usable  when writing games, do people use it

and for what? What level of usability it has (no usable/rare usable/

somtimes usable/often usable/always usable?)

 

Share this post


Link to post
Share on other sites
Advertisement

OpenCL could be useful if you have a highly parallelizable problem with relatively large units of work and few interdependencies.

 

That is still rather rare both in games and in applications in general.

 

It is not meant to be used for general computing, but to speed up specific algorithms.

 

Potential areas could be image processing and AI.

 

Downsides are mainly transfer speed to/from the hardware performing the calculations (overhead on the work units), and the increased complexity in designing parallel algorithms that perform well.

Share this post


Link to post
Share on other sites

and in the norma llife ? (writing i dont know 2d/3d shoter/platformer/rpg?)

Is it unusable or yet it is uable? (I know maybe this question is a bit hard but would be curious) 

Edited by fir

Share this post


Link to post
Share on other sites
and in the norma llife ? (writing i dont know 2d/3d shoter/platformer/rpg?)

What compute tasks that the CPU couldn't just do without OpenCL do you have in your 2D platformer?

 

You want OpenCL if you have some hefty number crunching to do, as it allows you to do these embarrassingly parallel tasks on hardware (the GPU) which was explicitly made for that purpose and which executes a lot faster than a CPU, which is (with the exception of several cores and hyperthreads) not a parallel processor.

 

Cloth physics, or simulating 5,000 asteroids, or deforming a plastic/rubber object as it falls to the ground and bounces off are examples of what you'd do with OpenCL. You can do the same with OpenGL compute shaders or with transform feedback too (and with one less dependency!), but OpenCL offers functionality that is limited or not available at all on some versions of OpenGL, and it works almost the same even if the user does not have the latest generation graphics card.

 

If you don't have something that has the words "few thousands" or "few millions" in it, you likely don't want to think about OpenCL. Setting up the beast (including compiling the kernels etc.) is non-trivial work, and launching a kernel, including uploading the data that it wants to see is not precisely a free operation.

It's only worth the trouble if you have several thousand (better a hundred thousand) mostly-identical work items to process.

Edited by samoth

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!