LLVM Powers C++ AMP To OpenCL On NVIDIA
Phoronix: LLVM Powers C++ AMP To OpenCL On NVIDIA
An independent developer has made improvements to the LLVM infrastructure and Clang compiler for supporting the compiling of C++ AMP code into OpenCL code with support for the NVPTX back-end so that this multi-threaded C++ code can be executed on NVIDIA GPUs...
Yet another dev wasted his time on yet another parallel solution.
This is pretty cool. AMP is quite amazing, and stands to do what OpenMP literally can't (it's only for heterogeneous computing environments) and what plain OpenCL never will (it's too much of a pain in the ass to do even simple things in OpenCL when you have to code in two separate languages and manually manage a bunch of library state like OpenCL requires). Being able to just mark up a little C++ and have it transparently run on the GPU is damn handy.
I won't claim that AMP itself is specifically the way to go, but an architecture like AMP certainly is, and there's no competing specifications with similar vendor or developer pull.
Compared to crap like C++/CLI or C++/CX this is an actually interesting language extension from Microsoft. (Not the first, and some even became part of the C++ standard, but it's certainly rare; lots of bad ideas coming from that group.)
Well, I wouldn't really agree with the statement of C++/CLI being a bad idea, the implementation of creating it as an extension sure, but the idea of writing a C++ implementation on top of .NET is honestly rather interesting, and smart on the part of Microsoft because then there's a lot of C++ code that can be leveraged across any .NET language, and you could then leverage .NET from within C++, I fully expect that there'd be limitations and ultimately that it'd end up being a subset of C++, but for instance delete could be implemented as explicitly hinting the garbage collector that an object is no longer needed, although the garbage collector would still decide if and when it's going to delete it.
Originally Posted by elanthis
Granted it would be likely be slower than the output of a more standard C++ compiler, granted there are likely limitations that would arise... but... there's benefits there and it would have been interesting to see that play out...