Files
project_6/cccl_upstream/c/parallel.v2/test/CMakeLists.txt
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

70 lines
1.9 KiB
CMake

cccl_get_c2h()
# v2 reuses the same test sources as v1 from c/parallel/test/, compiled with
# CCCL_C_PARALLEL_V2 defined. The shared source files contain a small number
# of #ifdef CCCL_C_PARALLEL_V2 branches that select v2's backend (hostjit
# bitcode vs nvrtc LTO-IR) and skip v1-only test variants.
set(v1_test_dir "${CMAKE_CURRENT_SOURCE_DIR}/../../parallel/test")
function(cccl_c_parallel_v2_add_test target_name_var source)
get_filename_component(target_name "${source}" NAME_WE)
string(
REGEX REPLACE
"test_([^.]*)"
"cccl.c.parallel.v2.test.\\1"
target_name
"${target_name}"
)
set(${target_name_var} ${target_name} PARENT_SCOPE)
add_executable(${target_name} "${source}")
cccl_configure_target(${target_name} DIALECT 20)
set_target_properties(${target_name} PROPERTIES CUDA_RUNTIME_LIBRARY STATIC)
target_link_libraries(
${target_name}
PRIVATE
cccl.compiler_interface
cccl.c.parallel.v2
cccl.c.parallel.v2.hostjit_lib
CUDA::cudart_static
CUDA::nvrtc
cccl.c2h.main
)
target_include_directories(
${target_name}
PRIVATE
"${v1_test_dir}"
"${CMAKE_CURRENT_SOURCE_DIR}/../src/hostjit/include"
)
list(GET CUDAToolkit_INCLUDE_DIRS 0 CUDA_FIRST_INCLUDE_DIR)
target_compile_definitions(
${target_name}
PRIVATE
CCCL_C_PARALLEL_V2=1
TEST_CUB_PATH="-I${CCCL_SOURCE_DIR}/cub"
TEST_THRUST_PATH="-I${CCCL_SOURCE_DIR}/thrust"
TEST_LIBCUDACXX_PATH="-I${CCCL_SOURCE_DIR}/libcudacxx/include"
TEST_CTK_PATH="-I${CUDA_FIRST_INCLUDE_DIR}"
TEST_INCLUDE_PATH="${v1_test_dir}"
)
add_test(NAME ${target_name} COMMAND ${target_name})
endfunction()
file(
GLOB test_srcs
RELATIVE "${v1_test_dir}"
CONFIGURE_DEPENDS
"${v1_test_dir}/*.cu"
"${v1_test_dir}/*.cpp"
)
foreach (test_src IN LISTS test_srcs)
cccl_c_parallel_v2_add_test(test_target "${v1_test_dir}/${test_src}")
endforeach()
add_subdirectory(freestanding)