Follow

Learned a lot about general computing on GPU via a youtube video.

Besides OpenGL compute shader, I'd prefer using OpenCL to update tons of units concurrently. I'll give it a try, but it seems like LWJGL's OpenCL binding is not well documented and only a few examples are given. Maybe I'll go further deeper in it.

youtube.com/watch?v=BjdYRtL6qj

@skyblond I am the lead dev/project owner of aparapi.com a library for writing java code that runs on the GPU through OpenCL... if your interested check it out.

@freemo Wow, that's really cool. I heart that library today and it's really for people who like me thinking "C is too much for me". BTW I'm using JDK11 and Kotlin mainly, so if this java version is supported, I'll have a try. Thanks!

@skyblond Feel free to ask questions if you need it. Keep in mind it wont completely isolate you from understanding GPU coding as you need to still code your JAVA in a way that is aware of the GPU and at a fairly low level (for java that is, as in you cant just call arbitrary libraries from your code, mostly primitive operations). But it does let you use JAVA syntax which can be way more pleasant for most people. Its main advantage though is its platform agnostic, so your code that runs on some GPU will run on any platform. If there isnt a GPU present it will run the code as plain java, so thats a nice benefit.

@freemo OK, but I still want to get my hands on raw OpenCL binding first just for having a general idea on how it's working. Having some knowledge about underlaying logic would always be useful for debugging(I guess).

@skyblond
Not a bad idea. Two points though.

1) you can use raw opencl bindings within aparapi. Basically you just use an annotation on the class that points to the file with the c-like code in it
2) aparapi normally generates the raw opencl code in c for you from the java code. So you can see what the code looks like in raw opencl

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.