15

I read that Microsoft is closely working with Nvidia to improve AMP performances.

But my question is: is AMP a CUDA-replace by Microsoft? Or does AMP use CUDA drivers when a NVIDIA CUDA video card is available? Is AMP an openCL substitute?

I'm still pretty confused..

Marco A.
  • 43,032
  • 26
  • 132
  • 246
  • 1
    Does it matter whether the C++-AMP compiler generates GPU machine code directly, or generates C code and passes that to the CUDA or OpenCL compiler? Either way, you write C++-AMP instead of CUDA or OpenCL. – Ben Voigt Apr 24 '12 at 18:02
  • 1
    Also, there's no such thing as a "CUDA video card". CUDA is not implemented in hardware, it's converted (compiled) to the native instruction set of the GPU (i.e. Fermi). – Ben Voigt Apr 24 '12 at 18:04
  • 1
    The [C++ AMP specification](http://download.microsoft.com/download/4/0/E/40EA02D8-23A7-4BD2-AD3A-0BFFFB640F28/CppAMPLanguageAndProgrammingModel.pdf) makes no mention of CUDA or OpenCL. – ildjarn Apr 24 '12 at 18:07
  • ArrayFire is a better way to use GPUs through an array-based API. Faster, more versatile, and more functions than AMP. – arrayfire Apr 25 '12 at 05:45
  • *"I read that Microsoft is closely working with Nvidia to improve AMP performances"* - They should rather work on a more platform independent and less *"MSy"* specification for *AMP* to drive platform independent support further (but I guess, and can uderstand that, none of the two have interrest in that), since the basic concept of *C++ AMP* is just amazing and it's just its tiedness to DX and lack in image functionality that makes it rather useless as a general *heal-all-solution*. – Christian Rau Jun 07 '13 at 13:23

2 Answers2

23

C++ AMP is a library (and as part of it a key language extension was also introduced). Since C++ AMP is an open specification, it can be implemented on any other low level languages. Microsoft’s implementation builds on DirectCompute (and hence on HLSL), but that is completely hidden from you when you are using C++ AMP (which is why C++ AMP can be an open specification; it does not expose DirectX in the API surface). For more on C++ AMP, please follow the resources on the right of our blog (we’ll keep adding to that): http://blogs.msdn.com/b/nativeconcurrency/

You made a statement about Microsoft working with NVIDIA to improve C++ AMP performance – that is not true. Microsoft has worked with NVIDA and AMD and other partners to create the C++ AMP open specification. Microsoft also work with hardware vendors to make sure that the hardware vendors have stable video card drivers, which are required for any GPU compute technology to work correctly.

You also expressed confusion and threw some terms out. OpenCL is an approach to GPU computing (by Khronos), as is DirectCompute (by Microsoft), as is CUDA (by NVIDIA). These are all separate technologies, each with its own path to the GPU (always via a driver of some sort), each with its own merits, strengths, and disadvantages. One does not replace the other, and one is not universally better than the other. You now also have C++ AMP in that mix, as one more choice, and the same statements apply to that. The choice is yours as to which you decide to use.

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
Daniel Moth
  • 781
  • 4
  • 10
3

C++ AMP is a set of language extentions and APIs to support parallel programming technology including CUDA.

Since Microsoft also has a direct competitor to CUDA ( Direct Compute) and generally has preferred it's own proprietary graphics standards we will have to see what actually ever happens with it.

For Microsoft's view on it see these lectures

Martin Beckett
  • 94,801
  • 28
  • 188
  • 263
  • 5
    C++ AMP is mostly a library. The language extensions are tiny - the restrict keyword repurposing, and the tile_static storage specifier. The things you think of as C++ AMP - parallel_for_each, array_view, etc are all library not language. Otherwise your answer stands. – Kate Gregory Apr 24 '12 at 20:13
  • 1
    @KateGregory - yes, I hadn't gone into in detail but it seemed to have some extra hooks (like C++/CLR) so I thought it was safer to call it an extention – Martin Beckett Apr 24 '12 at 20:19
  • 3
    Hi Martin, thanks for linking to my screencasts. C++ AMP has no relationship to CUDA. I think you may be confusing the marketing term CUDA with the technology CUDA, but even then the C++ AMP open spec has no relationship to CUDA, and the C++ AMP Microsoft implementation has no relationship to CUDA. Also C++ AMP is not a set of language extensions, it is mostly a library. As part of C++ AMP a generic language feature was introduced, which is not tied to C++ AMP but rather is only used by C++ AMP at this moment in time. Also there is absolutely no relationship between C++ AMP and the CLR. – Daniel Moth Apr 25 '12 at 02:42
  • 2
    @DanielMoth - thanks I hadn't had chance to watch the videos then. I hadn't mean it was CLR, just that like C++ Component Extensions or C++/CLR so a "generic language feature was introduced" = non-standard C++ extention. Just to add to the confusion, Herb Sutter claimed in the announcement that it was C++ for the cloud and GPU! – Martin Beckett Apr 25 '12 at 03:13
  • @Kate You forgot to mention that C++AMP also uses the nonstandard operator `[=]` which you can NOT Google/Bind search for since all search engines ignore math symbols even if they are double-quoted. i.e. All the search engines return incorrect results for "c++amp history" by listing "camp history". :-/ – Michaelangel007 Apr 28 '13 at 15:01
  • 4
    @Michaelangelo [=] is neither an operator nor nonstandard. Search for `C++ 11 lambda` and all will be revealed. You can find many C++ AMP resources at gregcons.com/cppamp and the native parallel blog linked to from there – Kate Gregory Apr 28 '13 at 15:05
  • @KateGregory I would argue that whether or not the language extensions are "tiny" makes no difference, because even the tiniest of language extension makes it non-portable across compilers, hence the "language extension" part becomes more dominant than the "library" part, to the end-user. This is in fact C++ AMP's single biggest disadvantage, whilst the Microsoft implementation is the only one. – JBentley Oct 21 '13 at 15:51
  • Seems like AMP corresponds more to Nvidia's Thrust library in that it provides an STL-like interface for GPU programming. – Andreas Yankopolus Mar 09 '17 at 16:29