Confusion on CUDA/openCL and C++ AMP

11,712

Solution 1

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.

Solution 2

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

Share:
11,712
Marco A.
Author by

Marco A.

Former NVIDIA and AWS engineer. Don't take anything I say for granted: I'm always learning. Gold badge in the c++ tag Some of my favorite answers and questions gcc and clang implicitly instantiate template arguments during operator overload resolution In overload resolution, does selection of a function that uses the ambiguous conversion sequence necessarily result in the call being ill-formed? clang fails replacing a statement if it contains a macro c++11 constexpr flatten list of std::array into array Is a program compiled with -g gcc flag slower than the same program compiled without -g? How is clang able to steer C/C++ code optimization? Newton Raphson with SSE2 - can someone explain me these 3 lines Clang compilation works while gcc doesn't for diamond inheritance

Updated on July 29, 2022

Comments

  • Marco A.
    Marco A. almost 2 years

    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..

  • Kate Gregory
    Kate Gregory about 12 years
    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.
  • Martin Beckett
    Martin Beckett about 12 years
    @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
  • Daniel Moth
    Daniel Moth about 12 years
    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.
  • Martin Beckett
    Martin Beckett about 12 years
    @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!
  • Marco A.
    Marco A. about 12 years
    Thank you, now it's finally clear. I'll take a look at your blog immediately!
  • Contango
    Contango over 11 years
    Just watching your "Heterogeneous Computing and C++ AMP" talk on Channel9. Extremely interesting.
  • Michaelangel007
    Michaelangel007 about 11 years
    @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". :-/
  • Kate Gregory
    Kate Gregory about 11 years
    @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
  • JBentley
    JBentley over 10 years
    @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.
  • Andreas Yankopolus
    Andreas Yankopolus about 7 years
    Seems like AMP corresponds more to Nvidia's Thrust library in that it provides an STL-like interface for GPU programming.