Added 863 files from NVIDIA/cccl sparse checkout: - c2h/ (27 files): Catch2 test helpers — generators, validators, runner - nvbench_helper/ (10 files): Benchmark harness utilities - cmake/ (29 files): CMake presets and build helpers - cudax/ (794 files): Experimental CUDA extensions - AGENTS.md: NVIDIA's official AI agent instructions for CCCL - CMakePresets.json: Standardized build configurations - cccl-version.json: Version tracking Also added CCCL_ASSET_MAP.md mapping all 4295 CCCL files to competition value and PRD items. cccl_upstream now covers 100% of competition-critical assets: - 27 tuning headers (SM80/90/100 benchmark data) - 32 dispatch headers (algorithm implementations) - 60 Thrust examples (correctness verification) - 217 CUB Catch2 tests (regression matrix) - 153 CUB benchmarks (parameter space search) - 18 CUB examples (API verification) - 27 test helpers + benchmark harness - 794 cudax experimental extensions
54 lines
1.7 KiB
CMake
54 lines
1.7 KiB
CMake
# Adds an executable target from SOURCES with standard CCCL configuration.
|
|
#
|
|
# By default, metatargets are created (e.g. target name foo.bar.baz will built by metatargets
|
|
# `foo` and `foo.bar`). This can be disabled with NO_METATARGETS. By default, the metatarget
|
|
# path is the same as the target name, but can be overridden with METATARGET_PATH
|
|
#
|
|
# If ADD_CTEST is specified, a CTest test is added with the same name as the target,
|
|
# which runs the executable with no arguments.
|
|
function(cccl_add_executable target_name)
|
|
set(options ADD_CTEST NO_METATARGETS NO_CLANG_TIDY)
|
|
set(oneValueArgs METATARGET_PATH DIALECT)
|
|
set(multiValueArgs SOURCES)
|
|
cmake_parse_arguments(
|
|
_cccl
|
|
"${options}"
|
|
"${oneValueArgs}"
|
|
"${multiValueArgs}"
|
|
${ARGN}
|
|
)
|
|
|
|
if (_cccl_UNPARSED_ARGUMENTS)
|
|
message(FATAL_ERROR "Unrecognized arguments: ${_cccl_UNPARSED_ARGUMENTS}")
|
|
endif()
|
|
|
|
if (NOT DEFINED _cccl_SOURCES)
|
|
message(FATAL_ERROR "cccl_add_executable requires SOURCES argument")
|
|
endif()
|
|
|
|
add_executable(${target_name} ${_cccl_SOURCES})
|
|
|
|
if (_cccl_DIALECT)
|
|
set(configure_args DIALECT "${_cccl_DIALECT}")
|
|
else()
|
|
set(configure_args)
|
|
endif()
|
|
cccl_configure_target(${target_name} ${configure_args})
|
|
|
|
if (_cccl_ADD_CTEST)
|
|
add_test(NAME ${target_name} COMMAND "$<TARGET_FILE:${target_name}>")
|
|
endif()
|
|
|
|
if (NOT _cccl_NO_METATARGETS)
|
|
set(metatarget_path ${target_name})
|
|
if (DEFINED _cccl_METATARGET_PATH)
|
|
set(metatarget_path ${_cccl_METATARGET_PATH})
|
|
endif()
|
|
cccl_ensure_metatargets(${target_name} METATARGET_PATH ${metatarget_path})
|
|
endif()
|
|
|
|
if (NOT _cccl_NO_CLANG_TIDY)
|
|
cccl_tidy_add_target(SOURCES ${_cccl_SOURCES})
|
|
endif()
|
|
endfunction()
|