| Original ispc author here. I have no idea how performance compares to OpenCL on CPUs today, but it was in the same ballpark a few years ago. The big difference is that OpenCL imposes a device model which is (IMHO) ridiculous if you're running everything on the CPU. With ispc, you have: * Ahead-of-time compilation to binary code (no driver compiler in the way, so you can look at the ASM and know that's what will run.) * Straightforward interop with C/C++ code: it compiles to the C ABI, so going from whatever other language to ispc code is just a function call. (Similarly, ispc can call out to C code.) * Straightforward interop with application data structures: you can (and should!) pass pointers back and forth between C/C++ code and ispc code, do computation using the same data structures, etc. All three of those are much uglier / more painful with the device model. |
> 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.