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
2.3 KiB
2.3 KiB
libcudacxx Style Guidance
Use this reference for libcudacxx/include/**/* and cudax/include/**/*.
Naming Style
All non-public symbols must be C++ reserved identifiers:
_for macros and template parameters, e.g._MY_MACRO,_MyParameter.__for all other symbols, e.g.__my_variable.- Never use reserved keywords, such as
__in,__out, or__inoutas variables, parameters, or function names. - Avoid single-letter template parameter names. Wrong:
_T; correct:_Tp.
Class / Struct
- Data member names have postfix
_, e.g.class __myclass { int __data_; };. - Constructor parameter names should match class/struct data member names without the postfix
_, e.g.class __myclass { __myclass(int __data) : __data_(__data) {} };.
Functions
- Use
constexprfor functions that do not depend on run-time features, such as pointers. - If the return type is not explicit (
auto), then a trailing return type is strongly preferred.
Headers
- Use the correct license:
libcudacxx/include/cuda/stdfiles ported from LLVM libc++ use the LLVM license.libcudacxx/include/cuda/files use Apache License v2.0 with LLVM Exceptions.
- Headers use include guards with names derived from the uppercase full path and closing
#endifcomments repeating the guard name. - Right after the include guard, include:
#include <cuda/std/detail/__config>
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
# pragma GCC system_header
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
# pragma clang system_header
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
# pragma system_header
#endif // no system header
- The last included header before code must be
<cuda/std/__cccl/prologue.h>, and<cuda/std/__cccl/epilogue.h>must appear at the end of the file.
Comments
- Use Doxygen-style
//! @briefcomments. - Documented functions must include
//! @brief,//! @param[in/out/in,out]for every parameter, and//! @returnfor non-void functions. - The
@brief/@param/@returndescription must accurately reflect the current functionality of the function.
Compiler Compatibility
- Do not use lambda expressions in device-only or host-device code.
- Do not rely on deduction guides for initialization; use explicit template arguments instead.