CUDA Core Compute Libraries (CCCL)

repository·main·Indexed 25 days ago

https://github.com/nvidia/cccl

A unified repository providing high-performance C++ building blocks for CUDA developers, combining Thrust, CUB, and libcudacxx. It includes the CUDA Experimental (cudax) header-only library for features in active development, a JIT template system for NVRTC-compiled code, and integration support via CMake and the CMake Package Manager (CPM).

Tokens
226.2K
Snippets
469
Records
873
Agent score
79%

What's inside CCCL

  1. Overview of CUDA Experimental (cudax)

    main

    cudax (CUDA Experimental) is a library providing experimental features that are currently in development. While these features are subject to change and lack stability guarantees, they are intended for users to experiment with for specific high-performance use cases.

    Key capabilities provided by cudax include:

    • Asynchronous host-to-device and device-to-host byte-wise mdspan copies.
    • Byte fill operations for mdspan.
    • Uninitialized storage support.
    • Graph functionality.
    • Dimensions description functionality.
    • places for managing execution and data affinity across multiple devices.
    • An implementation of the STF (Sequential Task Flow) programming model.
  2. What is CUB and its core components?

    main

    CUB (CUDA Unbound) provides reusable software components for every layer of the CUDA programming model. It offers both scalar interfaces (single thread operations) and collective interfaces (operations entered simultaneously by a group of threads).

    CUB's components include:

    • Parallel primitives:
      • Thread-level: Reduction and other primitives specialized for specific CUDA architectures.
      • Warp-wide: "Collective" primitives like cooperative prefix scan and reduction.
      • Block-wide: "Collective" primitives for cooperative I/O, sort, scan, reduction, and histogram, compatible with arbitrary thread block sizes.
      • Device-wide: Parallel sort, prefix scan, reduction, and histogram, compatible with CUDA dynamic parallelism.
    • Utilities: Fancy iterators, thread/block I/O, PTX intrinsics, and device/kernel/storage management.
  3. Overview of CCCL Python Libraries

    main
    The CUDA Core Compute Libraries (CCCL) for Python provide high-quality, high-performance, and easy-to-use abstractions for CUDA Python developers. The primary module is cuda.compute, which offers composable device-level primitives. These primitives allow developers to build custom parallel algorithms without writing raw CUDA kernels directly, by exposing highly-optimized algorithms from the CCCL C++ libraries that are tuned for optimal performance across various GPU architectures.
  4. Overview of NVRTCC

    main

    NVRTCC is a tool designed to simplify NVRTC (NVIDIA Runtime Compilation) testing. It mimics the nvcc compilation trajectory but replaces the nvcc-generated PTX code with code compiled via NVRTC. This allows developers to keep source files nearly identical to standard nvcc source files while leveraging NVRTC. NVRTCC ensures necessary symbols are present in the generated PTX, allowing nvcc to handle host compilation and linking.

    Note: This is an internal, experimental tool and is not intended for general public use.

  5. What is CUDA Core Compute Libraries (CCCL)?

    main

    CUDA Core Compute Libraries (CCCL) is a unified repository of three essential CUDA C++ libraries designed to provide high-performance, easy-to-use C++ abstractions for CUDA developers:

    • Thrust: A high-level C++ parallel algorithms library. It enhances productivity and enables performance portability between GPUs and multicore CPUs via configurable backends (e.g., CUDA, TBB, OpenMP).
    • CUB: A lower-level, CUDA-specific library for "speed-of-light" parallel algorithms. It provides device-wide algorithms and cooperative algorithms (like block-wide reduction or warp-wide scan) for building custom kernels.
    • libcudacxx: The CUDA C++ Standard Library. It provides a C++ Standard Library implementation that works on both host and device, along with abstractions for CUDA-specific hardware features like synchronization primitives, cache control, and atomics.
  6. Overview of Mdspan extended APIs in CCCL

    main

    The mdspan extended API in CCCL provides specialized accessors, layout policies, and conversion utilities to handle various CUDA memory spaces and data formats.

    Available features include:

    • Host/Device/Managed Accessors: Support for different CUDA memory spaces.
    • Layout Stride Relaxed: Layout mapping policies supporting negative/zero strides and offsets.
    • Restrict Accessor: Support for the *restrict aliasing policy.
    • Shared Memory Accessor: Specialized mdspan and accessor for CUDA shared memory.
    • DLPack Interoperability: Conversion between mdspan and DLTensor formats.
  7. Overview of CUDA C++ Core Libraries (CCCL)

    main

    The CUDA Core Compute Libraries (CCCL) is a unified collection of high-performance C++ libraries designed for CUDA developers. It provides abstractions that work across host and device code, aiming to provide general-purpose, high-performance tools similar to the Standard C++ Library but optimized for GPU architectures.

    The CCCL consists of four primary components:

    • libcu++ (CUDA C++ Standard Library): An implementation of the C++ Standard Library that works in both host and device code. It includes abstractions for CUDA-specific hardware features such as synchronization primitives, cache control, and atomics.
    • CUB: A lower-level, CUDA-specific library focused on speed-of-light parallel algorithms. It provides device-wide algorithms as well as cooperative algorithms (e.g., block-wide reduction, warp-wide scan) to serve as building blocks for custom kernels.
    • Thrust: A high-level C++ parallel algorithms library. It enhances productivity and provides performance portability between GPUs and multicore CPUs using configurable backends (e.g., CUDA, TBB, OpenMP).
    • Cuda Experimental (cudax): A library containing experimental features that are currently in the design process.
  8. Overview of Memory Access Properties in libcu++

    main

    The libcudacxx extended API provides mechanisms to represent, bind, and apply memory access properties to pointers. These properties allow for more explicit communication of memory access intent (such as read-only or read-write constraints) within CUDA code.

    Key components include:

    • cuda::access_property: The core abstraction representing a specific memory access property.
    • cuda::annotated_ptr: A wrapper that binds an access property directly to a pointer.
    • cuda::apply_access_property: A mechanism to apply an access property to memory.
    • cuda::associate_access_property: A way to associate an access property with a raw pointer.
  9. Overview of libcudacxx extended math API

    main

    The libcudacxx extended math API provides specialized integer and high-performance mathematical functions for CUDA development. These functions are categorized by their operation, such as integer logarithms, power-of-two operations, and optimized division/modulo routines.

    Note that availability of these functions depends on both the CCCL version and the CUDA Toolkit (CTK) version. For example, functions like sincos require CCCL 3.3.0 and CUDA 13.3 or later.

  10. Overview of the cudax Graphs library

    main

    The cudax graphs library provides C++ wrappers to create and manage CUDA graphs. It uses owning and non-owning wrappers around standard CUDA graph types to provide a more ergonomic interface.

    Warning: This library is currently under construction and is not yet ready for production use.

  11. Overview of libcudacxx extended API type traits

    main
    The libcudacxx extended API provides specialized type traits for CUDA development. These traits allow for compile-time checks on type properties such as floating-point status, trivial copyability, bitwise comparability, and CUDA-specific vector types. These traits are designed to work with CUDA-specific types and extended floating-point standards.
  12. Overview of CUDA Memory Resources

    main

    The <cuda/memory_resource> header provides a standard C++ interface for heterogeneous, stream-ordered memory allocation. It is designed specifically for CUDA C++ developers to handle memory across different device/host boundaries and utilize asynchronous stream-ordered allocation mechanisms.

    Key characteristics:

    • Heterogeneous Support: Unlike std::pmr::memory_resource, this interface is designed to verify and manage memory accessibility across different device types.
    • Stream-Ordered: Built to support CUDA stream-ordered memory allocation.
    • Relationship to RMM: This header defines the interface (cuda::mr). The RAPIDS Memory Manager (RMM) project provides the actual implementations of these interfaces.