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
33 lines
1.1 KiB
Plaintext
33 lines
1.1 KiB
Plaintext
// SPDX-FileCopyrightText: Copyright (c) 2011-2023, NVIDIA CORPORATION. All rights reserved.
|
|
// SPDX-License-Identifier: BSD-3
|
|
|
|
// This benchmark is intended to cover redux instructions on Ampere+ architectures. It specifically uses
|
|
// cuda::std::plus<> instead of a user-defined operator, which CUB recognizes to select an optimized code path.
|
|
|
|
// Tuning parameters found for signed integer types apply equally for unsigned integer types
|
|
|
|
#include <nvbench_helper.cuh>
|
|
|
|
// %RANGE% TUNE_ITEMS_PER_THREAD ipt 7:24:1
|
|
// %RANGE% TUNE_THREADS_PER_BLOCK tpb 128:1024:32
|
|
// %RANGE% TUNE_ITEMS_PER_VEC_LOAD_POW2 ipv 1:2:1
|
|
|
|
// __half and __nv_bfloat16 are added for full (non-tuning) runs; CUB has fast paths for them (see #9587).
|
|
#ifdef TUNE_T
|
|
using value_types = nvbench::type_list<TUNE_T>;
|
|
#else
|
|
using value_types =
|
|
push_back_t<all_types
|
|
# if _CCCL_HAS_NVFP16() && _CCCL_CTK_AT_LEAST(12, 2)
|
|
,
|
|
__half
|
|
# endif
|
|
# if _CCCL_HAS_NVBF16() && _CCCL_CTK_AT_LEAST(12, 2)
|
|
,
|
|
__nv_bfloat16
|
|
# endif
|
|
>;
|
|
#endif
|
|
using op_t = ::cuda::std::plus<>;
|
|
#include "base.cuh"
|