Files
project_6/cccl_upstream/cub/benchmarks/bench/scan/exclusive/sum.lookahead.cu
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

45 lines
1.8 KiB
Plaintext

// SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// This tunes the lookahead implementation of scan, which is only available on SM100+. It has entirely different tuning
// parameters and is agnostic of the offset type. It is thus in a separate file, so we can continue to tune the old scan
// implementation on older hardware architectures.
#include <cuda/__cccl_config>
#if _CCCL_PP_COUNT(__CUDA_ARCH_LIST__) != 1
# warning "This benchmark does not support being compiled for multiple architectures. Disabling it."
#else // _CCCL_PP_COUNT(__CUDA_ARCH_LIST__) != 1
# if __CUDA_ARCH_LIST__ < 1000
// We don't care if clang-tidy can't parse this
# ifndef _CCCL_CLANG_TIDY_INVOKED
# warning "Lookahead scan requires at least sm_100. Disabling it."
# endif // !defined _CCCL_CLANG_TIDY_INVOKED
# else // __CUDA_ARCH_LIST__ < 1000
# if __cccl_ptx_isa < 860
# warning "Lookahead scan requires at least PTX ISA 8.6. Disabling it."
# else // if __cccl_ptx_isa < 860
# include <nvbench_helper.cuh>
// %RANGE% TUNE_NUM_REDUCE_SCAN_WARPS wrps 1:8:1
// %RANGE% TUNE_NUM_LOOKBACK_ITEMS lbi 1:8:1
// TODO(bgruber): find a good range and step width, items per thread should be coprime with 32 to avoid SMEM conflicts.
// Should we specify nominal items per thread instead?
// %RANGE% TUNE_ITEMS_PLUS_ONE ipt 8:256:8
// %RANGE% TUNE_LOOKBACK_STAGES lbs -2:2:1
// %RANGE% TUNE_BLOCK_IDX_STAGES bis -2:2:1
# define USES_LOOKAHEAD() 1
using op_t = ::cuda::std::plus<>;
using scan_offset_types = nvbench::type_list<int64_t>;
# include "base.cuh"
# endif // __cccl_ptx_isa < 860
# endif // __CUDA_ARCH_LIST__ < 1000
#endif // _CCCL_PP_COUNT(__CUDA_ARCH_LIST__) != 1