3 ms·
> A processor designed purely for speed, not for a compromise between speed and C support, would likely support large numbers of threads, have wide vector units
by dahart 9y ago
> A processor designed purely for speed, not for a compromise between speed and C support, would likely support large numbers of threads, have wide vector units, and have a much simpler memory model.
Sounds like a GPU?
> Running C code on such a system would be problematic, so, given the large amount of legacy C code in the world, it would not likely be a commercial success.
It seems like ATI & NVIDIA are doing okay, even with C & C++ kernels. GLSL and HLSL are both C-like. What is problematic?
- tsomctl 9y agoC-like code that runs on GPUs is not even close to normal C, even though the syntax is similar. The way you layout your memory, schedule your threads, and add memory barriers is completely different. You are never going to take a piece of large C code written for a CPU and just run it directly on a GPU.
- dahart 9y agoHuh, that’s weird, I run a C++ compiler directly on my GPU code. The only difference between CPU and GPU code at the function level is whether I tag it with a __global__ macro or not, and lots of functions compile and run for both CPU and GPU. Memory layout, thread scheduling, and barriers are not features of the C language and have nothing to do with whether your C is “normal”. Those are part of the programming model of the device you’re using, and apply to all languages on that device. Normal C on an Arduino looks different than normal C on an Intel CPU which looks different than normal C on an NVIDIA GeForce.
- tsomctl 9y agoOK, I guess it comes down to what you call "normal" C. I was defining it as what would run on x86 Windows or Linux.
- my123 9y agoYou can look at C++ AMP too, it runs with all GPUs that support DX11 on Windows, and is a part of the Windows SDK. It's implemented by AMD ROCm on Linux, which also implements HIP/CUDA. Normal C/C++ can run fine on modern GPU architectures.
- pjmlp 9y agoNVidia designed their latest GPU architecture to run C++.
- rbanffy 9y ago> Sounds like a GPU? Which reminds me I'd love to see a computer running exclusively from a GPU-like CPU. And no, Xeon Phi's don't count. They are cool, but look too much like normal PCs.
- dahart 9y agoHere’s one: https://en.m.wikipedia.org/wiki/Cray-1 https://en.m.wikipedia.org/wiki/Cray-1 They didn’t call it a GPU then, but the SIMD architecture is quite similar at a high level. Larrabee was going to be a GPU-like CPU. https://en.m.wikipedia.org/wiki/Larrabee_(microarchitecture) https://en.m.wikipedia.org/wiki/Larrabee_(microarchitecture) Here’s a more modern GPU based computer: https://www.nvidia.com/en-us/self-driving-cars/drive-platform/ https://www.nvidia.com/en-us/self-driving-cars/drive-platfor... If you meant something that sits on your desktop and runs Linux, then yeah it’s uncommon but not unheard of to run it on a SIMD system. The trend is absolutely definitely going toward SIMD being used in general purpose computing. Even if you don’t want to count any of my examples, you will see the “normal” PC become more GPU-like in the future than it is today.
- rbanffy 9y ago> you will see the “normal” PC become more GPU-like in the future than it is today. I keep telling people to get used to develop on Xeon Phi's and nobody seems to listen ;-) Today's Xeon Phi is tomorrow's Core i9.
- geokon 9y agoI've only done a bit of GPU kernel writing, but I always found it very .. unergonomic. Its like they mashed C to work in a context it wasn't meant for. Which is understandable since you want to encourage adoption, but I'd guess it's part of the motivation behind creating SPIR-V and allowing people to target other languages to the GPU
- pjmlp 9y agoSPIR is a reaction to CUDA's adoption. NVIdia always allowed multiple language on CUDA via PTX, with the offerings for C, C++ and Fortran coming from them, while some third parties had Haskell, .NET and Java support as well. Yet another reasons why many weren't so keen in being stuck with OpenCL and C99.