[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
This commit is contained in:
EngineX CI
2026-07-30 09:35:51 +00:00
parent b4d01f481e
commit 56fd68e7dd
8871 changed files with 1454674 additions and 0 deletions

View File

@@ -0,0 +1,119 @@
//===----------------------------------------------------------------------===//
//
// Part of CUDA Experimental in CUDA C++ Core Libraries,
// under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES.
//
//===----------------------------------------------------------------------===//
#ifndef __CUDAX_DETAIL_TYPE_TRAITS_CUH
#define __CUDAX_DETAIL_TYPE_TRAITS_CUH
#include <cuda/std/detail/__config>
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
# pragma GCC system_header
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
# pragma clang system_header
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
# pragma system_header
#endif // no system header
#include <cuda/std/__cccl/unreachable.h>
#include <cuda/std/__concepts/concept_macros.h>
#include <cuda/std/__type_traits/decay.h>
#include <cuda/std/__type_traits/enable_if.h>
#include <cuda/std/__type_traits/integral_constant.h>
#include <cuda/std/__type_traits/is_callable.h>
#include <cuda/std/__type_traits/is_constructible.h>
#include <cuda/std/__type_traits/is_copy_constructible.h>
#include <cuda/std/__type_traits/is_move_constructible.h>
#include <cuda/std/__type_traits/is_nothrow_constructible.h>
#include <cuda/std/__type_traits/is_nothrow_copy_constructible.h>
#include <cuda/std/__type_traits/is_nothrow_move_constructible.h>
#include <cuda/std/__type_traits/is_same.h>
#include <cuda/std/__type_traits/is_valid_expansion.h>
#include <cuda/std/__utility/declval.h>
#include <cuda/std/__cccl/prologue.h>
namespace cuda::experimental
{
using ::cuda::std::__declfn_t;
using ::cuda::std::decay_t;
template <class _Ty, bool _Nothrow = true>
[[noreturn]] _CCCL_HOST_DEVICE_API auto __declfn() noexcept(_Nothrow) -> _Ty
{
_CCCL_ASSERT(false, "__declfn should never be called at runtime.");
_CCCL_UNREACHABLE();
}
template <class _Ty, class _Uy>
_CCCL_CONCEPT __same_as = ::cuda::std::_IsSame<_Ty, _Uy>::value;
template <class _Ty, class _Uy>
_CCCL_CONCEPT __not_same_as = !::cuda::std::_IsSame<_Ty, _Uy>::value;
template <class _Ty, class... _Us>
_CCCL_CONCEPT __one_of = (__same_as<_Ty, _Us> || ...);
template <class _Ty, class... _Us>
_CCCL_CONCEPT __none_of = (__not_same_as<_Ty, _Us> && ...);
#if _CCCL_HAS_CONCEPTS()
template <template <class...> class _Fn, class... _Ts>
_CCCL_CONCEPT __is_instantiable_with = requires { typename _Fn<_Ts...>; };
template <class _Fn, class... _As>
_CCCL_CONCEPT __callable = requires(__declfn_t<_Fn> __fn, __declfn_t<_As>... __as) { __fn()(__as()...); };
#else // ^^^ _CCCL_HAS_CONCEPTS() ^^^ / vvv !_CCCL_HAS_CONCEPTS() vvv
template <template <class...> class _Fn, class... _Ts>
_CCCL_CONCEPT __is_instantiable_with = ::cuda::std::_IsValidExpansion<_Fn, _Ts...>::value;
template <class _Fn, class... _As>
_CCCL_CONCEPT __callable = ::cuda::std::__is_callable_v<_Fn, _As...>;
#endif // !_CCCL_HAS_CONCEPTS()
template <class _Fn, class... _As>
_CCCL_CONCEPT __constructible = ::cuda::std::is_constructible_v<_Fn, _As...>;
template <class... _As>
_CCCL_CONCEPT __decay_copyable = (::cuda::std::is_constructible_v<decay_t<_As>, _As> && ...);
template <class... _As>
_CCCL_CONCEPT __movable = (::cuda::std::is_move_constructible_v<_As> && ...);
template <class... _As>
_CCCL_CONCEPT __copyable = (::cuda::std::is_copy_constructible_v<_As> && ...);
template <class _Fn, class... _As>
_CCCL_CONCEPT __nothrow_callable = ::cuda::std::__is_nothrow_callable_v<_Fn, _As...>;
template <class _Ty, class... _As>
_CCCL_CONCEPT __nothrow_constructible = ::cuda::std::is_nothrow_constructible_v<_Ty, _As...>;
template <class... _As>
_CCCL_CONCEPT __nothrow_decay_copyable = (::cuda::std::is_nothrow_constructible_v<decay_t<_As>, _As> && ...);
template <class... _As>
_CCCL_CONCEPT __nothrow_movable = (::cuda::std::is_nothrow_move_constructible_v<_As> && ...);
template <class... _As>
_CCCL_CONCEPT __nothrow_copyable = (::cuda::std::is_nothrow_copy_constructible_v<_As> && ...);
template <class... _As>
using __nothrow_decay_copyable_t _CCCL_NODEBUG_ALIAS = ::cuda::std::bool_constant<__nothrow_decay_copyable<_As...>>;
using ::cuda::std::__call_result_t;
} // namespace cuda::experimental
#include <cuda/std/__cccl/epilogue.h>
#endif // __CUDAX_DETAIL_TYPE_TRAITS_CUH

View File

@@ -0,0 +1,54 @@
//===----------------------------------------------------------------------===//
//
// Part of CUDA Experimental in CUDA C++ Core Libraries,
// under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES.
//
//===----------------------------------------------------------------------===//
#ifndef __CUDAX_DETAIL_UTILITY_H
#define __CUDAX_DETAIL_UTILITY_H
#include <cuda/std/detail/__config>
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
# pragma GCC system_header
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
# pragma clang system_header
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
# pragma system_header
#endif // no system header
#include <cuda/std/__type_traits/is_callable.h>
#include <cuda/std/__type_traits/type_list.h>
#include <cuda/std/__utility/declval.h>
#include <cuda/std/__utility/move.h>
#include <cuda/experimental/__detail/type_traits.cuh>
#include <cuda/std/__cccl/prologue.h>
namespace cuda::experimental
{
// NOLINTBEGIN(misc-unused-using-decls)
using ::cuda::std::declval;
// NOLINTEND(misc-unused-using-decls)
struct _CCCL_TYPE_VISIBILITY_DEFAULT no_init_t
{
_CCCL_HIDE_FROM_ABI explicit no_init_t() = default;
};
_CCCL_GLOBAL_CONSTANT no_init_t no_init{};
using uninit_t CCCL_DEPRECATED_BECAUSE("Use cuda::experimental::no_init_t instead") = no_init_t;
// TODO: CCCL_DEPRECATED_BECAUSE("Use cuda::experimental::no_init instead")
_CCCL_GLOBAL_CONSTANT no_init_t uninit{};
} // namespace cuda::experimental
#include <cuda/std/__cccl/epilogue.h>
#endif // __CUDAX_DETAIL_UTILITY_H