[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:
85
cccl_upstream/libcudacxx/include/cuda/std/cmath
Normal file
85
cccl_upstream/libcudacxx/include/cuda/std/cmath
Normal file
@@ -0,0 +1,85 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the CUDA Toolkit, 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) 2023 NVIDIA CORPORATION & AFFILIATES.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef _CUDA_STD_CMATH
|
||||
#define _CUDA_STD_CMATH
|
||||
|
||||
#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/__host_stdlib/math.h>
|
||||
|
||||
#if _CCCL_COMPILER(NVHPC)
|
||||
# include <cmath>
|
||||
#endif // _CCCL_COMPILER(NVHPC)
|
||||
|
||||
#include <cuda/std/__cmath/abs.h>
|
||||
#include <cuda/std/__cmath/copysign.h>
|
||||
#include <cuda/std/__cmath/error_functions.h>
|
||||
#include <cuda/std/__cmath/exponential_functions.h>
|
||||
#include <cuda/std/__cmath/fdim.h>
|
||||
#include <cuda/std/__cmath/fma.h>
|
||||
#include <cuda/std/__cmath/fpclassify.h>
|
||||
#include <cuda/std/__cmath/gamma.h>
|
||||
#include <cuda/std/__cmath/hyperbolic_functions.h>
|
||||
#include <cuda/std/__cmath/hypot.h>
|
||||
#include <cuda/std/__cmath/inverse_hyperbolic_functions.h>
|
||||
#include <cuda/std/__cmath/inverse_trigonometric_functions.h>
|
||||
#include <cuda/std/__cmath/isfinite.h>
|
||||
#include <cuda/std/__cmath/isinf.h>
|
||||
#include <cuda/std/__cmath/isnan.h>
|
||||
#include <cuda/std/__cmath/isnormal.h>
|
||||
#include <cuda/std/__cmath/lerp.h>
|
||||
#include <cuda/std/__cmath/logarithms.h>
|
||||
#include <cuda/std/__cmath/min_max.h>
|
||||
#include <cuda/std/__cmath/modulo.h>
|
||||
#include <cuda/std/__cmath/nan.h>
|
||||
#include <cuda/std/__cmath/remainder.h>
|
||||
#include <cuda/std/__cmath/roots.h>
|
||||
#include <cuda/std/__cmath/rounding_functions.h>
|
||||
#include <cuda/std/__cmath/signbit.h>
|
||||
#include <cuda/std/__cmath/traits.h>
|
||||
#include <cuda/std/__cmath/trigonometric_functions.h>
|
||||
#include <cuda/std/__cstdlib/abs.h>
|
||||
#include <cuda/std/limits>
|
||||
#include <cuda/std/version>
|
||||
|
||||
#if _CCCL_FREESTANDING()
|
||||
# define INFINITY ::cuda::std::numeric_limits<float>::infinity()
|
||||
# define NAN ::cuda::std::numeric_limits<float>::quiet_NaN()
|
||||
#endif // _CCCL_FREESTANDING()
|
||||
|
||||
#include <cuda/std/__cccl/prologue.h>
|
||||
|
||||
_CCCL_BEGIN_NAMESPACE_CUDA_STD
|
||||
|
||||
#if _CCCL_FREESTANDING()
|
||||
|
||||
using double_t = double;
|
||||
using float_t = float;
|
||||
|
||||
#else // ^^^ _CCCL_FREESTANDING() ^^^ / vvv _CCCL_HOSTED() vvv
|
||||
|
||||
using ::double_t;
|
||||
using ::float_t;
|
||||
|
||||
#endif // _CCCL_HOSTED()
|
||||
|
||||
_CCCL_END_NAMESPACE_CUDA_STD
|
||||
|
||||
#include <cuda/std/__cccl/epilogue.h>
|
||||
|
||||
#endif // _CUDA_STD_CMATH
|
||||
Reference in New Issue
Block a user