Files
project_6/cccl_upstream/cub/cmake/CubHeaderTesting.cmake
EngineX CI 56fd68e7dd [INFRA] Import NVIDIA/CCCL upstream as optimization reference library
CCCL (CUDA C++ Core Libraries) provides:
- CUB: device/block/warp-level GPU primitives (reduce, scan, sort, topk)
- Thrust: high-level parallel algorithms (transform_reduce, sort, scan)
- libcudacxx: CUDA C++ standard library (atomics, barriers, memory)
- cudax: experimental features (memory resources, allocators)
- Tuning policies: per-SM hardware-specific algorithm parameters

Competition optimization vectors mapped to CCCL:
- Output TPS (83% weight): warp_reduce, block_reduce, device_topk
- Input TPS (14% weight): device_scan, block_load, prefetch
- Cache TPS (3% weight): prefix caching strategy patterns
- Memory (0.9 util): pooled/cached/buddy allocators

Source: https://github.com/NVIDIA/cccl (shallow clone, HEAD only)
License: Apache-2.0
2026-07-30 09:35:51 +00:00

55 lines
1.8 KiB
CMake

# 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.
if (NOT CUB_ENABLE_LAUNCH_NO_LAUNCHER)
# Header tests are treated as core-only artifacts.
return()
endif()
function(cub_add_header_test label definitions)
set(headertest_target cub.headers.${label})
cccl_generate_header_tests(${headertest_target} cub GLOBS "cub/*.cuh")
cub_configure_cuda_target(${headertest_target} RDC ${CUB_FORCE_RDC})
target_link_libraries(${headertest_target} PUBLIC cub.compiler_interface)
target_compile_definitions(${headertest_target} PRIVATE ${definitions})
endfunction()
# Wrap Thrust/CUB in a custom namespace to check proper use of ns macros:
set(
header_definitions
"THRUST_WRAPPED_NAMESPACE=wrapped_thrust"
"CUB_WRAPPED_NAMESPACE=wrapped_cub"
)
cub_add_header_test(base "${header_definitions}")
# Check that BF16 support can be disabled
set(
header_definitions
"THRUST_WRAPPED_NAMESPACE=wrapped_thrust"
"CUB_WRAPPED_NAMESPACE=wrapped_cub"
"CCCL_DISABLE_BF16_SUPPORT"
)
cub_add_header_test(no_bf16 "${header_definitions}")
# Check that half support can be disabled
set(
header_definitions
"THRUST_WRAPPED_NAMESPACE=wrapped_thrust"
"CUB_WRAPPED_NAMESPACE=wrapped_cub"
"CCCL_DISABLE_FP16_SUPPORT"
)
cub_add_header_test(no_half "${header_definitions}")
# Check that half support can be disabled
set(
header_definitions
"THRUST_WRAPPED_NAMESPACE=wrapped_thrust"
"CUB_WRAPPED_NAMESPACE=wrapped_cub"
"CCCL_DISABLE_FP8_SUPPORT"
)
cub_add_header_test(no_fp8 "${header_definitions}")