After reading this blog on Anandtech: The State of OpenCL & the First End-User OpenCL Drivers, I decided to try out the CPU-based OpenCL implementation… And what a surprise… the OpenCL applications I compiled with nVidia’s SDK wouldn’t run, because they couldn’t import the cl* functions. After a quick inspection it became clear that AMD screwed up… Their exported symbols have a leading underscore and an @NN suffix, because they are stdcall. I checked OpenGL and OpenAL to make sure, and indeed, they all use the same naming convention… as does nVidia ofcourse. No leading underscore and no suffix (which probably also means that the stack cleanup is different, so you can’t just modify the exported symbols, you also need to fix up the code itself). Since AMD breaks with this standard, you need to recompile your application in order to work with their DLL (which obviously breaks it with nVidia again).
However, after inspecting nVidia’s code, it would appear that they do NOT use stdcall, which OpenGL DOES use… but OpenAL does not. Did they screw up as well? I would expect everyone to use stdcall, like Microsoft always does, and it seems that OpenGL does this as well… But then what about OpenAL (but that doesn’t seem to have anything to do with Khronos…)?
So what is going on here? Why didn’t Khronos catch this problem? I know there is no ICD interface yet, but that doesn’t mean the calling convention of an OpenCL library can be arbitrary… Was it not specified? Did they just assume that people would use the standard as used by Microsoft and OpenGL (but not OpenAL)? Anyway, because Khronos apparently didn’t notice this, we now have two OpenCL 1.0-conformant implementations which aren’t compatible with eachother… quite the paradox.
And what’s with all these idiots commenting on the Anandtech blog, trying to defend AMD, while not even knowing how a DLL or ICD works? Doesn’t sound like Ryan Smith himself really understands what he’s talking about either, to be honest. And yes, ofcourse I MUST be affiliated with nVidia, just because I criticize AMD for not getting OpenCL right. Can’t I just have some honest criticism without having to have some ulterior motive or affiliation? And how does all this work anyway? It seems very arbitrary… people are all over Microsoft when it comes to messing up open standards, but with AMD it’s all good…?
Hopefully Intel will become competitive in the GPU market soon, then they’ll have to try and figure out whether I’m affiliated with nVidia and Intel first… and their puny brains will just explode trying to find the answer 🙂
Besides, the jury is still out on nVidia as well. AMD uses weird decorated names as exports (they didn’t use a .def file?), but nVidia’s use of cdecl is a tad suspect as well… According to AMD, stdcall was agreed on with Khronos. Then nVidia would also have made a mess of things here… and Khronos failed to catch them doing it, since they put their OpenCL 1.0-conformant stamp on it.