Announcement

Collapse
No announcement yet.

NVIDIA C++ Standard Library Now Available Via GitHub

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • hoohoo
    replied
    Originally posted by trilean View Post

    But that's not a drop-in replacement standard library. What I'm talking about are low-level libraries (e.g. the C++ Standard Library or possibly gzip, zlib, ...) that are built in a way where they offload compute intensive tasks to the GPU without the application using that library having to be APU/OpenCL/... aware.
    Hi there. You need to define what you mean by "drop in".

    If you mean you can swap the DLL or .so libraries then no, it is not drop in. This is called binary compat.

    If you mean at compile time the GNU or LLVM libstdc++ is equivalent to nVidia's libstdc++ you may be correct. This is called source code compat.

    I quote from the github for the project:

    "libcu++, the NVIDIA C++ Standard Library, is the C++ Standard Library for your entire system. It provides a heterogeneous implementation of the C++ Standard Library that can be used in and between CPU and GPU code.

    If you know how to use your C++ Standard Library, then you know how to use libcu++. All you have to do is add cuda/std/ to the start of your Standard Library includes and cuda:: before any uses of std:::"


    Which is compile time thing, source code compat. If you want to be able to have a binary unaware and uncaring which libstdc++ is being dynamically linked in then that's not indicated.

    Also, nVidia has this page listing what parts of the std c++ library are actually being done on CUDA:

    https://nvidia.github.io/libcudacxx/api.html

    We do not see stuff like vector or map or algorithm there... so IDK that it will, for example, automagically offload sorting huge vectors to a GPU.
    Last edited by hoohoo; 24 September 2020, 01:21 PM.

    Leave a comment:


  • oleid
    replied
    Could this be used with HIP on ROCm capable hardware?

    Leave a comment:


  • pal666
    replied
    to accelerate more than parallel extensions to standard algorithms, you have to wait for http://www.open-std.org/jtc1/sc22/wg.../p0443r12.html which could go in c++23

    Leave a comment:


  • pal666
    replied
    Originally posted by llukas View Post
    https://developer.nvidia.com/blog/ac...-using-stdpar/
    It seems that just by using proper C++ one is no longer locked-in to CUDA and not locked in to C-only OpenCL box?
    if you follow novideo examples, you are locked-in to cuda. to unlock yourself you have to follow https://en.cppreference.com/w/cpp/al...ution_policies
    but your standard library has to really accelerate them

    Leave a comment:


  • pal666
    replied
    Originally posted by llukas View Post
    You noticed difference that Intel MKL is binary-only library with its own API and that libcu++ implementation of C++ standard library that you can build from source yourself?
    i notice that building from source doesn't magically add support for non-novideo hardware, i.e. there's no practical difference

    Leave a comment:


  • gigaplex
    replied
    Originally posted by trilean View Post
    I haven't used libcu++ but it sure looks like it does to me:



    It's a fork of LLVM's libc++ so it is a complete implementation of the C++ Standard Library. Yes it uses a different namespace and I don't know if it does automatic dispatching to CPU/GPU, but libcu++ still looks pretty close to what I meant with:


    Several points here:

    - Being a fork doesn't mean it's a complete implementation. NVIDIA have only implemented some of the standard library classes.

    - Being in a different namespace by definition means it's not a drop in replacement. The application needs to have the source code edited and recompiled to make use of the new library so it won't just make non GPU aware applications work with a GPU. Many of the standard containers aren't thread safe so the concept of sorting the data in your example wouldn't work.

    - GPUs fundamentally can't perform some operations that a CPU can, and they're terrible at offloading many general tasks even if they can technically run (simply copying the data to and from the GPU takes longer than the CPU just computing the result). There's very little in the standard C++ library that would benefit from GPU offloading. What this library does instead is give a C++ standard library experience to developers who are explicitly writing CUDA code, so they don't have to write their own equivalents.

    Leave a comment:


  • llukas
    replied
    Originally posted by trilean View Post
    I haven't used libcu++ but it sure looks like it does to me:



    It's a fork of LLVM's libc++ so it is a complete implementation of the C++ Standard Library. Yes it uses a different namespace and I don't know if it does automatic dispatching to CPU/GPU, but libcu++ still looks pretty close to what I meant with:


    https://developer.nvidia.com/blog/ac...-using-stdpar/
    It seems that just by using proper C++ one is no longer locked-in to CUDA and not locked in to C-only OpenCL box?

    Leave a comment:


  • llukas
    replied
    Originally posted by pal666 View Post
    it's same thing intel did with libraries optimized for intel cpus and having unoptimized codepath for competition
    You noticed difference that Intel MKL is binary-only library with its own API and that libcu++ implementation of C++ standard library that you can build from source yourself?

    Leave a comment:


  • trilean
    replied
    Originally posted by gigaplex View Post
    NVIDIA's libcu++ doesn't do that either.
    I haven't used libcu++ but it sure looks like it does to me:

    Originally posted by https://github.com/NVIDIA/libcudacxx
    The NVIDIA C++ Standard Library aims to be a conforming implementation of the C++ Standard, ISO/IEC IS 14882, Clause 16 through 32.
    It's a fork of LLVM's libc++ so it is a complete implementation of the C++ Standard Library. Yes it uses a different namespace and I don't know if it does automatic dispatching to CPU/GPU, but libcu++ still looks pretty close to what I meant with:

    Originally posted by trilean View Post
    [...] What I'm talking about are low-level libraries (e.g. the C++ Standard Library or possibly gzip, zlib, ...) that are built in a way where they offload compute intensive tasks to the GPU without the application using that library having to be APU/OpenCL/... aware.

    Leave a comment:


  • gigaplex
    replied
    Originally posted by trilean View Post

    But that's not a drop-in replacement standard library. What I'm talking about are low-level libraries (e.g. the C++ Standard Library or possibly gzip, zlib, ...) that are built in a way where they offload compute intensive tasks to the GPU without the application using that library having to be APU/OpenCL/... aware.
    NVIDIA's libcu++ doesn't do that either.

    Leave a comment:

Working...
X