Backwards compatibility between OpenCL 1.1 and 1.0

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Backwards compatibility between OpenCL 1.1 and 1.0

chippies
Hi everyone,

I'm starting to choose which tools I'll be using for my OpenCL development.  Along the way, I've come to learn that later versions of OpenCL (1.1 and 1.2) have some new functions not present in v1.0 and that some old functions have been deprecated and hence might not be supplied by a specific OpenCL implementation.

Does JOCL handle this, providing me with a consistent API that exposes the same functionality regardless of whether the actual device is v1.0 or v1.1?

Thanks for the information.
Reply | Threaded
Open this post in threaded view
|

Re: Backwards compatibility between OpenCL 1.1 and 1.0

gouessej
Administrator
Hi

You can check the availability of an extension by using CLPlatform.isExtensionAvailable(String extension) and you can use CLProcAddressTable.isFunctionAvailable(String function) to check the availability of a method. You can get the supported version by calling getVersion().

JOCL provides both a low level API and an high level API. The former looks like plain OpenCL whereas the latter is easier to use.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Backwards compatibility between OpenCL 1.1 and 1.0

chippies
Thanks gouessej.  I was hoping that JOCL would do the work for me but I see I will have to handle the compatibility problem myself.

If my code calls a function that the specific device doesn't implement, e.g. deprecated OpenCL 1.0 functions that are not implemented by an OpenCL 1.1 implementation, will JOCL/Java catch this and produce an exception or will the program crash with a segfault?

Thanks for the info.