Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (579)
games submitted by our members
Games in WIP (500)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  How useful is OpenCL?  (Read 2031 times)
0 Members and 1 Guest are viewing this topic.
Offline zingbat

Senior Member




Java games rock!


« Posted 2009-11-14 23:24:57 »

The same site that is hosting the JOGL project is also hosting Java bindings for OpenCL, JOCL? How useful is this for game programmers? What's the advantage?

http://projectkenai.com/projects/jocl/pages/Home

Offline bienator

Senior Member




OutOfCoffeeException


« Reply #1 - Posted 2009-11-15 00:21:49 »

it depends what your goals are. OpenCL makes it very easy to use the GPU for number crunching tasks. You could use OpenCL for example for heightfield generation, texture generation, particle effects and similar brute force tasks.

(In past it wasn't that easy, you would have to map a computational task to vertex/geometry/fragment shaders [which is not always straight forward] or use a proprietary language like cuda)

OpenCL programs are just in time compiled (see line 30 in the sample) and you can even run them on the CPU (e.g for as fallback mode) or on special hardware (exotic things like crypto accelerators).

youtube is already full of OpenCL particle effects demos.. just search for it.

Offline Cork

Junior Member




vote 6uN for OSX


« Reply #2 - Posted 2009-11-15 01:17:12 »

Sorry to barge in, but is OpenCL - JOCL also migrated to github?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline bienator

Senior Member




OutOfCoffeeException


« Reply #3 - Posted 2009-11-15 02:26:07 »

Sorry to barge in, but is OpenCL - JOCL also migrated to github?
not yet. The master JOCL repository is still hosted on kenai. This will change eventually.

Offline xinaesthetic

Senior Member


Medals: 1



« Reply #4 - Posted 2009-11-15 16:23:14 »

bienator; I notice yours is not the only fledgling Java OpenCL binding.  I'm sure you've noticed OpenCL4Java, which has some interesting looking integration with Scala.

I wonder if you've had any contact with the author, or if you have any comments about the two libraries etc.
Offline bienator

Senior Member




OutOfCoffeeException


« Reply #5 - Posted 2009-11-15 17:10:29 »

yes already had a friendly mail conversation with the authors. There is even yet another binding with the same name 'JOCL', i was just to lazy to think of a different name. All three started around the same time, short after the first spec went public. But there are enough differences between all three in api design, technical design (JNI vs JNA), license etc. I will blog about it when i go public with "my" JOCL (or whatever it will be called).

Offline xinaesthetic

Senior Member


Medals: 1



« Reply #6 - Posted 2009-11-15 18:53:12 »

I will blog about it when i go public with "my" JOCL (or whatever it will be called).
I look forward to reading that.
Offline princec

JGO Kernel


Medals: 282
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #7 - Posted 2009-11-16 10:38:33 »

I feel sure that this is going to end up as described here...

Cas Smiley

Offline xinaesthetic

Senior Member


Medals: 1



« Reply #8 - Posted 2009-11-16 14:59:15 »

I feel sure that this is going to end up as described here...

Cas Smiley
Intel certainly seem to think so.  With Larrabee, it might be most of the way around.

It also seems fairly clear that software needs to become increasingly parallelised to take advantage of the hardware; whether the hardware is something we call a graphics card or not.  As developers, we need nice ways of dealing with that.  I don't know how significant OpenCL will prove to be ultimately (I hope to see some more friendly high-level abstractions built on it).  It certainly seems to scratch an itch for a general purpose cross-vendor/platform tool to allow us to make best possible use of available hardware.
Offline bienator

Senior Member




OutOfCoffeeException


« Reply #9 - Posted 2009-11-16 15:36:28 »

OpenCL is really a kind of "computational shader" which runs on the hardware of your choice. It abstracts many parts of the concrete hardware to be portable (computing units, local - global memory etc). The most important decision the implementer has to make is: data parallel or task parallel. Most GPUs are inefficient for task parallelism and CPUs don't like data parallel problems.

I hope to see some more friendly high-level abstractions built on it
higher level as those which are already available?

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline xinaesthetic

Senior Member


Medals: 1



« Reply #10 - Posted 2009-11-16 16:26:01 »

OpenCL is really a kind of "computational shader" which runs on the hardware of your choice. It abstracts many parts of the concrete hardware to be portable (computing units, local - global memory etc). The most important decision the implementer has to make is: data parallel or task parallel. Most GPUs are inefficient for task parallelism and CPUs don't like data parallel problems.
Good point about task vs data parallelism... CPU / GPU distinction becomes increasingly blurred, but this will indeed be the fundamental nature of each for the time being.
Quote
higher level as those which are already available?
Well, to be fair I still haven't really properly cut my teeth with OpenCL (or CUDA or whatever), but as a general rule things can always be profitably driven to a higher level IMO.  The work of making computer languages more natural and expressive should never be given up.  Ideally, people shouldn't need to be engineers in order to tell their computers what to do... they should be able to get in just as deep as they need to to express what they want to express efficiently, no deeper.

For now, I don't know if the core hardware abstractions in OpenCL itself need to be higher level, I just mean it will take time for a range of useful higher level libraries to be built... for example, OpenMM is a promising library for molecular mechanics simulation; if my physics engine was replaced with that I might have GPU acceleration which would work on CUDA or OpenCL platforms without needing to actually get my hands dirty with either.  As well as libraries such as yours, we need more of those kinds of things - I think that's all I'm saying.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (33 views)
2014-04-15 18:08:23

BurntPizza (30 views)
2014-04-15 03:46:01

UprightPath (45 views)
2014-04-14 17:39:50

UprightPath (28 views)
2014-04-14 17:35:47

Porlus (45 views)
2014-04-14 15:48:38

tom_mai78101 (66 views)
2014-04-10 04:04:31

BurntPizza (126 views)
2014-04-08 23:06:04

tom_mai78101 (226 views)
2014-04-05 13:34:39

trollwarrior1 (191 views)
2014-04-04 12:06:45

CJLetsGame (199 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!