Fusiontron said:
I'm working on a project using GPUs to simulate heat transfer. We are trying to create a superset which will execute on all the main architectures. How legit is OpenCL for this purpose?
Hey Fusiontron.
The way OpenGL works is that the graphics card vendor (i.e. ATI/nVidia/Intel etc) provide a code library (DLL file) that implements the actual routines that are created by the OpenGL standards board, of which many of the members are from graphics cards companies.
What you have to do when you code the routines is query the DLL for the OpenGL version and any extensions that you wish to use.
If the OpenGL is set to a specific version or greater than a specific version, you are gauranteed to have all the standardized features of that particular version.
Basically you have to do two things:
1) Query the supported version. If the version supports everything you need and the system has a version greater than or equal to your version, then you are done and you can guarantee that the code that relies on having that version will run ok.
2) If you do not have a high enough implementation then you have to query for extensions and use them.
Extensions are basically non-standard features that vendors implement. These features can be experimental or they can be highly optimized routines that make use of new features in the architecture of the graphics device itself.
The features are vendor specific in most cases and in some cases you can use these extensions to do the same things that you can do in higher OpenGL version standards when the device has a lower standard. This is actually the kind of thing that was done in the video game Doom 3 to support the older video cards: custom extensions had to be used.
In terms of computing with regard to graphics, there are OpenGL standards that gaurantee specific computational platforms which will be useful for you, since once the standard for your graphics card is guaranteed, you just run the same code for every card that adheres to the standard.
I'm not sure about OpenCL specifically, but for OpenGL it is not hard to program GPU's and get results back if you use a high enough implementation.