Re: Why CLEventList has fixed size?
Posted by
Wibowit on
Apr 03, 2011; 12:16pm
URL: https://forum.jogamp.org/Why-CLEventList-has-fixed-size-tp2705613p2770974.html
Well, at least for me JOCL looks very low-level. It's almost 1:1 copy of original OpenCL API. Certainly it doesn't benefit much from being object-oriented. If your goal is to be low-level then it does make some sense.
Unfortunately, I have too little time to develop developer-friendly OpenCL binding so I'm left with what is available now.
You said that programmers switched from Fortran to Java because Java is more productive. I say that programmers will switch from low-level bindings to high-level bindings (when they appear) to be more productive. A little additional overhead won't make a big difference on program efficiency. Remember - hardware is getting cheaper but professionals are becoming more precious. Today's developers have trouble with simple problems like:
http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.htmlIf you have ever tried creating a game in OpenGL (or DirectX) then probably you've read about speed of state changes, ie. maximum achievable number of state changes per second. Generally GPU power grows much quicker than the state changes speed. Does it mean that OpenGL or DirectX aren't scalable? I think yes. Setting up GPU consumes a lot of time, the more complex GPU architecture become, the more complex are state changes.
With my solution (ie. ThreadLocal buffers for copying events between Java and driver) you're only forced to allocate a buffer when you're event list is bigger than standard buffer size (eg 100 KiB). Copying 100 KiB of data probably takes more time than allocating a direct buffer so in the end my solution will be almost as fast as current solution or even faster (because with my solution you're not forced to allocate such many small direct buffers - instead we would allocate many Java objects and copy data).
GC friendly? No. I think you're not. You're using direct buffers. Direct buffers are not GC friendly. And you additionally force users to allocate many such buffers - I do not see any way to change events that are already in an event list.