44 points · by xstartup · 8y ago · 9 comments
"Better" is a matter of opinion, so I'll stay away from that claim.
But if we include AMD's HCC or Microsoft's C++ AMP projects (which turn C++ code and directly run it on the GPU), then I think you are mistaken about "faster".
http://rocm-documentation.readthedocs.io/en/latest/ROCm_API_...
https://msdn.microsoft.com/en-us/library/hh265136.aspx
Full GPU acceleration from C++ code. The SIMT model is quite powerful for allowing massive parallelism. And the "tiling" feature indicates that C++ is powerful enough to represent the various memory structures inside of the GPU. (LDS vs Global memory)
------------
Transparency of the memory model is incredibly important. GPUs only get their massive TFlop numbers if they are calculating from their LDS cache / Shared Memory locations. Even the biggest, beefiest GPUs with HBM2 only have ~480GB/s of main-memory performance, which is insufficient to reach 10TFlops. (Remember: a single float is 4-bytes. So 480GB/s bandwidth only gives 120GFlops at best)
Careful programming of memory, and transparency of the "LDS" cache and awareness of the limited register space of the GPU is needed to even
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.