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
35 lines
1.1 KiB
Plaintext
35 lines
1.1 KiB
Plaintext
// SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. All rights reserved.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
// This is a compile-only test that checks whether cub can handle a future (unknown) architecture. Currently, works only
|
|
// with nvcc.
|
|
|
|
#if defined(__NVCC__) && __CUDACC_VER_MAJOR__ >= 13
|
|
# define TEST_CUDA_ARCH 9900
|
|
|
|
// Replace __CUDA_ARCH__ only in device code.
|
|
# if defined(__CUDA_ARCH__)
|
|
# undef __CUDA_ARCH__
|
|
# define __CUDA_ARCH__ TEST_CUDA_ARCH
|
|
# endif // __CUDA_ARCH__
|
|
|
|
// __CUDA_ARCH_LIST__ is defined in both host and device code.
|
|
# undef __CUDA_ARCH_LIST__
|
|
# define __CUDA_ARCH_LIST__ TEST_CUDA_ARCH
|
|
|
|
// We need to undefine the include guard before including <cuda_runtime.h>. It was defined by us in CMake.
|
|
# undef __CUDA_RUNTIME_H__
|
|
# include <cuda_runtime.h>
|
|
#endif // __NVCC__ && is at least 13.0
|
|
|
|
#include <cub/device/device_reduce.cuh>
|
|
|
|
#include <cuda/std/cstddef>
|
|
|
|
cudaError_t compile_only_fn(void* tmp_storage, cuda::std::size_t tmp_storage_size, int* in, int* out, int nitems)
|
|
{
|
|
return cub::DeviceReduce::Sum(tmp_storage, tmp_storage_size, in, out, nitems);
|
|
}
|
|
|
|
int main() {}
|