Announcement

Collapse
No announcement yet.

NVIDIA C++ Standard Library Now Available Via GitHub

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

  • NVIDIA C++ Standard Library Now Available Via GitHub

    Phoronix: NVIDIA C++ Standard Library Now Available Via GitHub

    Introduced last year as part of CUDA 10.2 was libcu++ as the CUDA C++ standard library, which works with not only NVIDIA CUDA enabled configurations but also CPUs. The libcu++ sources are now available via GitHub...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    it's same thing intel did with libraries optimized for intel cpus and having unoptimized codepath for competition

    Comment


    • #3
      Interesting. I actually expected AMD to come up with something like this. They've been touting their APUs for years, promoting them as having "12 Compute Cores (4 CPU + 8 GPU)". IMO it would have been natural for AMD, not NVIDIA, to build a libstd++ like library that automatically pushes expensive but parallelizable tasks (e.g. sort on large data sets) to the GPU.
      Last edited by trilean; 19 September 2020, 06:36 AM.

      Comment


      • #4
        Originally posted by trilean View Post
        Interesting. I actually expected AMD to come up with something like this. They've been touting their APUs for years, promoting them as having "12 Compute Cores (4 CPU + 8 GPU)". IMO it would have been natural for AMD, not NVIDIA, to build a libstd++ like library that automatically pushes expensive but parallelizable tasks (e.g. sort on large data sets) to the GPU.
        They already did. It's called C++ AMP and they partnered with Microsoft for it.

        Comment


        • #5
          Originally posted by gigaplex View Post
          They already did. It's called C++ AMP and they partnered with Microsoft for it.
          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.

          Comment


          • #6
            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.

            Comment


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

              Comment


              • #8
                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?

                Comment


                • #9
                  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:


                  Historically, accelerating your C++ code with GPUs has not been possible in Standard C++ without using language extensions or additional libraries: In many cases, the results of these ports are worth…

                  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?

                  Comment


                  • #10
                    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.

                    Comment

                    Working...
                    X