feat(cccl): integrate missing CCCL directories — python/, ci/, .agent/, docs/, test/
Sparse-checkout from NVIDIA/cccl main branch to complete cccl_upstream: Added: - python/cuda_cccl/ (226 files) — Python bindings for device-level algorithms Critical for muh toolchain: cuda.compute.reduce_into, scan, radix_sort, etc. Includes 204 .py files with full test coverage for all 27 algorithms - ci/ (163 files) — Build/test infrastructure build_cub.sh, test_cub.sh, build_and_test_targets.sh, matrix.yaml Directly maps to our [INFRA-CI] and [INFRA-BUILD] items - .agent/skills/ (7 files) — NVIDIA's own agent skills for CCCL cccl-style/SKILL.md, cccl-test/SKILL.md, sass-diff/SKILL.md - docs/ (491 files) — Official CCCL documentation CI references, CMake guides, Python compute docs, libcudacxx PTX docs - test/ (12 files) — Top-level integration tests (cuda_smoke, stdpar) - Root configs: .clang-format, .clang-tidy, CONTRIBUTING.md, pyproject.toml - CLAUDE.md symlink → AGENTS.md (NVIDIA's standard) cccl_upstream now mirrors full NVIDIA/cccl structure: Before: 42M (cub + thrust + libcudacxx + cudax + c + examples + benchmarks) After: 53M (+python +ci +docs +.agent +test +configs) This completes the CCCL base needed for: - [muh-bench] items: ci/util/build_and_test_targets.sh for targeted builds - [CCCL-verify] items: python/cuda_cccl/tests/ as reference implementations - [CCCL-test] items: ci/test_cub.sh, ci/test_thrust.sh - Agent workflow: .agent/skills/ for consistent style and test patterns
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
.. _infra-cmake-architecture-flags:
|
||||
|
||||
Architecture flags
|
||||
==================
|
||||
|
||||
CCCL builds device code for the SM architectures named in ``CMAKE_CUDA_ARCHITECTURES``, a
|
||||
semicolon-separated list of SM numbers, each optionally tagged ``-real`` (embed SASS) or
|
||||
``-virtual`` (embed PTX for JIT on newer GPUs). CMake also accepts ``native``, ``all``, and
|
||||
``all-major``. The
|
||||
`CUDA_ARCHITECTURES property <https://cmake.org/cmake/help/latest/prop_tgt/CUDA_ARCHITECTURES.html>`_
|
||||
documents the standard syntax and values.
|
||||
|
||||
CCCL adds two values, expanded at configure time by ``cccl_check_cuda_architectures()`` against
|
||||
the toolkit found at configure time:
|
||||
|
||||
- ``all-cccl`` — every architecture the current nvcc supports at or above CCCL's minimum.
|
||||
- ``all-major-cccl`` — one entry per major architecture at or above the minimum, carrying
|
||||
forward PTX on the highest.
|
||||
|
||||
Both resolve against the installed toolkit rather than a fixed table. The minimum supported
|
||||
architecture and the full expansion logic live in ``cmake/CCCLCheckCudaArchitectures.cmake``.
|
||||
Expansion runs only for a top-level CCCL build; downstream consumers pass a concrete list or
|
||||
``native``.
|
||||
@@ -0,0 +1,102 @@
|
||||
.. _infra-cmake-helper-modules:
|
||||
|
||||
CMake helper modules
|
||||
====================
|
||||
|
||||
CCCL's ``cmake/`` directory holds the helper modules, script templates, and the vendored
|
||||
CPM package manager that drive the build. Library ``CMakeLists.txt`` files include these
|
||||
modules to add executables, generate header tests, expand architecture lists, wire install
|
||||
rules, and fetch dependencies. Each entry covers the module's purpose and the functions or
|
||||
macros it provides.
|
||||
|
||||
Helper modules
|
||||
--------------
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
:widths: 26 40 34
|
||||
|
||||
* - File
|
||||
- Purpose
|
||||
- Key functions / macros
|
||||
* - ``CCCLAddExecutable.cmake``
|
||||
- Add an executable with standard CCCL configuration, optional CTest registration, metatargets, and clang-tidy.
|
||||
- ``cccl_add_executable()``
|
||||
* - ``CCCLAddSubdir.cmake``
|
||||
- Pull the CCCL libraries into the build as in-tree subprojects via ``cccl_add_subdir_helper``, honoring ``CCCL_REQUIRED_COMPONENTS`` / ``CCCL_OPTIONAL_COMPONENTS``.
|
||||
- (calls ``cccl_add_subdir_helper()``)
|
||||
* - ``CCCLAddSubdirHelper.cmake``
|
||||
- Standardizes project/subproject behavior when included with ``add_subdirectory()`` by a consumer/CPM.
|
||||
- ``cccl_add_subdir_helper()``
|
||||
* - ``CCCLAddTidyTarget.cmake``
|
||||
- clang-tidy integration: global, per-subproject, and per-source analysis targets.
|
||||
- ``cccl_tidy_init()``, ``cccl_tidy_make_subproject_target()``, ``cccl_tidy_add_target()``
|
||||
* - ``CCCLBuildCompilerTargets.cmake``
|
||||
- Build the ``cccl.compiler_interface`` target carrying warning, RTTI, exception, and ptxas flags.
|
||||
- ``cccl_build_compiler_targets()``
|
||||
* - ``CCCLCheckCudaArchitectures.cmake``
|
||||
- Expand the special ``all-cccl`` and ``all-major-cccl`` values for ``CMAKE_CUDA_ARCHITECTURES`` against the current NVCC, filtered to the minimum CCCL-supported arch.
|
||||
- ``cccl_check_cuda_architectures()``
|
||||
* - ``CCCLClangdCompileInfo.cmake``
|
||||
- Enable ``CMAKE_EXPORT_COMPILE_COMMANDS`` and symlink ``compile_commands.json`` into the source tree for clangd.
|
||||
- (script; no public functions)
|
||||
* - ``CCCLConfigureTarget.cmake``
|
||||
- Apply common target properties: disable extensions, set and require the C++/CUDA standard, propagate dialect compile features, set output directories.
|
||||
- ``cccl_configure_target()``
|
||||
* - ``CCCLDevBuildChecks.cmake``
|
||||
- Enforce supported developer-build configuration: require matching ``CMAKE_CXX_STANDARD`` and ``CMAKE_CUDA_STANDARD``, default both to 17.
|
||||
- ``cccl_dev_build_checks()``
|
||||
* - ``CCCLEnsureMetaTargets.cmake``
|
||||
- Create the dot-path metatarget hierarchy so ``ninja cub.test`` builds all descendants of ``cub.test``.
|
||||
- ``cccl_ensure_metatargets()``
|
||||
* - ``CCCLGenerateHeaderTests.cmake``
|
||||
- Generate per-header compilation tests from a template to verify headers are self-contained, plus a link-check executable that catches missing ``inline`` markup.
|
||||
- ``cccl_generate_header_tests()``
|
||||
* - ``CCCLGetDependencies.cmake``
|
||||
- Fetch external and in-tree dependencies via ``find_package`` or CPM. NVBench SHA is pinned in ``CCCL_NVBENCH_SHA``.
|
||||
- ``cccl_get_<dependency>()``
|
||||
* - ``CCCLHideThirdPartyOptions.cmake``
|
||||
- Mark Catch2, CPM, FetchContent, and LLVM cache variables advanced to keep them out of the default cache view.
|
||||
- (script; ``mark_as_advanced`` only)
|
||||
* - ``CCCLInstallRules.cmake``
|
||||
- Generate header and CMake-config install rules per project, gated by a ``<project>_ENABLE_INSTALL_RULES`` cache option.
|
||||
- ``cccl_generate_install_rules()``
|
||||
* - ``CCCLTestParams.cmake``
|
||||
- Parse ``%PARAM%`` comments in test sources into the cartesian product of variant labels and preprocessor definitions. See :doc:`/cccl/development/testing` for usage.
|
||||
- ``cccl_parse_variant_params()``
|
||||
* - ``CCCLUtilities.cmake``
|
||||
- Shared utilities: non-fatal process execution, CPM-consumption compile tests, and expected-failure compile tests.
|
||||
- ``cccl_execute_non_fatal_process()``, ``cccl_add_compile_test()``, ``cccl_add_xfail_compile_target_test()``
|
||||
* - ``AppendOptionIfAvailable.cmake``
|
||||
- Append a compiler flag to a list only if a ``check_cxx_compiler_flag`` probe accepts it.
|
||||
- ``append_option_if_available()``
|
||||
* - ``CPM.cmake``
|
||||
- Vendored CPM.cmake package manager. Used by ``CCCLGetDependencies.cmake`` and by downstream consumers fetching CCCL.
|
||||
- ``CPMAddPackage()`` (third-party)
|
||||
|
||||
Install rule files
|
||||
------------------
|
||||
|
||||
``cmake/install/`` holds one file per installable project. Each calls
|
||||
``cccl_generate_install_rules()`` with that project's header subdirectories and packaging
|
||||
options.
|
||||
|
||||
Adding an executable
|
||||
--------------------
|
||||
|
||||
``cccl_add_executable()`` is the entry point most test and example ``CMakeLists.txt`` files
|
||||
use. It calls ``cccl_configure_target()`` for standard properties, registers metatargets via
|
||||
``cccl_ensure_metatargets()``, and adds a clang-tidy target via ``cccl_tidy_add_target()``.
|
||||
|
||||
::
|
||||
|
||||
cccl_add_executable(cub.test.device_reduce
|
||||
SOURCES test_device_reduce.cu
|
||||
ADD_CTEST
|
||||
)
|
||||
|
||||
``ADD_CTEST`` registers a CTest that runs the executable with no arguments. ``NO_METATARGETS``
|
||||
and ``NO_CLANG_TIDY`` opt out of those integrations. ``METATARGET_PATH`` overrides the dot-path
|
||||
(default: the target name). ``DIALECT`` forces a C++ standard for this target.
|
||||
|
||||
Architecture-flag expansion is covered in :ref:`infra-cmake-architecture-flags`.
|
||||
14
cccl_upstream/docs/infrastructure/cmake/references/index.rst
Normal file
14
cccl_upstream/docs/infrastructure/cmake/references/index.rst
Normal file
@@ -0,0 +1,14 @@
|
||||
.. _cmake-references:
|
||||
|
||||
CMake Reference
|
||||
===============
|
||||
|
||||
Reference pages for the CCCL CMake build system.
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
:maxdepth: 1
|
||||
|
||||
preset_reference
|
||||
cmake_modules
|
||||
architecture_flags
|
||||
@@ -0,0 +1,57 @@
|
||||
.. _infra-cmake-preset-reference:
|
||||
|
||||
Preset reference
|
||||
================
|
||||
|
||||
CCCL ships its CMake configurations as presets in ``CMakePresets.json``, using CMake's
|
||||
`preset format <https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html>`_. The file
|
||||
defines 40+ presets covering each library, multiple C++ standards, special build
|
||||
modes, and benchmarking.
|
||||
|
||||
Preset structure
|
||||
----------------
|
||||
|
||||
Each preset belongs to one of three sections:
|
||||
|
||||
- ``configurePresets`` set the configuration: enabled libraries, build type, CUDA
|
||||
architectures, C++ standard, and per-library options. Every configure preset
|
||||
inherits from the hidden ``base`` preset, which selects the Ninja generator,
|
||||
Release mode, ``all-major-cccl`` architectures, and disables all libraries by
|
||||
default. A named preset enables the libraries and options it needs.
|
||||
- ``buildPresets`` reference a configure preset by name. Some pin an explicit
|
||||
target list; most build everything the configuration enables.
|
||||
- ``testPresets`` reference a configure preset and add CTest filters. Filters
|
||||
select a subset of tests by name regex. CUB launcher-mode presets and Thrust
|
||||
GPU/CPU splits are examples of this pattern.
|
||||
|
||||
A configure preset, its build preset, and its test preset share a name. Run all
|
||||
three with the same ``<name>``.
|
||||
|
||||
Listing available presets
|
||||
-------------------------
|
||||
|
||||
``cmake --list-presets`` prints all configure presets::
|
||||
|
||||
cmake --list-presets
|
||||
|
||||
List build and test presets separately::
|
||||
|
||||
cmake --list-presets=build
|
||||
cmake --build --list-presets
|
||||
ctest --list-presets
|
||||
|
||||
Using a preset
|
||||
--------------
|
||||
|
||||
Configure, then build with the matching preset name::
|
||||
|
||||
cmake --preset cub-cpp17
|
||||
cmake --build --preset cub-cpp17
|
||||
|
||||
Run the test preset of the same name with ``ctest``::
|
||||
|
||||
ctest --preset cub-cpp17
|
||||
|
||||
Build output lands under ``build/<infix>/<presetName>/``, where the infix comes from
|
||||
the ``CCCL_BUILD_INFIX`` environment variable used for devcontainer isolation.
|
||||
Distinct presets use distinct build directories and do not collide.
|
||||
Reference in New Issue
Block a user