[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:
muh-bot
2026-08-03 12:39:26 +00:00
parent a2a5dd8f00
commit 24ef6a91b5
5439 changed files with 0 additions and 719516 deletions

View File

@@ -1,109 +0,0 @@
# For every public header, build a translation unit containing `#include <header>`
# to let the compiler try to figure out warnings in that header if it is not otherwise
# included in tests, and also to verify if the headers are modular enough.
# .inl files are not globbed for, because they are not supposed to be used as public
# entrypoints.
cccl_get_cudatoolkit()
# Meta target for all configs' header builds:
add_custom_target(cudax.all.headers)
function(cudax_add_header_test label definitions)
###################
# Non-STF headers #
set(headertest_target cudax.headers.${label}.no_stf)
cccl_generate_header_tests(
${headertest_target}
cudax/include
# The cudax header template removes the check for the `small` macro.
HEADER_TEMPLATE "${cudax_SOURCE_DIR}/cmake/header_test.in.cu"
GLOBS "cuda/experimental/*.cuh"
EXCLUDES
# The following internal headers are not required to compile independently:
"cuda/experimental/__execution/prologue.cuh"
"cuda/experimental/__execution/epilogue.cuh"
# cuFile headers are compiled separately:
"cuda/experimental/cufile.cuh"
"cuda/experimental/__cufile/*"
# Places headers are compiled separately:
"cuda/experimental/places.cuh"
"cuda/experimental/__places/*"
# STF headers are compiled separately:
"cuda/experimental/stf.cuh"
"cuda/experimental/__stf/*"
)
target_link_libraries(${headertest_target} PUBLIC cudax.compiler_interface)
if (cudax_ENABLE_CUFILE)
###############
# cuFile headers #
set(headertest_target cudax.headers.${label}.cufile)
cccl_generate_header_tests(
${headertest_target}
cudax/include
HEADER_TEMPLATE "${cudax_SOURCE_DIR}/cmake/header_test.in.cu"
GLOBS #
"cuda/experimental/cufile.cuh"
"cuda/experimental/__cufile/*.cuh"
)
target_link_libraries(${headertest_target} PUBLIC cudax.compiler_interface)
endif()
# FIXME: Enable MSVC
if (cudax_ENABLE_PLACES AND NOT "MSVC" STREQUAL "${CMAKE_CXX_COMPILER_ID}")
##################
# Places headers #
set(headertest_target cudax.headers.${label}.places)
cccl_generate_header_tests(
${headertest_target}
cudax/include
GLOBS #
"cuda/experimental/places.cuh"
"cuda/experimental/__places/*.cuh"
HEADER_TEMPLATE "${cudax_SOURCE_DIR}/cmake/header_test.in.cu"
)
target_link_libraries(${headertest_target} PUBLIC cudax.compiler_interface)
target_compile_options(
${headertest_target}
PRIVATE
$<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:--extended-lambda>
$<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:--expt-relaxed-constexpr>
)
endif()
# FIXME: Enable MSVC
if (cudax_ENABLE_CUDASTF AND NOT "MSVC" STREQUAL "${CMAKE_CXX_COMPILER_ID}")
###############
# STF headers #
set(headertest_target cudax.headers.${label}.stf)
cccl_generate_header_tests(
${headertest_target}
cudax/include
GLOBS #
"cuda/experimental/stf.cuh"
"cuda/experimental/__stf/*.cuh"
# FIXME: The cudax header template removes the check for the `small` macro.
# cuda/experimental/__stf/utility/memory.cuh defines functions named `small`.
# These should be renamed to avoid conflicts with windows system headers, and
# the following line removed:
HEADER_TEMPLATE "${cudax_SOURCE_DIR}/cmake/header_test.in.cu"
)
target_link_libraries(
${headertest_target}
PUBLIC cudax.compiler_interface CUDA::cuda_driver
)
target_compile_options(
${headertest_target}
PRIVATE
# Required by stf headers:
$<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:--extended-lambda>
# FIXME: We should be able to refactor away from needing this by
# using _CCCL_HOST_DEVICE and friends + `::cuda::std` utilities where
# necessary.
$<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:--expt-relaxed-constexpr>
)
endif()
endfunction()
cudax_add_header_test(basic "")