[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
This commit is contained in:
56
cccl_upstream/c/parallel/test/CMakeLists.txt
Normal file
56
cccl_upstream/c/parallel/test/CMakeLists.txt
Normal file
@@ -0,0 +1,56 @@
|
||||
cccl_get_c2h()
|
||||
|
||||
function(cccl_c_parallel_add_test target_name_var source)
|
||||
get_filename_component(target_name "${source}" NAME_WE)
|
||||
string(
|
||||
REGEX REPLACE
|
||||
"test_([^.]*)"
|
||||
"cccl.c.parallel.test.\\1"
|
||||
target_name
|
||||
"${target_name}"
|
||||
)
|
||||
set(target_name_var ${target_name} PARENT_SCOPE)
|
||||
|
||||
cccl_add_executable(
|
||||
${target_name}
|
||||
ADD_CTEST
|
||||
NO_METATARGETS
|
||||
DIALECT 20
|
||||
SOURCES "${source}"
|
||||
)
|
||||
|
||||
set_target_properties(${target_name} PROPERTIES CUDA_RUNTIME_LIBRARY STATIC)
|
||||
target_link_libraries(
|
||||
${target_name}
|
||||
PRIVATE
|
||||
cccl.compiler_interface
|
||||
cccl.c.parallel
|
||||
CUDA::cudart_static
|
||||
CUDA::nvrtc
|
||||
cccl.c2h.main
|
||||
)
|
||||
|
||||
# Get the first CUDA include directory only
|
||||
list(GET CUDAToolkit_INCLUDE_DIRS 0 CUDA_FIRST_INCLUDE_DIR)
|
||||
target_compile_definitions(
|
||||
${target_name}
|
||||
PRIVATE
|
||||
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="${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
)
|
||||
endfunction()
|
||||
|
||||
file(
|
||||
GLOB test_srcs
|
||||
RELATIVE "${CMAKE_CURRENT_LIST_DIR}"
|
||||
CONFIGURE_DEPENDS
|
||||
*.cu
|
||||
*.cpp
|
||||
)
|
||||
|
||||
foreach (test_src IN LISTS test_srcs)
|
||||
cccl_c_parallel_add_test(test_target "${test_src}")
|
||||
endforeach()
|
||||
Reference in New Issue
Block a user