OpenCL

Started by dronus, February 10, 2010, 14:46:50

Previous topic - Next topic

delt0r

OpenCL is very very poorly supported by drivers at this stage IME(InMyExperence). I don't think there is any rush till things stabilize to something you at least have a hope of get working on a clients computer.
If you want a plot read a book and leave Hollywood out of it.

spasi

I just made the first successful LWJGL OpenCL call, yay. I should be able to implement OpenCL 1.0, 1.1 + extensions over the weekend, then I'll work on the java-side API, then integration with OpenGL... should have a beta version committed by the next weekend, hopefully.

It took a while because OpenCL makes heavy use of pointer arrays and size_t parameters. I ended up implementing a PointerBuffer class that mirrors the LongBuffer API at the Java-side, but works with either 32bit or 64bit values underneath. Then I had to add support for it in our generator, do a bit of refactoring, etc.

Matzon

Excellent work. Should we hold 2.6 and get that in or ?

spasi

If there's an important fix/feature in 2.6, we should go ahead and release it, OpenCL can wait.

Matzon

nope - I'd also like to get opencl out there and then do a 2.6.x later on

spasi

It currently looks like that the OpenCL binding would be much cleaner/prettier if we could use generics and enums. Do you think this is a good time to move to a 1.5+ code base? Or should we wait for 3.0 (which might also include non-backwards-compatible changes)?

kappa

I'd be shocked if there is a computer out there that supports OpenCL and has Java 1.4 :)

princec

Let me just check my "in-the-wild" Java stats to see what 1.4 VMs are still out there...

Cas :0

Matzon

would retroweaver be an option?

kappa

Quote from: princec on September 20, 2010, 17:24:41
Let me just check my "in-the-wild" Java stats to see what 1.4 VMs are still out there...

Cas :0

last I checked on StatOWL, Java 1.4 and all jre versions below it only accounted for about 5% of all java installs. Java 1.5 accounted for about 15% and with the rest either having Java 6 or no java.

but will be interesting to see what stats you get from your games.

princec

Right, stats since the great hard disk crash indicate a still reasonably sizeable 10% of the Mac-using population running Puppygames are using 1.4 for some reason. (That's unique installs too, not plays) I'm on the verge of saying "ditch them" as those running 1.4 are also mostly running 10.3.9 and 10.4.11 which are getting pretty long in the the tooth. Mac being 50% of my customer base that's a fairly sizable number of people though.

To move to Java 5 syntax and so on we should bump the major version number of LWJGL though - maybe to 3.0 - and archive the 2.5 LWJGL release so that those wanting backward 1.4 compatibility don't have to arse about retroweaving or anything.

Cas :)

kappa

just curious, how will OpenCL be integrated into LWJGL, will it just be a in the lwjgl.jar/lwjgl.dll or will it be a separate standalone optional jar and native (lwjgl-opencl.jar and opencl.dll) ?

do consider its likely to a be a small niche market for a while yet.

spasi

I was thinking about that too, might as well go for a separate jar/dll for now. I'll see how it goes first though, gonna decide when the implementation is complete.

edit: On a related note, we could do an extension cleanup soon. We support dozens of legacy extensions that can be easily removed.

kappa

yeh agreed, did notice that the lwjgl.jar has picked up some weight as of late (*shakes fist at khronos*).

e.g.

lwjgl 2.3 = lwjgl.jar (590kb)
lwjgl 2.5 = lwjgl.jar (729kb)

spasi

I took a break from OpenCL and made another change to the Generator that lets us reuse entry points. Many ARB extensions will now reuse the implementations of the core functions (even if the corresponding GL version isn't supported). A total of 287 functions have been updated to use this trick.