[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,136 +0,0 @@
set(
places_test_sources
include_only.cu
data_place_alloc.cu
data_place_vmm.cu
exec_place_scope.cu
placement.cu
stream_pool.cu
)
set(places_fail_tests exec_place_scope_data_place_fail.cu)
set(
places_unittested_headers
cuda/experimental/__places/cute_partition.cuh
cuda/experimental/__places/places.cuh
cuda/experimental/__places/exec/cuda_context.cuh
cuda/experimental/__places/exec/green_context.cuh
cuda/experimental/__places/partitions/blocked_partition.cuh
cuda/experimental/__places/partitions/cyclic_shape.cuh
cuda/experimental/__places/partitions/tiled_partition.cuh
)
cccl_get_cudatoolkit()
## cudax_add_places_test
#
# Add a places test executable and register it with ctest.
#
# target_name_var: Variable name to overwrite with the name of the test
# target. Useful for adding target information after creation.
# source: The source file for the test.
#
function(cudax_add_places_test target_name_var source)
get_filename_component(dir ${source} DIRECTORY)
get_filename_component(filename ${source} NAME_WE)
if (dir)
set(filename "${dir}/${filename}")
endif()
string(REPLACE "/" "." test_name "${filename}")
set(test_target cudax.test.places.${test_name})
cccl_add_executable(${test_target} SOURCES ${source} ADD_CTEST)
cudax_places_configure_target(${test_target})
target_link_libraries(${test_target} PRIVATE cudax.compiler_interface)
set(${target_name_var} ${test_target} PARENT_SCOPE)
endfunction()
## cudax_add_places_unittest_header
#
# Add a places unittested header executable and register it with ctest.
#
# Unittested headers contain a set of tests that are enabled by including
# `unittest.cuh` and defining `UNITTESTED_FILE`.
#
# target_name_var: Variable name to overwrite with the name of the test
# target. Useful for adding target information after creation.
# source: The source file for the test.
#
function(cudax_add_places_unittest_header target_name_var source)
get_filename_component(relative_path ${source} DIRECTORY)
get_filename_component(filename ${source} NAME_WE)
string(
REPLACE
"cuda/experimental/"
""
test_label
"${relative_path}/${filename}"
)
string(REPLACE "/" "." test_label "${test_label}")
set(test_target "cudax.test.places.unittest_headers.${test_label}")
get_filename_component(
source_full_path
../../../cudax/include/${source}
ABSOLUTE
)
set(source ${source_full_path})
set(ut_template "${cudax_SOURCE_DIR}/cmake/places_header_unittest.in.cu")
set(ut_source "${cudax_BINARY_DIR}/unittest_headers/${test_target}.cu")
configure_file(${ut_template} ${ut_source} @ONLY)
cccl_add_executable(${test_target} SOURCES ${ut_source} ADD_CTEST)
cudax_places_configure_target(${test_target})
target_link_libraries(${test_target} PRIVATE cudax.compiler_interface)
set(${target_name_var} ${test_target} PARENT_SCOPE)
endfunction()
# Basic tests:
foreach (source IN LISTS places_test_sources)
cudax_add_places_test(test_target "${source}")
endforeach()
# Unittested headers
foreach (source IN LISTS places_unittested_headers)
cudax_add_places_unittest_header(test_target "${source}")
endforeach()
## cudax_add_places_fail_test
#
# Adds an EXCLUDE_FROM_ALL build target for `source` and a ctest that
# verifies compilation fails with errors matching expected-error annotations
# in the source file.
#
function(cudax_add_places_fail_test target_name_var source)
get_filename_component(filename ${source} NAME_WE)
set(test_target cudax.test.places.error.${filename})
cccl_add_executable(
${test_target}
SOURCES ${source}
NO_METATARGETS
NO_CLANG_TIDY
)
cudax_places_configure_target(${test_target})
target_link_libraries(${test_target} PRIVATE cudax.compiler_interface)
cccl_add_xfail_compile_target_test(
${test_target}
SOURCE_FILE "${source}"
ERROR_REGEX_LABEL "expected-error"
)
set(${target_name_var} ${test_target} PARENT_SCOPE)
endfunction()
# Expected-failure compile tests (_fail.cu convention)
foreach (source IN LISTS places_fail_tests)
cudax_add_places_fail_test(test_target "${source}")
endforeach()