| I'll play OpenCL's advocate: > a device model which is (IMHO) ridiculous if you're running everything on the CPU How so? It's rather GPU-flavoured, sure, but is this a problem? My understanding is that it all maps down to CPUs just fine... even if no-one's really using OpenCL purely for parallel CPU work. > Ahead-of-time compilation to binary code OpenCL offers this too - `clGetProgramInfo` lets you access the compiled binary, and `clCreateProgramWithBinary` lets you make use of that binary. > no driver compiler in the way, so you can look at the ASM and know that's what will run Intel's OpenCL development tooling is really pretty good - it's not hard to inspect the assembly. Same goes for AMD's tooling. > going from whatever other language to ispc code is just a function call. Neat. OpenCL can't do either, as everything it does has to work sensibly with GPUs. > ispc can call out to C code Same again. > Straightforward interop with application data structures Fair point. I don't know if/how OpenCL handles the question of struct layouts, or memory compatibility more generally. I've passed structs between CPU and GPU with OpenCL, and it worked, but I think that's a hail Mary situation where really there's no assurance that the compilers' data layouts will match. Even the definition of 'int' must be free to vary. I can't see how it couldn't be. |
If I just want to call a function, pass some parameters, have it do some work, and get a result, things like OpenCL require all sorts of annoying boilerplate just to pass parameter values, map buffers, copy results out, etc. Sure it's all straightforward to write, but it's friction, and it's annoying.
Regarding clGetProgramInfo: does that return actual native executable code or IR? (I assume it's free to do either but in practice returns the latter, and that there's the usual "final driver compiler" between that code and what runs on the hardware, but I don't know.) An issue with that is that you can't be sure of what will run on users' systems; you're at the mercy of the version of the driver they've got installed.