[CCCL] 瘦身 + 补全: 移除 cudax/python/libcudacxx-tests 冗余文件, 新增 c2h 测试助手 + cmake 构建系统 + 8 个 CUDA thrust examples
变更摘要:
- 删除: cudax/ (783 files, 7.2M) — 实验性组件,竞赛不需要
- 删除: python/ (226 files, 2.0M) — Python 绑定,竞赛不需要
- 删除: libcudacxx/{test,benchmarks,codegen,cmake,share} (4432 files, 31M)
保留: libcudacxx/include/ (1463 headers, cuda::std 编译依赖)
- 新增: c2h/ (27 files) — CUB Catch2 测试辅助头文件,编译 243 个测试必需
- 新增: cmake/ (29 files) — CCCL 原生 CMake 构建系统
- 新增: thrust/examples/cuda/ (7 files) + cpp_integration/ (1 file)
async_reduce, custom_temporary_allocation, explicit_cuda_stream,
global_device_vector, range_view, unwrap_pointer, wrap_pointer, device
结果: cccl_upstream 从 74M→35M (瘦身 53%), 核心内容 100% 保留:
27/27 tuning headers, 78 benchmarks, 243 tests,
60 thrust examples, 18 CUB examples, 全部编译头文件
This commit is contained in:
@@ -1,200 +0,0 @@
|
||||
# Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
[build-system]
|
||||
# cmake>=3.30 is needed for FindCUDAToolkit's CUDA::nvfatbin /
|
||||
# CUDA::nvfatbin_static imported targets, which the v2 (HostJIT) backend links
|
||||
# against. Listed here so isolated builds (pip's default) pick it up.
|
||||
requires = ["scikit-build-core>=0.10", "setuptools_scm", "cython>=3.1.0", "cmake>=3.30"]
|
||||
build-backend = "scikit_build_core.build"
|
||||
|
||||
[project]
|
||||
name = "cuda-cccl"
|
||||
description = "CUDA Core Compute Libraries for Python"
|
||||
authors = [{ name = "NVIDIA Corporation" }]
|
||||
classifiers = [
|
||||
"Development Status :: 4 - Beta",
|
||||
"Intended Audience :: Developers",
|
||||
"Topic :: Software Development :: Libraries :: Python Modules",
|
||||
"Programming Language :: Python :: 3 :: Only",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Programming Language :: Python :: 3.12",
|
||||
"Programming Language :: Python :: 3.13",
|
||||
"Programming Language :: Python :: 3.14",
|
||||
"Environment :: GPU :: NVIDIA CUDA",
|
||||
"License :: OSI Approved :: Apache Software License",
|
||||
"Operating System :: POSIX :: Linux",
|
||||
"Operating System :: Microsoft :: Windows",
|
||||
]
|
||||
requires-python = ">=3.10"
|
||||
|
||||
dependencies = [
|
||||
"numpy",
|
||||
"cuda-pathfinder>=1.2.3",
|
||||
"cuda-core",
|
||||
"typing_extensions",
|
||||
]
|
||||
|
||||
dynamic = ["version"]
|
||||
readme = { file = "README.md", content-type = "text/markdown" }
|
||||
|
||||
[project.optional-dependencies]
|
||||
minimal-cu12 = [
|
||||
"cuda-bindings>=12.9.1,<13.0.0",
|
||||
"cuda-toolkit[nvrtc,nvjitlink,cudart,nvcc]==12.*",
|
||||
]
|
||||
minimal-cu13 = [
|
||||
"cuda-bindings>=13.0.0,<14.0.0",
|
||||
"cuda-toolkit[nvrtc,nvjitlink,cudart,nvcc,nvvm]==13.*",
|
||||
]
|
||||
# sysctk variants: like cu12/cu13 but without cuda-toolkit — the user is
|
||||
# responsible for providing a compatible CUDA toolkit
|
||||
minimal-sysctk12 = [
|
||||
"cuda-bindings>=12.9.1,<13.0.0",
|
||||
]
|
||||
minimal-sysctk13 = [
|
||||
"cuda-bindings>=13.0.0,<14.0.0",
|
||||
]
|
||||
cu12 = [
|
||||
"cuda-cccl[minimal-cu12]",
|
||||
# numba-cuda currently expects numba.cuda.types.NPDatetime, removed in numba 0.66.
|
||||
"numba>=0.60.0,<0.66",
|
||||
"numba-cuda[cu12]>=0.23.0,!=0.27.*,!=0.28.*,!=0.29.*,!=0.30.0",
|
||||
]
|
||||
cu13 = [
|
||||
"cuda-cccl[minimal-cu13]",
|
||||
# numba-cuda currently expects numba.cuda.types.NPDatetime, removed in numba 0.66.
|
||||
"numba>=0.60.0,<0.66",
|
||||
"numba-cuda[cu13]>=0.23.0,!=0.27.*,!=0.28.*,!=0.29.*,!=0.30.0"
|
||||
]
|
||||
sysctk12 = [
|
||||
"cuda-cccl[minimal-sysctk12]",
|
||||
# numba-cuda currently expects numba.cuda.types.NPDatetime, removed in numba 0.66.
|
||||
"numba>=0.60.0,<0.66",
|
||||
"numba-cuda[cu12]>=0.23.0,!=0.27.*,!=0.28.*,!=0.29.*,!=0.30.0"
|
||||
]
|
||||
sysctk13 = [
|
||||
"cuda-cccl[minimal-sysctk13]",
|
||||
# numba-cuda currently expects numba.cuda.types.NPDatetime, removed in numba 0.66.
|
||||
"numba>=0.60.0,<0.66",
|
||||
"numba-cuda[cu13]>=0.23.0,!=0.27.*,!=0.28.*,!=0.29.*,!=0.30.0",
|
||||
]
|
||||
# The test extras do not include CuPy. The cuda.compute examples (run via
|
||||
# tests/test_examples.py) require it; install it separately (e.g.
|
||||
# `pip install cupy-cuda13x`).
|
||||
test-cu12 = [
|
||||
# an undocumented way to inherit the dependencies of the cu12 extra.
|
||||
# GH pypa #11296
|
||||
"cuda-cccl[cu12]",
|
||||
"pytest",
|
||||
"pytest-xdist",
|
||||
]
|
||||
test-cu13 = ["cuda-cccl[cu13]", "pytest", "pytest-xdist"]
|
||||
test-sysctk12 = [
|
||||
"cuda-cccl[sysctk12]",
|
||||
"pytest",
|
||||
"pytest-xdist",
|
||||
]
|
||||
test-sysctk13 = [
|
||||
"cuda-cccl[sysctk13]",
|
||||
"pytest",
|
||||
"pytest-xdist",
|
||||
]
|
||||
bench-cu12 = [
|
||||
"cuda-cccl[cu12]",
|
||||
"cuda-bench[cu12]",
|
||||
"cupy-cuda12x",
|
||||
"pytest-benchmark",
|
||||
]
|
||||
bench-cu13 = [
|
||||
"cuda-cccl[cu13]",
|
||||
"cuda-bench[cu13]",
|
||||
"cupy-cuda13x",
|
||||
"pytest-benchmark",
|
||||
]
|
||||
bench-sysctk12 = [
|
||||
"cuda-cccl[sysctk12]",
|
||||
"cuda-bench[cu12]",
|
||||
"cupy-cuda12x",
|
||||
"pytest-benchmark",
|
||||
]
|
||||
bench-sysctk13 = [
|
||||
"cuda-cccl[sysctk13]",
|
||||
"cuda-bench[cu13]",
|
||||
"cupy-cuda13x",
|
||||
"pytest-benchmark",
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
Homepage = "https://github.com/NVIDIA/cccl"
|
||||
Repository = "https://github.com/NVIDIA/cccl"
|
||||
Documentation = "https://nvidia.github.io/cccl"
|
||||
Issues = "https://github.com/NVIDIA/cccl/issues"
|
||||
|
||||
[tool.scikit-build]
|
||||
minimum-version = "build-system.requires"
|
||||
build-dir = "build/{wheel_tag}"
|
||||
|
||||
[tool.scikit-build.cmake]
|
||||
version = ">=3.30"
|
||||
args = []
|
||||
build-type = "Release"
|
||||
source-dir = "."
|
||||
|
||||
[tool.scikit-build.ninja]
|
||||
version = ">=1.11"
|
||||
make-fallback = true
|
||||
|
||||
[tool.scikit-build.metadata.version]
|
||||
provider = "scikit_build_core.metadata.setuptools_scm"
|
||||
|
||||
[tool.setuptools_scm]
|
||||
root = "../.."
|
||||
git_describe_command = ["git", "describe", "--tags", "--match", "v[0-9]*"]
|
||||
|
||||
|
||||
[tool.scikit-build.wheel.packages]
|
||||
"cuda" = "cuda"
|
||||
|
||||
[tool.mypy]
|
||||
cache_dir = "../../.cache/mypy"
|
||||
python_version = "3.10"
|
||||
|
||||
[[tool.mypy.overrides]]
|
||||
module = [
|
||||
# numpy>=2.3 stubs use PEP 695 syntax that mypy can't parse under
|
||||
# python_version=3.10; skip following its imports to keep the 3.10 target.
|
||||
"numpy",
|
||||
"numpy.*",
|
||||
"numba.*",
|
||||
"llvmlite.*",
|
||||
"cuda.cccl.*",
|
||||
"cuda.bindings.*",
|
||||
"cuda.core.*",
|
||||
"cuda.pathfinder.*",
|
||||
]
|
||||
ignore_missing_imports = true
|
||||
follow_imports = "skip"
|
||||
|
||||
[tool.ruff]
|
||||
extend = "../../pyproject.toml"
|
||||
|
||||
[tool.ruff.lint.isort]
|
||||
known-first-party = [
|
||||
"cuda.cccl",
|
||||
"cuda.cccl.headers",
|
||||
"cuda.compute",
|
||||
]
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
# Make shared helpers in tests/_utils importable when pytest runs outside tests/.
|
||||
pythonpath = ["tests"]
|
||||
markers = [
|
||||
"no_verify_sass: skip SASS verification check",
|
||||
"large: tests requiring large device memory allocations",
|
||||
"no_numba: tests that should not import numba or numba.cuda",
|
||||
"free_threading: tests requiring free-threaded CPython with the GIL disabled",
|
||||
"serialization: serialize/deserialize tests (skipped on the v2 HostJIT backend)",
|
||||
]
|
||||
Reference in New Issue
Block a user