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
56 lines
1.4 KiB
CMake
56 lines
1.4 KiB
CMake
if (NOT CCCL_ENABLE_CUB)
|
|
include(cmake/CubAddSubdir.cmake)
|
|
return()
|
|
endif()
|
|
|
|
cmake_minimum_required(VERSION 3.21)
|
|
project(CUB LANGUAGES CXX CUDA)
|
|
|
|
option(CUB_ENABLE_HEADER_TESTING "Test that all public headers compile." ON)
|
|
option(CUB_ENABLE_TESTING "Build CUB testing suite." ON)
|
|
option(CUB_ENABLE_EXAMPLES "Build CUB examples." ON)
|
|
|
|
option(
|
|
CCCL_ENABLE_EXPERIMENTAL_TILE_TRANSFORM_DISPATCH
|
|
"EXPERIMENTAL: build cub::DeviceTransform's tile path (requires nvcc --enable-tile). This flag is experimental and may change or be removed."
|
|
OFF
|
|
)
|
|
if (
|
|
CCCL_ENABLE_EXPERIMENTAL_TILE_TRANSFORM_DISPATCH
|
|
AND "${CMAKE_CUDA_COMPILER_ID}" STREQUAL "NVIDIA"
|
|
AND "${CMAKE_CUDA_COMPILER_VERSION}" VERSION_LESS 13.4
|
|
)
|
|
message(
|
|
FATAL_ERROR
|
|
"CCCL_ENABLE_EXPERIMENTAL_TILE_TRANSFORM_DISPATCH requires CUDA 13.4+ (nvcc --enable-tile). "
|
|
"Found ${CMAKE_CUDA_COMPILER_VERSION}."
|
|
)
|
|
endif()
|
|
|
|
option(CUB_ENABLE_TUNING "Build CUB tuning suite." OFF)
|
|
if ("NVHPC" STREQUAL "${CMAKE_CXX_COMPILER_ID}")
|
|
set(CUB_ENABLE_TUNING OFF)
|
|
endif()
|
|
|
|
include(cmake/CubBuildCompilerTargets.cmake)
|
|
include(cmake/CubCudaConfig.cmake)
|
|
include(cmake/CubUtilities.cmake)
|
|
|
|
cub_build_compiler_targets()
|
|
|
|
if (CUB_ENABLE_HEADER_TESTING)
|
|
include(cmake/CubHeaderTesting.cmake)
|
|
endif()
|
|
|
|
if (CUB_ENABLE_TESTING)
|
|
add_subdirectory(test)
|
|
endif()
|
|
|
|
if (CUB_ENABLE_EXAMPLES)
|
|
add_subdirectory(examples)
|
|
endif()
|
|
|
|
if (CCCL_ENABLE_BENCHMARKS OR CUB_ENABLE_TUNING)
|
|
add_subdirectory(benchmarks)
|
|
endif()
|