Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- cuda_toolkit/include/cuda/std/array +21 -0
- cuda_toolkit/include/cuda/std/atomic +22 -0
- cuda_toolkit/include/cuda/std/barrier +26 -0
- cuda_toolkit/include/cuda/std/bit +22 -0
- cuda_toolkit/include/cuda/std/cassert +22 -0
- cuda_toolkit/include/cuda/std/ccomplex +15 -0
- cuda_toolkit/include/cuda/std/cfloat +22 -0
- cuda_toolkit/include/cuda/std/chrono +22 -0
- cuda_toolkit/include/cuda/std/climits +22 -0
- cuda_toolkit/include/cuda/std/cmath +21 -0
- cuda_toolkit/include/cuda/std/complex +21 -0
- cuda_toolkit/include/cuda/std/concepts +21 -0
- cuda_toolkit/include/cuda/std/cstddef +22 -0
- cuda_toolkit/include/cuda/std/cstdint +22 -0
- cuda_toolkit/include/cuda/std/ctime +22 -0
- cuda_toolkit/include/cuda/std/detail/__access_property +327 -0
- cuda_toolkit/include/cuda/std/detail/__annotated_ptr +231 -0
- cuda_toolkit/include/cuda/std/detail/__config +41 -0
- cuda_toolkit/include/cuda/std/detail/__pragma_pop +12 -0
- cuda_toolkit/include/cuda/std/detail/__pragma_push +13 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__algorithm/swap_ranges.h +40 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__assert +70 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__availability +306 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__bit_reference +1293 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__bsd_locale_defaults.h +40 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__bsd_locale_fallbacks.h +143 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__cccl/ptx_isa.h +105 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__cccl/version.h +23 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__cccl/visibility.h +46 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__cccl_config +194 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/_One_of.h +41 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/__concept_macros.h +299 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/arithmetic.h +61 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/assignable.h +64 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/boolean_testable.h +63 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/class_or_enum.h +47 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/common_reference_with.h +74 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/common_with.h +102 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/constructible.h +125 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/convertible_to.h +78 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/copyable.h +64 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/derived_from.h +58 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/destructible.h +78 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/different_from.h +40 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/equality_comparable.h +111 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/invocable.h +80 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/movable.h +62 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/predicate.h +56 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/regular.h +57 -0
- cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/relation.h +78 -0
cuda_toolkit/include/cuda/std/array
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of the CUDA Toolkit, under the Apache License v2.0 with LLVM Exceptions.
|
| 4 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 5 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 6 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
|
| 10 |
+
#ifndef _CUDA_STD_ARRAY
|
| 11 |
+
#define _CUDA_STD_ARRAY
|
| 12 |
+
|
| 13 |
+
#include "detail/__config"
|
| 14 |
+
|
| 15 |
+
#include "detail/__pragma_push"
|
| 16 |
+
|
| 17 |
+
#include "detail/libcxx/include/array"
|
| 18 |
+
|
| 19 |
+
#include "detail/__pragma_pop"
|
| 20 |
+
|
| 21 |
+
#endif // _CUDA_STD_ARRAY
|
cuda_toolkit/include/cuda/std/atomic
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of libcu++, the C++ Standard Library for your entire system,
|
| 4 |
+
// under the Apache License v2.0 with LLVM Exceptions.
|
| 5 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 6 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 7 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 8 |
+
//
|
| 9 |
+
//===----------------------------------------------------------------------===//
|
| 10 |
+
|
| 11 |
+
#ifndef _CUDA_STD_ATOMIC
|
| 12 |
+
#define _CUDA_STD_ATOMIC
|
| 13 |
+
|
| 14 |
+
#include "detail/__config"
|
| 15 |
+
|
| 16 |
+
#include "detail/__pragma_push"
|
| 17 |
+
|
| 18 |
+
#include "detail/libcxx/include/atomic"
|
| 19 |
+
|
| 20 |
+
#include "detail/__pragma_pop"
|
| 21 |
+
|
| 22 |
+
#endif // _CUDA_STD_ATOMIC
|
cuda_toolkit/include/cuda/std/barrier
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of libcu++, the C++ Standard Library for your entire system,
|
| 4 |
+
// under the Apache License v2.0 with LLVM Exceptions.
|
| 5 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 6 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 7 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 8 |
+
//
|
| 9 |
+
//===----------------------------------------------------------------------===//
|
| 10 |
+
|
| 11 |
+
#ifndef _CUDA_STD_BARRIER
|
| 12 |
+
#define _CUDA_STD_BARRIER
|
| 13 |
+
|
| 14 |
+
#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ < 700
|
| 15 |
+
# error "CUDA synchronization primitives are only supported for sm_70 and up."
|
| 16 |
+
#endif
|
| 17 |
+
|
| 18 |
+
#include "detail/__config"
|
| 19 |
+
|
| 20 |
+
#include "detail/__pragma_push"
|
| 21 |
+
|
| 22 |
+
#include "detail/libcxx/include/barrier"
|
| 23 |
+
|
| 24 |
+
#include "detail/__pragma_pop"
|
| 25 |
+
|
| 26 |
+
#endif // _CUDA_STD_BARRIER
|
cuda_toolkit/include/cuda/std/bit
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of libcu++, the C++ Standard Library for your entire system,
|
| 4 |
+
// under the Apache License v2.0 with LLVM Exceptions.
|
| 5 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 6 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 7 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 8 |
+
//
|
| 9 |
+
//===----------------------------------------------------------------------===//
|
| 10 |
+
|
| 11 |
+
#ifndef _CUDA_STD_BIT
|
| 12 |
+
#define _CUDA_STD_BIT
|
| 13 |
+
|
| 14 |
+
#include "detail/__config"
|
| 15 |
+
|
| 16 |
+
#include "detail/__pragma_push"
|
| 17 |
+
|
| 18 |
+
#include "detail/libcxx/include/bit"
|
| 19 |
+
|
| 20 |
+
#include "detail/__pragma_pop"
|
| 21 |
+
|
| 22 |
+
#endif // _CUDA_STD_BIT
|
cuda_toolkit/include/cuda/std/cassert
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of libcu++, the C++ Standard Library for your entire system,
|
| 4 |
+
// under the Apache License v2.0 with LLVM Exceptions.
|
| 5 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 6 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 7 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 8 |
+
//
|
| 9 |
+
//===----------------------------------------------------------------------===//
|
| 10 |
+
|
| 11 |
+
#ifndef _CUDA_STD_CASSERT
|
| 12 |
+
#define _CUDA_STD_CASSERT
|
| 13 |
+
|
| 14 |
+
#include "detail/__config"
|
| 15 |
+
|
| 16 |
+
#include "detail/__pragma_push"
|
| 17 |
+
|
| 18 |
+
#include "detail/libcxx/include/cassert"
|
| 19 |
+
|
| 20 |
+
#include "detail/__pragma_pop"
|
| 21 |
+
|
| 22 |
+
#endif // _CUDA_STD_CASSERT
|
cuda_toolkit/include/cuda/std/ccomplex
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of the CUDA Toolkit, under the Apache License v2.0 with LLVM Exceptions.
|
| 4 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 5 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 6 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
|
| 10 |
+
#ifndef _CUDA_STD_CCOMPLEX
|
| 11 |
+
#define _CUDA_STD_CCOMPLEX
|
| 12 |
+
|
| 13 |
+
#include "complex"
|
| 14 |
+
|
| 15 |
+
#endif // _CUDA_STD_CCOMPLEX
|
cuda_toolkit/include/cuda/std/cfloat
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of libcu++, the C++ Standard Library for your entire system,
|
| 4 |
+
// under the Apache License v2.0 with LLVM Exceptions.
|
| 5 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 6 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 7 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 8 |
+
//
|
| 9 |
+
//===----------------------------------------------------------------------===//
|
| 10 |
+
|
| 11 |
+
#ifndef _CUDA_STD_CFLOAT
|
| 12 |
+
#define _CUDA_STD_CFLOAT
|
| 13 |
+
|
| 14 |
+
#include "detail/__config"
|
| 15 |
+
|
| 16 |
+
#include "detail/__pragma_push"
|
| 17 |
+
|
| 18 |
+
#include "detail/libcxx/include/cfloat"
|
| 19 |
+
|
| 20 |
+
#include "detail/__pragma_pop"
|
| 21 |
+
|
| 22 |
+
#endif // _CUDA_STD_CFLOAT
|
cuda_toolkit/include/cuda/std/chrono
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of libcu++, the C++ Standard Library for your entire system,
|
| 4 |
+
// under the Apache License v2.0 with LLVM Exceptions.
|
| 5 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 6 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 7 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 8 |
+
//
|
| 9 |
+
//===----------------------------------------------------------------------===//
|
| 10 |
+
|
| 11 |
+
#ifndef _CUDA_STD_CHRONO
|
| 12 |
+
#define _CUDA_STD_CHRONO
|
| 13 |
+
|
| 14 |
+
#include "detail/__config"
|
| 15 |
+
|
| 16 |
+
#include "detail/__pragma_push"
|
| 17 |
+
|
| 18 |
+
#include "detail/libcxx/include/chrono"
|
| 19 |
+
|
| 20 |
+
#include "detail/__pragma_pop"
|
| 21 |
+
|
| 22 |
+
#endif // _CUDA_STD_CHRONO
|
cuda_toolkit/include/cuda/std/climits
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of libcu++, the C++ Standard Library for your entire system,
|
| 4 |
+
// under the Apache License v2.0 with LLVM Exceptions.
|
| 5 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 6 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 7 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 8 |
+
//
|
| 9 |
+
//===----------------------------------------------------------------------===//
|
| 10 |
+
|
| 11 |
+
#ifndef _CUDA_STD_CLIMITS
|
| 12 |
+
#define _CUDA_STD_CLIMITS
|
| 13 |
+
|
| 14 |
+
#include "detail/__config"
|
| 15 |
+
|
| 16 |
+
#include "detail/__pragma_push"
|
| 17 |
+
|
| 18 |
+
#include "detail/libcxx/include/climits"
|
| 19 |
+
|
| 20 |
+
#include "detail/__pragma_pop"
|
| 21 |
+
|
| 22 |
+
#endif // _CUDA_STD_CLIMITS
|
cuda_toolkit/include/cuda/std/cmath
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of the CUDA Toolkit, under the Apache License v2.0 with LLVM Exceptions.
|
| 4 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 5 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 6 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
|
| 10 |
+
#ifndef _CUDA_STD_CMATH
|
| 11 |
+
#define _CUDA_STD_CMATH
|
| 12 |
+
|
| 13 |
+
#include "detail/__config"
|
| 14 |
+
|
| 15 |
+
#include "detail/__pragma_push"
|
| 16 |
+
|
| 17 |
+
#include "detail/libcxx/include/cmath"
|
| 18 |
+
|
| 19 |
+
#include "detail/__pragma_pop"
|
| 20 |
+
|
| 21 |
+
#endif // _CUDA_STD_CMATH
|
cuda_toolkit/include/cuda/std/complex
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of the CUDA Toolkit, under the Apache License v2.0 with LLVM Exceptions.
|
| 4 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 5 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 6 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
|
| 10 |
+
#ifndef _CUDA_STD_COMPLEX
|
| 11 |
+
#define _CUDA_STD_COMPLEX
|
| 12 |
+
|
| 13 |
+
#include "detail/__config"
|
| 14 |
+
|
| 15 |
+
#include "detail/__pragma_push"
|
| 16 |
+
|
| 17 |
+
#include "detail/libcxx/include/complex"
|
| 18 |
+
|
| 19 |
+
#include "detail/__pragma_pop"
|
| 20 |
+
|
| 21 |
+
#endif // _CUDA_STD_COMPLEX
|
cuda_toolkit/include/cuda/std/concepts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of the CUDA Toolkit, under the Apache License v2.0 with LLVM Exceptions.
|
| 4 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 5 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 6 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
|
| 10 |
+
#ifndef _CUDA_STD_CONCEPTS
|
| 11 |
+
#define _CUDA_STD_CONCEPTS
|
| 12 |
+
|
| 13 |
+
#include "detail/__config"
|
| 14 |
+
|
| 15 |
+
#include "detail/__pragma_push"
|
| 16 |
+
|
| 17 |
+
#include "detail/libcxx/include/concepts"
|
| 18 |
+
|
| 19 |
+
#include "detail/__pragma_pop"
|
| 20 |
+
|
| 21 |
+
#endif // _CUDA_STD_CONCEPTS
|
cuda_toolkit/include/cuda/std/cstddef
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of libcu++, the C++ Standard Library for your entire system,
|
| 4 |
+
// under the Apache License v2.0 with LLVM Exceptions.
|
| 5 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 6 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 7 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 8 |
+
//
|
| 9 |
+
//===----------------------------------------------------------------------===//
|
| 10 |
+
|
| 11 |
+
#ifndef _CUDA_STD_CSTDDEF
|
| 12 |
+
#define _CUDA_STD_CSTDDEF
|
| 13 |
+
|
| 14 |
+
#include "detail/__config"
|
| 15 |
+
|
| 16 |
+
#include "detail/__pragma_push"
|
| 17 |
+
|
| 18 |
+
#include "detail/libcxx/include/cstddef"
|
| 19 |
+
|
| 20 |
+
#include "detail/__pragma_pop"
|
| 21 |
+
|
| 22 |
+
#endif // _CUDA_STD_CSTDDEF
|
cuda_toolkit/include/cuda/std/cstdint
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of libcu++, the C++ Standard Library for your entire system,
|
| 4 |
+
// under the Apache License v2.0 with LLVM Exceptions.
|
| 5 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 6 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 7 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 8 |
+
//
|
| 9 |
+
//===----------------------------------------------------------------------===//
|
| 10 |
+
|
| 11 |
+
#ifndef _CUDA_STD_CSTDINT
|
| 12 |
+
#define _CUDA_STD_CSTDINT
|
| 13 |
+
|
| 14 |
+
#include "detail/__config"
|
| 15 |
+
|
| 16 |
+
#include "detail/__pragma_push"
|
| 17 |
+
|
| 18 |
+
#include "detail/libcxx/include/cstdint"
|
| 19 |
+
|
| 20 |
+
#include "detail/__pragma_pop"
|
| 21 |
+
|
| 22 |
+
#endif // _CUDA_STD_CSTDINT
|
cuda_toolkit/include/cuda/std/ctime
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of libcu++, the C++ Standard Library for your entire system,
|
| 4 |
+
// under the Apache License v2.0 with LLVM Exceptions.
|
| 5 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 6 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 7 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 8 |
+
//
|
| 9 |
+
//===----------------------------------------------------------------------===//
|
| 10 |
+
|
| 11 |
+
#ifndef _CUDA_STD_CTIME
|
| 12 |
+
#define _CUDA_STD_CTIME
|
| 13 |
+
|
| 14 |
+
#include "detail/__config"
|
| 15 |
+
|
| 16 |
+
#include "detail/__pragma_push"
|
| 17 |
+
|
| 18 |
+
#include "detail/libcxx/include/ctime"
|
| 19 |
+
|
| 20 |
+
#include "detail/__pragma_pop"
|
| 21 |
+
|
| 22 |
+
#endif // _CUDA_STD_CTIME
|
cuda_toolkit/include/cuda/std/detail/__access_property
ADDED
|
@@ -0,0 +1,327 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* SPDX-FileCopyrightText: Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NVIDIA SOFTWARE LICENSE
|
| 5 |
+
*
|
| 6 |
+
* This license is a legal agreement between you and NVIDIA Corporation ("NVIDIA") and governs your use of the NVIDIA/CUDA C++ Library software and materials provided hereunder (“SOFTWARE”).
|
| 7 |
+
*
|
| 8 |
+
* This license can be accepted only by an adult of legal age of majority in the country in which the SOFTWARE is used. If you are under the legal age of majority, you must ask your parent or legal guardian to consent to this license. By taking delivery of the SOFTWARE, you affirm that you have reached the legal age of majority, you accept the terms of this license, and you take legal and financial responsibility for the actions of your permitted users.
|
| 9 |
+
*
|
| 10 |
+
* You agree to use the SOFTWARE only for purposes that are permitted by (a) this license, and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions.
|
| 11 |
+
*
|
| 12 |
+
* 1. LICENSE. Subject to the terms of this license, NVIDIA grants you a non-exclusive limited license to: (a) install and use the SOFTWARE, and (b) distribute the SOFTWARE subject to the distribution requirements described in this license. NVIDIA reserves all rights, title and interest in and to the SOFTWARE not expressly granted to you under this license.
|
| 13 |
+
*
|
| 14 |
+
* 2. DISTRIBUTION REQUIREMENTS. These are the distribution requirements for you to exercise the distribution grant:
|
| 15 |
+
* a. The terms under which you distribute the SOFTWARE must be consistent with the terms of this license, including (without limitation) terms relating to the license grant and license restrictions and protection of NVIDIA’s intellectual property rights.
|
| 16 |
+
* b. You agree to notify NVIDIA in writing of any known or suspected distribution or use of the SOFTWARE not in compliance with the requirements of this license, and to enforce the terms of your agreements with respect to distributed SOFTWARE.
|
| 17 |
+
*
|
| 18 |
+
* 3. LIMITATIONS. Your license to use the SOFTWARE is restricted as follows:
|
| 19 |
+
* a. The SOFTWARE is licensed for you to develop applications only for use in systems with NVIDIA GPUs.
|
| 20 |
+
* b. You may not reverse engineer, decompile or disassemble, or remove copyright or other proprietary notices from any portion of the SOFTWARE or copies of the SOFTWARE.
|
| 21 |
+
* c. You may not modify or create derivative works of any portion of the SOFTWARE.
|
| 22 |
+
* d. You may not bypass, disable, or circumvent any technical measure, encryption, security, digital rights management or authentication mechanism in the SOFTWARE.
|
| 23 |
+
* e. You may not use the SOFTWARE in any manner that would cause it to become subject to an open source software license. As examples, licenses that require as a condition of use, modification, and/or distribution that the SOFTWARE be (i) disclosed or distributed in source code form; (ii) licensed for the purpose of making derivative works; or (iii) redistributable at no charge.
|
| 24 |
+
* f. Unless you have an agreement with NVIDIA for this purpose, you may not use the SOFTWARE with any system or application where the use or failure of the system or application can reasonably be expected to threaten or result in personal injury, death, or catastrophic loss. Examples include use in avionics, navigation, military, medical, life support or other life critical applications. NVIDIA does not design, test or manufacture the SOFTWARE for these critical uses and NVIDIA shall not be liable to you or any third party, in whole or in part, for any claims or damages arising from such uses.
|
| 25 |
+
* g. You agree to defend, indemnify and hold harmless NVIDIA and its affiliates, and their respective employees, contractors, agents, officers and directors, from and against any and all claims, damages, obligations, losses, liabilities, costs or debt, fines, restitutions and expenses (including but not limited to attorney’s fees and costs incident to establishing the right of indemnification) arising out of or related to use of the SOFTWARE outside of the scope of this Agreement, or not in compliance with its terms.
|
| 26 |
+
*
|
| 27 |
+
* 4. PRE-RELEASE. SOFTWARE versions identified as alpha, beta, preview, early access or otherwise as pre-release may not be fully functional, may contain errors or design flaws, and may have reduced or different security, privacy, availability, and reliability standards relative to commercial versions of NVIDIA software and materials. You may use a pre-release SOFTWARE version at your own risk, understanding that these versions are not intended for use in production or business-critical systems.
|
| 28 |
+
*
|
| 29 |
+
* 5. OWNERSHIP. The SOFTWARE and the related intellectual property rights therein are and will remain the sole and exclusive property of NVIDIA or its licensors. The SOFTWARE is copyrighted and protected by the laws of the United States and other countries, and international treaty provisions. NVIDIA may make changes to the SOFTWARE, at any time without notice, but is not obligated to support or update the SOFTWARE.
|
| 30 |
+
*
|
| 31 |
+
* 6. COMPONENTS UNDER OTHER LICENSES. The SOFTWARE may include NVIDIA or third-party components with separate legal notices or terms as may be described in proprietary notices accompanying the SOFTWARE. If and to the extent there is a conflict between the terms in this license and the license terms associated with a component, the license terms associated with the components control only to the extent necessary to resolve the conflict.
|
| 32 |
+
*
|
| 33 |
+
* 7. FEEDBACK. You may, but don’t have to, provide to NVIDIA any Feedback. “Feedback” means any suggestions, bug fixes, enhancements, modifications, feature requests or other feedback regarding the SOFTWARE. For any Feedback that you voluntarily provide, you hereby grant NVIDIA and its affiliates a perpetual, non-exclusive, worldwide, irrevocable license to use, reproduce, modify, license, sublicense (through multiple tiers of sublicensees), and distribute (through multiple tiers of distributors) the Feedback without the payment of any royalties or fees to you. NVIDIA will use Feedback at its choice.
|
| 34 |
+
*
|
| 35 |
+
* 8. NO WARRANTIES. THE SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY EXPRESS OR IMPLIED WARRANTY OF ANY KIND INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, OR FITNESS FOR A PARTICULAR PURPOSE. NVIDIA DOES NOT WARRANT THAT THE SOFTWARE WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION THEREOF WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT ALL ERRORS WILL BE CORRECTED.
|
| 36 |
+
*
|
| 37 |
+
* 9. LIMITATIONS OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY LAW, NVIDIA AND ITS AFFILIATES SHALL NOT BE LIABLE FOR ANY SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, OR ANY LOST PROFITS, PROJECT DELAYS, LOSS OF USE, LOSS OF DATA OR LOSS OF GOODWILL, OR THE COSTS OF PROCURING SUBSTITUTE PRODUCTS, ARISING OUT OF OR IN CONNECTION WITH THIS LICENSE OR THE USE OR PERFORMANCE OF THE SOFTWARE, WHETHER SUCH LIABILITY ARISES FROM ANY CLAIM BASED UPON BREACH OF CONTRACT, BREACH OF WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCT LIABILITY OR ANY OTHER CAUSE OF ACTION OR THEORY OF LIABILITY, EVEN IF NVIDIA HAS PREVIOUSLY BEEN ADVISED OF, OR COULD REASONABLY HAVE FORESEEN, THE POSSIBILITY OF SUCH DAMAGES. IN NO EVENT WILL NVIDIA’S AND ITS AFFILIATES TOTAL CUMULATIVE LIABILITY UNDER OR ARISING OUT OF THIS LICENSE EXCEED US$10.00. THE NATURE OF THE LIABILITY OR THE NUMBER OF CLAIMS OR SUITS SHALL NOT ENLARGE OR EXTEND THIS LIMIT.
|
| 38 |
+
*
|
| 39 |
+
* 10. TERMINATION. Your rights under this license will terminate automatically without notice from NVIDIA if you fail to comply with any term and condition of this license or if you commence or participate in any legal proceeding against NVIDIA with respect to the SOFTWARE. NVIDIA may terminate this license with advance written notice to you if NVIDIA decides to no longer provide the SOFTWARE in a country or, in NVIDIA’s sole discretion, the continued use of it is no longer commercially viable. Upon any termination of this license, you agree to promptly discontinue use of the SOFTWARE and destroy all copies in your possession or control. Your prior distributions in accordance with this license are not affected by the termination of this license. All provisions of this license will survive termination, except for the license granted to you.
|
| 40 |
+
*
|
| 41 |
+
* 11. APPLICABLE LAW. This license will be governed in all respects by the laws of the United States and of the State of Delaware as those laws are applied to contracts entered into and performed entirely within Delaware by Delaware residents, without regard to the conflicts of laws principles. The United Nations Convention on Contracts for the International Sale of Goods is specifically disclaimed. You agree to all terms of this Agreement in the English language. The state or federal courts residing in Santa Clara County, California shall have exclusive jurisdiction over any dispute or claim arising out of this license. Notwithstanding this, you agree that NVIDIA shall still be allowed to apply for injunctive remedies or an equivalent type of urgent legal relief in any jurisdiction.
|
| 42 |
+
*
|
| 43 |
+
* 12. NO ASSIGNMENT. This license and your rights and obligations thereunder may not be assigned by you by any means or operation of law without NVIDIA’s permission. Any attempted assignment not approved by NVIDIA in writing shall be void and of no effect.
|
| 44 |
+
*
|
| 45 |
+
* 13. EXPORT. The SOFTWARE is subject to United States export laws and regulations. You agree that you will not ship, transfer or export the SOFTWARE into any country, or use the SOFTWARE in any manner, prohibited by the United States Bureau of Industry and Security or economic sanctions regulations administered by the U.S. Department of Treasury’s Office of Foreign Assets Control (OFAC), or any applicable export laws, restrictions or regulations. These laws include restrictions on destinations, end users and end use. By accepting this license, you confirm that you are not a resident or citizen of any country currently embargoed by the U.S. and that you are not otherwise prohibited from receiving the SOFTWARE.
|
| 46 |
+
*
|
| 47 |
+
* 14. GOVERNMENT USE. The SOFTWARE has been developed entirely at private expense and is “commercial items” consisting of “commercial computer software” and “commercial computer software documentation” provided with RESTRICTED RIGHTS. Use, duplication or disclosure by the U.S. Government or a U.S. Government subcontractor is subject to the restrictions in this license pursuant to DFARS 227.7202-3(a) or as set forth in subparagraphs (b)(1) and (2) of the Commercial Computer Software - Restricted Rights clause at FAR 52.227-19, as applicable. Contractor/manufacturer is NVIDIA, 2788 San Tomas Expressway, Santa Clara, CA 95051.
|
| 48 |
+
*
|
| 49 |
+
* 15. ENTIRE AGREEMENT. This license is the final, complete and exclusive agreement between the parties relating to the subject matter of this license and supersedes all prior or contemporaneous understandings and agreements relating to this subject matter, whether oral or written. If any court of competent jurisdiction determines that any provision of this license is illegal, invalid or unenforceable, the remaining provisions will remain in full force and effect. This license may only be modified in a writing signed by an authorized representative of each party.
|
| 50 |
+
*
|
| 51 |
+
* (v. August 20, 2021)
|
| 52 |
+
*/
|
| 53 |
+
|
| 54 |
+
_LIBCUDACXX_BEGIN_NAMESPACE_CUDA
|
| 55 |
+
|
| 56 |
+
namespace __detail_ap {
|
| 57 |
+
|
| 58 |
+
_LIBCUDACXX_HOST_DEVICE
|
| 59 |
+
constexpr uint32_t __ap_floor_log2(uint32_t __x) {
|
| 60 |
+
return (__x == 1 | __x == 0) ? 0 : 1 + __ap_floor_log2(__x >> 1);
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
_LIBCUDACXX_HOST_DEVICE
|
| 64 |
+
constexpr uint32_t __ap_ceil_log2(uint32_t __x) {
|
| 65 |
+
return (__x == 1 | __x == 0) ? 0 : __ap_floor_log2(__x - 1) + 1;
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
_LIBCUDACXX_HOST_DEVICE
|
| 69 |
+
constexpr uint32_t __ap_min(uint32_t __a, uint32_t __b) noexcept {
|
| 70 |
+
return (__a < __b) ? __a : __b;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
_LIBCUDACXX_HOST_DEVICE
|
| 74 |
+
constexpr uint32_t __ap_max(uint32_t __a, uint32_t __b) noexcept {
|
| 75 |
+
return (__a > __b) ? __a : __b;
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61414
|
| 79 |
+
// Specifically search for 8.4 and 9.3 and above to guarantee uint64_t enum.
|
| 80 |
+
#if defined(_LIBCUDACXX_COMPILER_GCC) && ( \
|
| 81 |
+
((_GNUC_VER < 804)) || \
|
| 82 |
+
((_GNUC_VER < 903)) \
|
| 83 |
+
)
|
| 84 |
+
# define _LIBCUDACXX_AP_ENUM_TYPE_ANNOTATION
|
| 85 |
+
#else
|
| 86 |
+
# define _LIBCUDACXX_AP_ENUM_TYPE_ANNOTATION : uint64_t
|
| 87 |
+
#endif
|
| 88 |
+
|
| 89 |
+
namespace __sm_80 {
|
| 90 |
+
namespace __off {
|
| 91 |
+
enum __l2_cop_off_t _LIBCUDACXX_AP_ENUM_TYPE_ANNOTATION {
|
| 92 |
+
_L2_EVICT_NORMAL = 0,
|
| 93 |
+
_L2_EVICT_FIRST = 1,
|
| 94 |
+
};
|
| 95 |
+
} // namespace __off
|
| 96 |
+
|
| 97 |
+
namespace __on {
|
| 98 |
+
enum __l2_cop_on_t _LIBCUDACXX_AP_ENUM_TYPE_ANNOTATION {
|
| 99 |
+
_L2_EVICT_NORMAL = 0,
|
| 100 |
+
_L2_EVICT_FIRST = 1,
|
| 101 |
+
_L2_EVICT_LAST = 2,
|
| 102 |
+
_L2_EVICT_NORMAL_DEMOTE = 3,
|
| 103 |
+
};
|
| 104 |
+
} // namespace __on
|
| 105 |
+
|
| 106 |
+
enum __l2_descriptor_mode_t _LIBCUDACXX_AP_ENUM_TYPE_ANNOTATION {
|
| 107 |
+
_DESC_IMPLICIT = 0,
|
| 108 |
+
_DESC_INTERLEAVED = 2,
|
| 109 |
+
_DESC_BLOCK_TYPE = 3,
|
| 110 |
+
};
|
| 111 |
+
|
| 112 |
+
enum __l2_eviction_max_way_t _LIBCUDACXX_AP_ENUM_TYPE_ANNOTATION {
|
| 113 |
+
_CUDA_AMPERE_MAX_L2_WAYS = std::uint32_t{16},
|
| 114 |
+
};
|
| 115 |
+
|
| 116 |
+
enum __block_size_t _LIBCUDACXX_AP_ENUM_TYPE_ANNOTATION {
|
| 117 |
+
_BLOCKSIZE_4K = 0,
|
| 118 |
+
_BLOCKSIZE_8K = 1,
|
| 119 |
+
_BLOCKSIZE_16K = 2,
|
| 120 |
+
_BLOCKSIZE_32K = 3,
|
| 121 |
+
_BLOCKSIZE_64K = 4,
|
| 122 |
+
_BLOCKSIZE_128K = 5,
|
| 123 |
+
_BLOCKSIZE_256K = 6,
|
| 124 |
+
_BLOCKSIZE_512K = 7,
|
| 125 |
+
_BLOCKSIZE_1M = 8,
|
| 126 |
+
_BLOCKSIZE_2M = 9,
|
| 127 |
+
_BLOCKSIZE_4M = 10,
|
| 128 |
+
_BLOCKSIZE_8M = 11,
|
| 129 |
+
_BLOCKSIZE_16M = 12,
|
| 130 |
+
_BLOCKSIZE_32M = 13,
|
| 131 |
+
};
|
| 132 |
+
|
| 133 |
+
struct __block_desc_t {
|
| 134 |
+
uint64_t __ap_reserved : 37;
|
| 135 |
+
uint64_t __block_count: 7;
|
| 136 |
+
uint64_t __block_start: 7;
|
| 137 |
+
uint64_t __ap_reserved2 : 1;
|
| 138 |
+
__block_size_t __block_size : 4;
|
| 139 |
+
__off::__l2_cop_off_t __l2_cop_off : 1;
|
| 140 |
+
__on::__l2_cop_on_t __l2_cop_on : 2;
|
| 141 |
+
__l2_descriptor_mode_t __l2_descriptor_mode : 2;
|
| 142 |
+
uint64_t __l1_inv_dont_allocate : 1;
|
| 143 |
+
uint64_t __l2_sector_promote_256B : 1;
|
| 144 |
+
uint64_t __ap_reserved3 : 1;
|
| 145 |
+
|
| 146 |
+
_LIBCUDACXX_HOST_DEVICE
|
| 147 |
+
constexpr std::uint64_t __get_descriptor_cexpr() const noexcept {
|
| 148 |
+
return
|
| 149 |
+
std::uint64_t(__ap_reserved) << 0 |
|
| 150 |
+
std::uint64_t(__block_count) << 37 |
|
| 151 |
+
std::uint64_t(__block_start) << 44 |
|
| 152 |
+
std::uint64_t(__ap_reserved2) << 51 |
|
| 153 |
+
std::uint64_t(__block_size) << 52 |
|
| 154 |
+
std::uint64_t(__l2_cop_off) << 56 |
|
| 155 |
+
std::uint64_t(__l2_cop_on) << 57 |
|
| 156 |
+
std::uint64_t(__l2_descriptor_mode) << 59 |
|
| 157 |
+
std::uint64_t(__l1_inv_dont_allocate) << 61 |
|
| 158 |
+
std::uint64_t(__l2_sector_promote_256B) << 62 |
|
| 159 |
+
std::uint64_t(__ap_reserved3) << 63;
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
inline
|
| 163 |
+
_LIBCUDACXX_HOST_DEVICE
|
| 164 |
+
std::uint64_t __get_descriptor_non_cexpr() const noexcept { return *reinterpret_cast<const std::uint64_t*>(this); }
|
| 165 |
+
|
| 166 |
+
_LIBCUDACXX_HOST_DEVICE
|
| 167 |
+
constexpr std::uint64_t __get_descriptor() const noexcept {
|
| 168 |
+
#if defined(_LIBCUDACXX_IS_CONSTANT_EVALUATED)
|
| 169 |
+
return cuda::std::is_constant_evaluated() ?
|
| 170 |
+
__get_descriptor_cexpr() :
|
| 171 |
+
__get_descriptor_non_cexpr();
|
| 172 |
+
#else
|
| 173 |
+
return __get_descriptor_cexpr();
|
| 174 |
+
#endif
|
| 175 |
+
}
|
| 176 |
+
};
|
| 177 |
+
static_assert(sizeof(__block_desc_t) == 8, "__block_desc_t should be 8 bytes");
|
| 178 |
+
static_assert(sizeof(__block_desc_t) == sizeof(std::uint64_t), "");
|
| 179 |
+
static_assert(
|
| 180 |
+
__block_desc_t{(uint64_t)1, (uint64_t)1, (uint64_t)1, (uint64_t)1, __block_size_t::_BLOCKSIZE_8K, __off::_L2_EVICT_FIRST, __on::_L2_EVICT_FIRST, __l2_descriptor_mode_t::_DESC_INTERLEAVED, (uint64_t)1, (uint64_t)1, (uint64_t)1}.__get_descriptor()
|
| 181 |
+
== 0xF318102000000001, "");
|
| 182 |
+
|
| 183 |
+
/* Factory like struct to build a __block_desc_t due to constexpr C++11
|
| 184 |
+
*/
|
| 185 |
+
struct __block_descriptor_builder { //variable declaration order matters == usage order
|
| 186 |
+
std::uint32_t __offset;
|
| 187 |
+
__block_size_t __block_size;
|
| 188 |
+
std::uint32_t __block_start, __end_hit;
|
| 189 |
+
std::uint32_t __block_count;
|
| 190 |
+
__off::__l2_cop_off_t __l2_cop_off;
|
| 191 |
+
__on::__l2_cop_on_t __l2_cop_on;
|
| 192 |
+
__l2_descriptor_mode_t __l2_descriptor_mode;
|
| 193 |
+
bool __l1_inv_dont_allocate, __l2_sector_promote_256B;
|
| 194 |
+
|
| 195 |
+
_LIBCUDACXX_HOST_DEVICE static constexpr std::uint32_t __calc_offset(std::size_t __total_bytes) {
|
| 196 |
+
return __ap_max(std::uint32_t{12}, static_cast<std::uint32_t>(__ap_ceil_log2(static_cast<uint32_t>(__total_bytes))) - std::uint32_t{7});
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
_LIBCUDACXX_HOST_DEVICE static constexpr std::uint32_t __calc_block_start(std::uintptr_t __ptr, std::size_t __total_bytes) {
|
| 200 |
+
return static_cast<uint32_t>(__ptr >> __calc_offset(static_cast<uint32_t>(__total_bytes)));
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
_LIBCUDACXX_HOST_DEVICE static constexpr std::uint32_t __calc_end_hit(std::uintptr_t __ptr, std::size_t __hit_bytes, std::size_t __total_bytes) {
|
| 204 |
+
return static_cast<uint32_t>((__ptr + __hit_bytes + (std::uintptr_t{1} << (__calc_offset(static_cast<uint32_t>(__total_bytes)))) - 1) >> __calc_offset(static_cast<uint32_t>(__total_bytes)));
|
| 205 |
+
}
|
| 206 |
+
|
| 207 |
+
_LIBCUDACXX_HOST_DEVICE constexpr __block_descriptor_builder(std::uintptr_t __ptr, std::size_t __hit_bytes, std::size_t __total_bytes, __on::__l2_cop_on_t __hit_prop, __off::__l2_cop_off_t __miss_prop)
|
| 208 |
+
: __offset(__calc_offset(__total_bytes))
|
| 209 |
+
, __block_size(static_cast<__block_size_t>(__calc_offset(__total_bytes) - std::uint32_t{12}))
|
| 210 |
+
, __block_start(__calc_block_start(__ptr, __total_bytes))
|
| 211 |
+
, __end_hit(__calc_end_hit(__ptr, __hit_bytes, __total_bytes))
|
| 212 |
+
, __block_count(__calc_end_hit(__ptr, __hit_bytes, __total_bytes) - __calc_block_start(__ptr, __total_bytes))
|
| 213 |
+
, __l2_cop_off(__miss_prop)
|
| 214 |
+
, __l2_cop_on(__hit_prop)
|
| 215 |
+
, __l2_descriptor_mode(_DESC_BLOCK_TYPE)
|
| 216 |
+
, __l1_inv_dont_allocate(false)
|
| 217 |
+
, __l2_sector_promote_256B(false)
|
| 218 |
+
{}
|
| 219 |
+
|
| 220 |
+
_LIBCUDACXX_HOST_DEVICE
|
| 221 |
+
constexpr __block_desc_t __get_block() const noexcept {
|
| 222 |
+
return __block_desc_t { 0, __ap_min(std::uint32_t{0x7f}, __block_count), (__block_start & std::uint32_t{0x7f}), 0, __block_size, __l2_cop_off, __l2_cop_on, _DESC_BLOCK_TYPE, false, false, 0 };
|
| 223 |
+
}
|
| 224 |
+
};
|
| 225 |
+
static_assert(sizeof(std::uintptr_t) > 4, "std::uintptr_t needs at least 5 bytes for this code to work");
|
| 226 |
+
|
| 227 |
+
struct __interleave_descriptor_t {
|
| 228 |
+
uint64_t __ap_reserved : 52;
|
| 229 |
+
uint64_t __fraction : 4;
|
| 230 |
+
__off::__l2_cop_off_t __l2_cop_off : 1;
|
| 231 |
+
__on::__l2_cop_on_t __l2_cop_on : 2;
|
| 232 |
+
__l2_descriptor_mode_t __l2_descriptor_mode : 2;
|
| 233 |
+
uint64_t __l1_inv_dont_allocate : 1;
|
| 234 |
+
uint64_t __l2_sector_promote_256B : 1;
|
| 235 |
+
uint64_t __ap_reserved2 : 1;
|
| 236 |
+
|
| 237 |
+
_LIBCUDACXX_HOST_DEVICE
|
| 238 |
+
constexpr __interleave_descriptor_t(
|
| 239 |
+
__on::__l2_cop_on_t __hit_prop,
|
| 240 |
+
std::uint32_t __hit_ratio,
|
| 241 |
+
__off::__l2_cop_off_t __miss_prop) noexcept
|
| 242 |
+
: __fraction(__hit_ratio),
|
| 243 |
+
__l2_cop_off(__miss_prop),
|
| 244 |
+
__l2_cop_on(__hit_prop),
|
| 245 |
+
__l2_descriptor_mode(_DESC_INTERLEAVED),
|
| 246 |
+
__l1_inv_dont_allocate(0x0),
|
| 247 |
+
__l2_sector_promote_256B(0x0),
|
| 248 |
+
__ap_reserved(0x0),
|
| 249 |
+
__ap_reserved2(0x0) {}
|
| 250 |
+
|
| 251 |
+
_LIBCUDACXX_HOST_DEVICE
|
| 252 |
+
constexpr std::uint64_t __get_descriptor_cexpr() const {
|
| 253 |
+
return
|
| 254 |
+
std::uint64_t(__ap_reserved) << 0 |
|
| 255 |
+
std::uint64_t(__fraction) << 52 |
|
| 256 |
+
std::uint64_t(__l2_cop_off) << 56 |
|
| 257 |
+
std::uint64_t(__l2_cop_on) << 57 |
|
| 258 |
+
std::uint64_t(__l2_descriptor_mode) << 59 |
|
| 259 |
+
std::uint64_t(__l1_inv_dont_allocate) << 61 |
|
| 260 |
+
std::uint64_t(__l2_sector_promote_256B) << 62 |
|
| 261 |
+
std::uint64_t(__ap_reserved2) << 63;
|
| 262 |
+
}
|
| 263 |
+
|
| 264 |
+
inline
|
| 265 |
+
_LIBCUDACXX_HOST_DEVICE
|
| 266 |
+
std::uint64_t __get_descriptor_non_cexpr() const noexcept { return *reinterpret_cast<const std::uint64_t*>(this); }
|
| 267 |
+
|
| 268 |
+
|
| 269 |
+
_LIBCUDACXX_HOST_DEVICE
|
| 270 |
+
constexpr std::uint64_t __get_descriptor() const noexcept {
|
| 271 |
+
#if defined(_LIBCUDACXX_IS_CONSTANT_EVALUATED)
|
| 272 |
+
return cuda::std::is_constant_evaluated() ?
|
| 273 |
+
__get_descriptor_cexpr() :
|
| 274 |
+
__get_descriptor_non_cexpr();
|
| 275 |
+
#else
|
| 276 |
+
return __get_descriptor_cexpr();
|
| 277 |
+
#endif
|
| 278 |
+
}
|
| 279 |
+
};
|
| 280 |
+
static_assert(sizeof(__interleave_descriptor_t) == 8, "__interleave_descriptor_t should be 8 bytes");
|
| 281 |
+
static_assert(sizeof(__interleave_descriptor_t) == sizeof(std::uint64_t), "");
|
| 282 |
+
|
| 283 |
+
_LIBCUDACXX_HOST_DEVICE
|
| 284 |
+
static constexpr std::uint64_t __interleave_normal() noexcept {
|
| 285 |
+
return 0x10F0000000000000;
|
| 286 |
+
}
|
| 287 |
+
|
| 288 |
+
_LIBCUDACXX_HOST_DEVICE
|
| 289 |
+
static constexpr std::uint64_t __interleave_streaming() noexcept {
|
| 290 |
+
return 0x12F0000000000000;
|
| 291 |
+
}
|
| 292 |
+
|
| 293 |
+
_LIBCUDACXX_HOST_DEVICE
|
| 294 |
+
static constexpr std::uint64_t __interleave_persisting() noexcept {
|
| 295 |
+
return 0x14F0000000000000;
|
| 296 |
+
}
|
| 297 |
+
|
| 298 |
+
_LIBCUDACXX_HOST_DEVICE
|
| 299 |
+
static constexpr std::uint64_t __interleave_normal_demote() noexcept {
|
| 300 |
+
return 0x16F0000000000000;
|
| 301 |
+
}
|
| 302 |
+
|
| 303 |
+
} // namespace __sm_80
|
| 304 |
+
|
| 305 |
+
_LIBCUDACXX_HOST_DEVICE
|
| 306 |
+
constexpr std::uint64_t __interleave(cudaAccessProperty __hit_prop, float __hit_ratio, cudaAccessProperty __miss_prop = cudaAccessPropertyNormal) {
|
| 307 |
+
return __sm_80::__interleave_descriptor_t(
|
| 308 |
+
((__hit_prop == cudaAccessPropertyNormal) ? __sm_80::__on::__l2_cop_on_t::_L2_EVICT_NORMAL_DEMOTE : static_cast<__sm_80::__on::__l2_cop_on_t>(__hit_prop)),
|
| 309 |
+
__ap_min((static_cast<std::uint32_t>(__hit_ratio) * __sm_80::__l2_eviction_max_way_t::_CUDA_AMPERE_MAX_L2_WAYS), static_cast<std::uint32_t>(__sm_80::__l2_eviction_max_way_t::_CUDA_AMPERE_MAX_L2_WAYS - 1)),
|
| 310 |
+
static_cast<__sm_80::__off::__l2_cop_off_t>(__miss_prop)
|
| 311 |
+
).__get_descriptor();
|
| 312 |
+
}
|
| 313 |
+
|
| 314 |
+
_LIBCUDACXX_HOST_DEVICE
|
| 315 |
+
constexpr std::uint64_t __block(void* __ptr, std::size_t __hit_bytes, std::size_t __total_bytes, cudaAccessProperty __hit_prop, cudaAccessProperty __miss_prop = cudaAccessPropertyNormal) {
|
| 316 |
+
return (__total_bytes <= (size_t{0xFFFFFFFF}) & __total_bytes != 0 & __hit_bytes <= __total_bytes) ? __sm_80::__block_descriptor_builder(
|
| 317 |
+
reinterpret_cast<std::uintptr_t>(__ptr),
|
| 318 |
+
__hit_bytes,
|
| 319 |
+
__total_bytes,
|
| 320 |
+
(__hit_prop == cudaAccessPropertyNormal) ? __sm_80::__on::_L2_EVICT_NORMAL_DEMOTE : static_cast<__sm_80::__on::__l2_cop_on_t>(__hit_prop),
|
| 321 |
+
static_cast<__sm_80::__off::__l2_cop_off_t>(__miss_prop)
|
| 322 |
+
).__get_block().__get_descriptor()
|
| 323 |
+
: __sm_80::__interleave_normal();
|
| 324 |
+
}
|
| 325 |
+
} // namespace __detail_ap
|
| 326 |
+
|
| 327 |
+
_LIBCUDACXX_END_NAMESPACE_CUDA
|
cuda_toolkit/include/cuda/std/detail/__annotated_ptr
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* SPDX-FileCopyrightText: Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NVIDIA SOFTWARE LICENSE
|
| 5 |
+
*
|
| 6 |
+
* This license is a legal agreement between you and NVIDIA Corporation ("NVIDIA") and governs your use of the NVIDIA/CUDA C++ Library software and materials provided hereunder (“SOFTWARE”).
|
| 7 |
+
*
|
| 8 |
+
* This license can be accepted only by an adult of legal age of majority in the country in which the SOFTWARE is used. If you are under the legal age of majority, you must ask your parent or legal guardian to consent to this license. By taking delivery of the SOFTWARE, you affirm that you have reached the legal age of majority, you accept the terms of this license, and you take legal and financial responsibility for the actions of your permitted users.
|
| 9 |
+
*
|
| 10 |
+
* You agree to use the SOFTWARE only for purposes that are permitted by (a) this license, and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions.
|
| 11 |
+
*
|
| 12 |
+
* 1. LICENSE. Subject to the terms of this license, NVIDIA grants you a non-exclusive limited license to: (a) install and use the SOFTWARE, and (b) distribute the SOFTWARE subject to the distribution requirements described in this license. NVIDIA reserves all rights, title and interest in and to the SOFTWARE not expressly granted to you under this license.
|
| 13 |
+
*
|
| 14 |
+
* 2. DISTRIBUTION REQUIREMENTS. These are the distribution requirements for you to exercise the distribution grant:
|
| 15 |
+
* a. The terms under which you distribute the SOFTWARE must be consistent with the terms of this license, including (without limitation) terms relating to the license grant and license restrictions and protection of NVIDIA’s intellectual property rights.
|
| 16 |
+
* b. You agree to notify NVIDIA in writing of any known or suspected distribution or use of the SOFTWARE not in compliance with the requirements of this license, and to enforce the terms of your agreements with respect to distributed SOFTWARE.
|
| 17 |
+
*
|
| 18 |
+
* 3. LIMITATIONS. Your license to use the SOFTWARE is restricted as follows:
|
| 19 |
+
* a. The SOFTWARE is licensed for you to develop applications only for use in systems with NVIDIA GPUs.
|
| 20 |
+
* b. You may not reverse engineer, decompile or disassemble, or remove copyright or other proprietary notices from any portion of the SOFTWARE or copies of the SOFTWARE.
|
| 21 |
+
* c. You may not modify or create derivative works of any portion of the SOFTWARE.
|
| 22 |
+
* d. You may not bypass, disable, or circumvent any technical measure, encryption, security, digital rights management or authentication mechanism in the SOFTWARE.
|
| 23 |
+
* e. You may not use the SOFTWARE in any manner that would cause it to become subject to an open source software license. As examples, licenses that require as a condition of use, modification, and/or distribution that the SOFTWARE be (i) disclosed or distributed in source code form; (ii) licensed for the purpose of making derivative works; or (iii) redistributable at no charge.
|
| 24 |
+
* f. Unless you have an agreement with NVIDIA for this purpose, you may not use the SOFTWARE with any system or application where the use or failure of the system or application can reasonably be expected to threaten or result in personal injury, death, or catastrophic loss. Examples include use in avionics, navigation, military, medical, life support or other life critical applications. NVIDIA does not design, test or manufacture the SOFTWARE for these critical uses and NVIDIA shall not be liable to you or any third party, in whole or in part, for any claims or damages arising from such uses.
|
| 25 |
+
* g. You agree to defend, indemnify and hold harmless NVIDIA and its affiliates, and their respective employees, contractors, agents, officers and directors, from and against any and all claims, damages, obligations, losses, liabilities, costs or debt, fines, restitutions and expenses (including but not limited to attorney’s fees and costs incident to establishing the right of indemnification) arising out of or related to use of the SOFTWARE outside of the scope of this Agreement, or not in compliance with its terms.
|
| 26 |
+
*
|
| 27 |
+
* 4. PRE-RELEASE. SOFTWARE versions identified as alpha, beta, preview, early access or otherwise as pre-release may not be fully functional, may contain errors or design flaws, and may have reduced or different security, privacy, availability, and reliability standards relative to commercial versions of NVIDIA software and materials. You may use a pre-release SOFTWARE version at your own risk, understanding that these versions are not intended for use in production or business-critical systems.
|
| 28 |
+
*
|
| 29 |
+
* 5. OWNERSHIP. The SOFTWARE and the related intellectual property rights therein are and will remain the sole and exclusive property of NVIDIA or its licensors. The SOFTWARE is copyrighted and protected by the laws of the United States and other countries, and international treaty provisions. NVIDIA may make changes to the SOFTWARE, at any time without notice, but is not obligated to support or update the SOFTWARE.
|
| 30 |
+
*
|
| 31 |
+
* 6. COMPONENTS UNDER OTHER LICENSES. The SOFTWARE may include NVIDIA or third-party components with separate legal notices or terms as may be described in proprietary notices accompanying the SOFTWARE. If and to the extent there is a conflict between the terms in this license and the license terms associated with a component, the license terms associated with the components control only to the extent necessary to resolve the conflict.
|
| 32 |
+
*
|
| 33 |
+
* 7. FEEDBACK. You may, but don’t have to, provide to NVIDIA any Feedback. “Feedback” means any suggestions, bug fixes, enhancements, modifications, feature requests or other feedback regarding the SOFTWARE. For any Feedback that you voluntarily provide, you hereby grant NVIDIA and its affiliates a perpetual, non-exclusive, worldwide, irrevocable license to use, reproduce, modify, license, sublicense (through multiple tiers of sublicensees), and distribute (through multiple tiers of distributors) the Feedback without the payment of any royalties or fees to you. NVIDIA will use Feedback at its choice.
|
| 34 |
+
*
|
| 35 |
+
* 8. NO WARRANTIES. THE SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY EXPRESS OR IMPLIED WARRANTY OF ANY KIND INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, OR FITNESS FOR A PARTICULAR PURPOSE. NVIDIA DOES NOT WARRANT THAT THE SOFTWARE WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION THEREOF WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT ALL ERRORS WILL BE CORRECTED.
|
| 36 |
+
*
|
| 37 |
+
* 9. LIMITATIONS OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY LAW, NVIDIA AND ITS AFFILIATES SHALL NOT BE LIABLE FOR ANY SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, OR ANY LOST PROFITS, PROJECT DELAYS, LOSS OF USE, LOSS OF DATA OR LOSS OF GOODWILL, OR THE COSTS OF PROCURING SUBSTITUTE PRODUCTS, ARISING OUT OF OR IN CONNECTION WITH THIS LICENSE OR THE USE OR PERFORMANCE OF THE SOFTWARE, WHETHER SUCH LIABILITY ARISES FROM ANY CLAIM BASED UPON BREACH OF CONTRACT, BREACH OF WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCT LIABILITY OR ANY OTHER CAUSE OF ACTION OR THEORY OF LIABILITY, EVEN IF NVIDIA HAS PREVIOUSLY BEEN ADVISED OF, OR COULD REASONABLY HAVE FORESEEN, THE POSSIBILITY OF SUCH DAMAGES. IN NO EVENT WILL NVIDIA’S AND ITS AFFILIATES TOTAL CUMULATIVE LIABILITY UNDER OR ARISING OUT OF THIS LICENSE EXCEED US$10.00. THE NATURE OF THE LIABILITY OR THE NUMBER OF CLAIMS OR SUITS SHALL NOT ENLARGE OR EXTEND THIS LIMIT.
|
| 38 |
+
*
|
| 39 |
+
* 10. TERMINATION. Your rights under this license will terminate automatically without notice from NVIDIA if you fail to comply with any term and condition of this license or if you commence or participate in any legal proceeding against NVIDIA with respect to the SOFTWARE. NVIDIA may terminate this license with advance written notice to you if NVIDIA decides to no longer provide the SOFTWARE in a country or, in NVIDIA’s sole discretion, the continued use of it is no longer commercially viable. Upon any termination of this license, you agree to promptly discontinue use of the SOFTWARE and destroy all copies in your possession or control. Your prior distributions in accordance with this license are not affected by the termination of this license. All provisions of this license will survive termination, except for the license granted to you.
|
| 40 |
+
*
|
| 41 |
+
* 11. APPLICABLE LAW. This license will be governed in all respects by the laws of the United States and of the State of Delaware as those laws are applied to contracts entered into and performed entirely within Delaware by Delaware residents, without regard to the conflicts of laws principles. The United Nations Convention on Contracts for the International Sale of Goods is specifically disclaimed. You agree to all terms of this Agreement in the English language. The state or federal courts residing in Santa Clara County, California shall have exclusive jurisdiction over any dispute or claim arising out of this license. Notwithstanding this, you agree that NVIDIA shall still be allowed to apply for injunctive remedies or an equivalent type of urgent legal relief in any jurisdiction.
|
| 42 |
+
*
|
| 43 |
+
* 12. NO ASSIGNMENT. This license and your rights and obligations thereunder may not be assigned by you by any means or operation of law without NVIDIA’s permission. Any attempted assignment not approved by NVIDIA in writing shall be void and of no effect.
|
| 44 |
+
*
|
| 45 |
+
* 13. EXPORT. The SOFTWARE is subject to United States export laws and regulations. You agree that you will not ship, transfer or export the SOFTWARE into any country, or use the SOFTWARE in any manner, prohibited by the United States Bureau of Industry and Security or economic sanctions regulations administered by the U.S. Department of Treasury’s Office of Foreign Assets Control (OFAC), or any applicable export laws, restrictions or regulations. These laws include restrictions on destinations, end users and end use. By accepting this license, you confirm that you are not a resident or citizen of any country currently embargoed by the U.S. and that you are not otherwise prohibited from receiving the SOFTWARE.
|
| 46 |
+
*
|
| 47 |
+
* 14. GOVERNMENT USE. The SOFTWARE has been developed entirely at private expense and is “commercial items” consisting of “commercial computer software” and “commercial computer software documentation” provided with RESTRICTED RIGHTS. Use, duplication or disclosure by the U.S. Government or a U.S. Government subcontractor is subject to the restrictions in this license pursuant to DFARS 227.7202-3(a) or as set forth in subparagraphs (b)(1) and (2) of the Commercial Computer Software - Restricted Rights clause at FAR 52.227-19, as applicable. Contractor/manufacturer is NVIDIA, 2788 San Tomas Expressway, Santa Clara, CA 95051.
|
| 48 |
+
*
|
| 49 |
+
* 15. ENTIRE AGREEMENT. This license is the final, complete and exclusive agreement between the parties relating to the subject matter of this license and supersedes all prior or contemporaneous understandings and agreements relating to this subject matter, whether oral or written. If any court of competent jurisdiction determines that any provision of this license is illegal, invalid or unenforceable, the remaining provisions will remain in full force and effect. This license may only be modified in a writing signed by an authorized representative of each party.
|
| 50 |
+
*
|
| 51 |
+
* (v. August 20, 2021)
|
| 52 |
+
*/
|
| 53 |
+
|
| 54 |
+
_LIBCUDACXX_BEGIN_NAMESPACE_CUDA
|
| 55 |
+
|
| 56 |
+
namespace __detail_ap {
|
| 57 |
+
|
| 58 |
+
template <typename _Property>
|
| 59 |
+
_LIBCUDACXX_DEVICE
|
| 60 |
+
void* __associate_address_space(void* __ptr, _Property __prop) {
|
| 61 |
+
if (std::is_same<_Property, access_property::shared>::value == true) {
|
| 62 |
+
bool __b = __isShared(__ptr);
|
| 63 |
+
_LIBCUDACXX_ASSERT(__b, "");
|
| 64 |
+
#if !defined(_LIBCUDACXX_CUDACC_BELOW_11_2)
|
| 65 |
+
__builtin_assume(__b);
|
| 66 |
+
#else // ^^^ !_LIBCUDACXX_CUDACC_BELOW_11_2 ^^^ / vvv _LIBCUDACXX_CUDACC_BELOW_11_2 vvv
|
| 67 |
+
(void)__b;
|
| 68 |
+
#endif // _LIBCUDACXX_CUDACC_BELOW_11_2
|
| 69 |
+
} else if (std::is_same<_Property, access_property::global>::value == true ||
|
| 70 |
+
std::is_same<_Property, access_property::normal>::value == true ||
|
| 71 |
+
std::is_same<_Property, access_property::persisting>::value == true ||
|
| 72 |
+
std::is_same<_Property, access_property::streaming>::value == true ||
|
| 73 |
+
std::is_same<_Property, access_property>::value) {
|
| 74 |
+
bool __b = __isGlobal(__ptr);
|
| 75 |
+
_LIBCUDACXX_ASSERT(__b, "");
|
| 76 |
+
#if !defined(_LIBCUDACXX_CUDACC_BELOW_11_2)
|
| 77 |
+
__builtin_assume(__b);
|
| 78 |
+
#else // ^^^ !_LIBCUDACXX_CUDACC_BELOW_11_2 ^^^ / vvv _LIBCUDACXX_CUDACC_BELOW_11_2 vvv
|
| 79 |
+
(void)__b;
|
| 80 |
+
#endif // _LIBCUDACXX_CUDACC_BELOW_11_2
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
return __ptr;
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
template <typename __Prop>
|
| 87 |
+
_LIBCUDACXX_DEVICE
|
| 88 |
+
void* __associate_descriptor(void* __ptr, __Prop __prop) {
|
| 89 |
+
return __associate_descriptor(__ptr, static_cast<std::uint64_t>(access_property(__prop)));
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
template <>
|
| 93 |
+
inline _LIBCUDACXX_DEVICE
|
| 94 |
+
void* __associate_descriptor(void* __ptr, std::uint64_t __prop) {
|
| 95 |
+
NV_IF_ELSE_TARGET(NV_PROVIDES_SM_80,(
|
| 96 |
+
return __nv_associate_access_property(__ptr, __prop);
|
| 97 |
+
),(
|
| 98 |
+
return __ptr;
|
| 99 |
+
))
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
template<>
|
| 103 |
+
inline _LIBCUDACXX_DEVICE
|
| 104 |
+
void* __associate_descriptor(void* __ptr, access_property::shared) {
|
| 105 |
+
return __ptr;
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
template<typename _Type, typename _Property>
|
| 109 |
+
_LIBCUDACXX_HOST_DEVICE
|
| 110 |
+
_Type* __associate(_Type* __ptr, _Property __prop) {
|
| 111 |
+
NV_IF_ELSE_TARGET(NV_IS_DEVICE,(
|
| 112 |
+
return static_cast<_Type*>(__associate_descriptor(
|
| 113 |
+
__associate_address_space(const_cast<void*>(static_cast<const void*>(__ptr)), __prop),
|
| 114 |
+
__prop));
|
| 115 |
+
),(
|
| 116 |
+
return __ptr;
|
| 117 |
+
))
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
|
| 121 |
+
template<typename _Property>
|
| 122 |
+
class __annotated_ptr_base {
|
| 123 |
+
using __error = typename _Property::__unknown_access_property_type;
|
| 124 |
+
};
|
| 125 |
+
|
| 126 |
+
template<>
|
| 127 |
+
class __annotated_ptr_base<access_property::shared> {
|
| 128 |
+
protected:
|
| 129 |
+
static constexpr std::uint64_t __prop = 0;
|
| 130 |
+
|
| 131 |
+
constexpr __annotated_ptr_base() noexcept = default;
|
| 132 |
+
constexpr __annotated_ptr_base(__annotated_ptr_base const&) = default;
|
| 133 |
+
_LIBCUDACXX_CONSTEXPR_AFTER_CXX11 __annotated_ptr_base& operator=(const __annotated_ptr_base&) = default;
|
| 134 |
+
_LIBCUDACXX_HOST_DEVICE constexpr __annotated_ptr_base(access_property::shared) noexcept {}
|
| 135 |
+
inline _LIBCUDACXX_DEVICE void* __apply_prop(void* __p) const {
|
| 136 |
+
return __associate(__p, access_property::shared{});
|
| 137 |
+
}
|
| 138 |
+
_LIBCUDACXX_HOST_DEVICE constexpr access_property::shared __get_property() const noexcept {
|
| 139 |
+
return access_property::shared{};
|
| 140 |
+
}
|
| 141 |
+
};
|
| 142 |
+
|
| 143 |
+
template<>
|
| 144 |
+
class __annotated_ptr_base<access_property::global> {
|
| 145 |
+
protected:
|
| 146 |
+
static constexpr std::uint64_t __prop = __sm_80::__interleave_normal();
|
| 147 |
+
|
| 148 |
+
constexpr __annotated_ptr_base() noexcept = default;
|
| 149 |
+
constexpr __annotated_ptr_base(__annotated_ptr_base const&) = default;
|
| 150 |
+
_LIBCUDACXX_CONSTEXPR_AFTER_CXX11 __annotated_ptr_base& operator=(const __annotated_ptr_base&) = default;
|
| 151 |
+
_LIBCUDACXX_HOST_DEVICE constexpr __annotated_ptr_base(access_property::global) noexcept {}
|
| 152 |
+
inline _LIBCUDACXX_DEVICE void* __apply_prop(void* __p) const {
|
| 153 |
+
return __associate(__p, access_property::global{});
|
| 154 |
+
}
|
| 155 |
+
_LIBCUDACXX_HOST_DEVICE constexpr access_property::global __get_property() const noexcept {
|
| 156 |
+
return access_property::global{};
|
| 157 |
+
}
|
| 158 |
+
};
|
| 159 |
+
|
| 160 |
+
template<>
|
| 161 |
+
class __annotated_ptr_base<access_property::normal> {
|
| 162 |
+
protected:
|
| 163 |
+
static constexpr std::uint64_t __prop = __sm_80::__interleave_normal_demote();
|
| 164 |
+
|
| 165 |
+
constexpr __annotated_ptr_base() noexcept = default;
|
| 166 |
+
constexpr __annotated_ptr_base(__annotated_ptr_base const&) = default;
|
| 167 |
+
_LIBCUDACXX_CONSTEXPR_AFTER_CXX11 __annotated_ptr_base& operator=(const __annotated_ptr_base&) = default;
|
| 168 |
+
_LIBCUDACXX_HOST_DEVICE constexpr __annotated_ptr_base(access_property::normal) noexcept {}
|
| 169 |
+
inline _LIBCUDACXX_DEVICE void* __apply_prop(void* __p) const {
|
| 170 |
+
return __associate(__p, access_property::normal{});
|
| 171 |
+
}
|
| 172 |
+
_LIBCUDACXX_HOST_DEVICE constexpr access_property::normal __get_property() const noexcept {
|
| 173 |
+
return access_property::normal{};
|
| 174 |
+
}
|
| 175 |
+
};
|
| 176 |
+
|
| 177 |
+
template<>
|
| 178 |
+
class __annotated_ptr_base<access_property::persisting> {
|
| 179 |
+
protected:
|
| 180 |
+
static constexpr std::uint64_t __prop = __sm_80::__interleave_persisting();
|
| 181 |
+
|
| 182 |
+
constexpr __annotated_ptr_base() noexcept = default;
|
| 183 |
+
constexpr __annotated_ptr_base(__annotated_ptr_base const&) = default;
|
| 184 |
+
_LIBCUDACXX_CONSTEXPR_AFTER_CXX11 __annotated_ptr_base& operator=(const __annotated_ptr_base&) = default;
|
| 185 |
+
_LIBCUDACXX_HOST_DEVICE constexpr __annotated_ptr_base(access_property::persisting) noexcept {}
|
| 186 |
+
inline _LIBCUDACXX_DEVICE void* __apply_prop(void* __p) const {
|
| 187 |
+
return __associate(__p, access_property::persisting{});
|
| 188 |
+
}
|
| 189 |
+
_LIBCUDACXX_HOST_DEVICE constexpr access_property::persisting __get_property() const noexcept {
|
| 190 |
+
return access_property::persisting{};
|
| 191 |
+
}
|
| 192 |
+
};
|
| 193 |
+
|
| 194 |
+
template<>
|
| 195 |
+
class __annotated_ptr_base<access_property::streaming> {
|
| 196 |
+
protected:
|
| 197 |
+
static constexpr std::uint64_t __prop = __sm_80::__interleave_streaming();
|
| 198 |
+
|
| 199 |
+
constexpr __annotated_ptr_base() noexcept = default;
|
| 200 |
+
constexpr __annotated_ptr_base(__annotated_ptr_base const&) = default;
|
| 201 |
+
_LIBCUDACXX_CONSTEXPR_AFTER_CXX11 __annotated_ptr_base& operator=(const __annotated_ptr_base&) = default;
|
| 202 |
+
_LIBCUDACXX_HOST_DEVICE constexpr __annotated_ptr_base(access_property::streaming) noexcept {}
|
| 203 |
+
inline _LIBCUDACXX_DEVICE void* __apply_prop(void* __p) const {
|
| 204 |
+
return __associate(__p, access_property::streaming{});
|
| 205 |
+
}
|
| 206 |
+
_LIBCUDACXX_HOST_DEVICE constexpr access_property::streaming __get_property() const noexcept {
|
| 207 |
+
return access_property::streaming{};
|
| 208 |
+
}
|
| 209 |
+
};
|
| 210 |
+
|
| 211 |
+
template<>
|
| 212 |
+
class __annotated_ptr_base<access_property> {
|
| 213 |
+
protected:
|
| 214 |
+
std::uint64_t __prop;
|
| 215 |
+
|
| 216 |
+
_LIBCUDACXX_HOST_DEVICE constexpr __annotated_ptr_base() noexcept : __prop(access_property()) {}
|
| 217 |
+
_LIBCUDACXX_HOST_DEVICE constexpr __annotated_ptr_base(std::uint64_t __property) noexcept : __prop(__property) {}
|
| 218 |
+
_LIBCUDACXX_HOST_DEVICE constexpr __annotated_ptr_base(access_property __property) noexcept
|
| 219 |
+
: __annotated_ptr_base(static_cast<std::uint64_t>(__property)) {}
|
| 220 |
+
constexpr __annotated_ptr_base(__annotated_ptr_base const&) = default;
|
| 221 |
+
_LIBCUDACXX_CONSTEXPR_AFTER_CXX11 __annotated_ptr_base& operator=(const __annotated_ptr_base&) = default;
|
| 222 |
+
inline _LIBCUDACXX_DEVICE void* __apply_prop(void* __p) const {
|
| 223 |
+
return __associate(__p, __prop);
|
| 224 |
+
}
|
| 225 |
+
_LIBCUDACXX_HOST_DEVICE access_property __get_property() const noexcept {
|
| 226 |
+
return reinterpret_cast<access_property&>(const_cast<std::uint64_t&>(__prop));
|
| 227 |
+
}
|
| 228 |
+
};
|
| 229 |
+
} // namespace __detail_ap
|
| 230 |
+
|
| 231 |
+
_LIBCUDACXX_END_NAMESPACE_CUDA
|
cuda_toolkit/include/cuda/std/detail/__config
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of libcu++, the C++ Standard Library for your entire system,
|
| 4 |
+
// under the Apache License v2.0 with LLVM Exceptions.
|
| 5 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 6 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 7 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 8 |
+
//
|
| 9 |
+
//===----------------------------------------------------------------------===//
|
| 10 |
+
|
| 11 |
+
#ifndef __cuda_std__
|
| 12 |
+
#define __cuda_std__
|
| 13 |
+
|
| 14 |
+
#include <cuda/std/detail/libcxx/include/__cccl/version.h>
|
| 15 |
+
|
| 16 |
+
#define _LIBCUDACXX_CUDA_API_VERSION CCCL_VERSION
|
| 17 |
+
#define _LIBCUDACXX_CUDA_API_VERSION_MAJOR CCCL_MAJOR_VERSION
|
| 18 |
+
#define _LIBCUDACXX_CUDA_API_VERSION_MINOR CCCL_MINOR_VERSION
|
| 19 |
+
#define _LIBCUDACXX_CUDA_API_VERSION_PATCH CCCL_PATCH_VERSION
|
| 20 |
+
|
| 21 |
+
#ifndef _LIBCUDACXX_CUDA_ABI_VERSION_LATEST
|
| 22 |
+
# define _LIBCUDACXX_CUDA_ABI_VERSION_LATEST 4
|
| 23 |
+
#endif
|
| 24 |
+
|
| 25 |
+
#ifdef _LIBCUDACXX_CUDA_ABI_VERSION
|
| 26 |
+
# if _LIBCUDACXX_CUDA_ABI_VERSION != 2 && _LIBCUDACXX_CUDA_ABI_VERSION != 3 && _LIBCUDACXX_CUDA_ABI_VERSION != 4
|
| 27 |
+
# error Unsupported libcu++ ABI version requested. Please define _LIBCUDACXX_CUDA_ABI_VERSION to either 2 or 3.
|
| 28 |
+
# endif
|
| 29 |
+
#else
|
| 30 |
+
# define _LIBCUDACXX_CUDA_ABI_VERSION _LIBCUDACXX_CUDA_ABI_VERSION_LATEST
|
| 31 |
+
#endif
|
| 32 |
+
|
| 33 |
+
#ifdef _LIBCUDACXX_PIPELINE_ASSUMED_ABI_VERSION
|
| 34 |
+
# if _LIBCUDACXX_PIPELINE_ASSUMED_ABI_VERSION != _LIBCUDACXX_CUDA_ABI_VERSION
|
| 35 |
+
# error cuda_pipeline.h has assumed a different libcu++ ABI version than provided by this library. To fix this, please include a libcu++ header before including cuda_pipeline.h, or upgrade to a version of the toolkit this version of libcu++ shipped in.
|
| 36 |
+
# endif
|
| 37 |
+
#endif
|
| 38 |
+
|
| 39 |
+
#include "libcxx/include/__config"
|
| 40 |
+
|
| 41 |
+
#endif //__cuda_std__
|
cuda_toolkit/include/cuda/std/detail/__pragma_pop
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of libcu++, the C++ Standard Library for your entire system,
|
| 4 |
+
// under the Apache License v2.0 with LLVM Exceptions.
|
| 5 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 6 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 7 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 8 |
+
//
|
| 9 |
+
//===----------------------------------------------------------------------===//
|
| 10 |
+
|
| 11 |
+
#include "libcxx/include/__pragma_pop"
|
| 12 |
+
|
cuda_toolkit/include/cuda/std/detail/__pragma_push
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of libcu++, the C++ Standard Library for your entire system,
|
| 4 |
+
// under the Apache License v2.0 with LLVM Exceptions.
|
| 5 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 6 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 7 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 8 |
+
//
|
| 9 |
+
//===----------------------------------------------------------------------===//
|
| 10 |
+
|
| 11 |
+
#include "libcxx/include/__pragma_push"
|
| 12 |
+
#include "libcxx/include/__undef_macros"
|
| 13 |
+
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__algorithm/swap_ranges.h
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// -*- C++ -*-
|
| 2 |
+
//===----------------------------------------------------------------------===//
|
| 3 |
+
//
|
| 4 |
+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
| 5 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 6 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
|
| 10 |
+
#ifndef _LIBCUDACXX___ALGORITHM_SWAP_RANGES_H
|
| 11 |
+
#define _LIBCUDACXX___ALGORITHM_SWAP_RANGES_H
|
| 12 |
+
|
| 13 |
+
#ifndef __cuda_std__
|
| 14 |
+
#include <__config>
|
| 15 |
+
#endif // __cuda_std__
|
| 16 |
+
|
| 17 |
+
#include "../__utility/swap.h"
|
| 18 |
+
|
| 19 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 20 |
+
# pragma GCC system_header
|
| 21 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 22 |
+
# pragma clang system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 24 |
+
# pragma system_header
|
| 25 |
+
#endif // no system header
|
| 26 |
+
|
| 27 |
+
_LIBCUDACXX_BEGIN_NAMESPACE_STD
|
| 28 |
+
|
| 29 |
+
template <class _ForwardIterator1, class _ForwardIterator2>
|
| 30 |
+
inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
|
| 31 |
+
_ForwardIterator2 swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2)
|
| 32 |
+
{
|
| 33 |
+
for(; __first1 != __last1; ++__first1, (void) ++__first2)
|
| 34 |
+
swap(*__first1, *__first2);
|
| 35 |
+
return __first2;
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
_LIBCUDACXX_END_NAMESPACE_STD
|
| 39 |
+
|
| 40 |
+
#endif // _LIBCUDACXX___ALGORITHM_SWAP_RANGES_H
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__assert
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// -*- C++ -*-
|
| 2 |
+
//===----------------------------------------------------------------------===//
|
| 3 |
+
//
|
| 4 |
+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
| 5 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 6 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 7 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 8 |
+
//
|
| 9 |
+
//===----------------------------------------------------------------------===//
|
| 10 |
+
|
| 11 |
+
#ifndef _LIBCUDACXX___ASSERT
|
| 12 |
+
#define _LIBCUDACXX___ASSERT
|
| 13 |
+
|
| 14 |
+
#ifndef __cuda_std__
|
| 15 |
+
#include <__config>
|
| 16 |
+
#endif // __cuda_std__
|
| 17 |
+
|
| 18 |
+
#include "__verbose_abort"
|
| 19 |
+
|
| 20 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 21 |
+
# pragma GCC system_header
|
| 22 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 23 |
+
# pragma clang system_header
|
| 24 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 25 |
+
# pragma system_header
|
| 26 |
+
#endif // no system header
|
| 27 |
+
|
| 28 |
+
// This is for backwards compatibility with code that might have been enabling
|
| 29 |
+
// assertions through the Debug mode previously.
|
| 30 |
+
// TODO: In LLVM 16, make it an error to define _LIBCUDACXX_DEBUG
|
| 31 |
+
#if defined(_LIBCUDACXX_DEBUG)
|
| 32 |
+
# ifndef _LIBCUDACXX_ENABLE_ASSERTIONS
|
| 33 |
+
# define _LIBCUDACXX_ENABLE_ASSERTIONS 1
|
| 34 |
+
# endif
|
| 35 |
+
#endif
|
| 36 |
+
|
| 37 |
+
// Automatically enable assertions when the debug mode is enabled.
|
| 38 |
+
#if defined(_LIBCUDACXX_ENABLE_DEBUG_MODE)
|
| 39 |
+
# ifndef _LIBCUDACXX_ENABLE_ASSERTIONS
|
| 40 |
+
# define _LIBCUDACXX_ENABLE_ASSERTIONS 1
|
| 41 |
+
# endif
|
| 42 |
+
#endif
|
| 43 |
+
|
| 44 |
+
#ifndef _LIBCUDACXX_ENABLE_ASSERTIONS
|
| 45 |
+
# define _LIBCUDACXX_ENABLE_ASSERTIONS _LIBCUDACXX_ENABLE_ASSERTIONS_DEFAULT
|
| 46 |
+
#endif
|
| 47 |
+
|
| 48 |
+
#if _LIBCUDACXX_ENABLE_ASSERTIONS != 0 && _LIBCUDACXX_ENABLE_ASSERTIONS != 1
|
| 49 |
+
# error "_LIBCUDACXX_ENABLE_ASSERTIONS must be set to 0 or 1"
|
| 50 |
+
#endif
|
| 51 |
+
|
| 52 |
+
#if _LIBCUDACXX_ENABLE_ASSERTIONS
|
| 53 |
+
# define _LIBCUDACXX_ASSERT(expression, message) \
|
| 54 |
+
(_CCCL_DIAG_PUSH \
|
| 55 |
+
_CCCL_DIAG_SUPPRESS_CLANG("-Wassume") \
|
| 56 |
+
__builtin_expect(static_cast<bool>(expression), 1) ? \
|
| 57 |
+
(void)0 : \
|
| 58 |
+
::_CUDA_VSTD::__libcpp_verbose_abort("%s:%d: assertion %s failed: %s", __FILE__, __LINE__, #expression, message)
|
| 59 |
+
_CCCL_DIAG_POP)
|
| 60 |
+
#elif 0 // !defined(_LIBCUDACXX_ASSERTIONS_DISABLE_ASSUME) && __has_builtin(__builtin_assume)
|
| 61 |
+
# define _LIBCUDACXX_ASSERT(expression, message) \
|
| 62 |
+
(_CCCL_DIAG_PUSH \
|
| 63 |
+
_CCCL_DIAG_SUPPRESS_CLANG("-Wassume") \
|
| 64 |
+
__builtin_assume(static_cast<bool>(expression)) \
|
| 65 |
+
_CCCL_DIAG_POP)
|
| 66 |
+
#else
|
| 67 |
+
# define _LIBCUDACXX_ASSERT(expression, message) ((void)0)
|
| 68 |
+
#endif
|
| 69 |
+
|
| 70 |
+
#endif // _LIBCUDACXX___ASSERT
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__availability
ADDED
|
@@ -0,0 +1,306 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// -*- C++ -*-
|
| 2 |
+
//===----------------------------------------------------------------------===//
|
| 3 |
+
//
|
| 4 |
+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
| 5 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 6 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 7 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 8 |
+
//
|
| 9 |
+
//===----------------------------------------------------------------------===//
|
| 10 |
+
|
| 11 |
+
#ifndef _LIBCUDACXX___AVAILABILITY
|
| 12 |
+
#define _LIBCUDACXX___AVAILABILITY
|
| 13 |
+
|
| 14 |
+
#ifndef __cuda_std__
|
| 15 |
+
#include <__config>
|
| 16 |
+
#endif // __cuda_std__
|
| 17 |
+
|
| 18 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 19 |
+
# pragma GCC system_header
|
| 20 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 21 |
+
# pragma clang system_header
|
| 22 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 23 |
+
# pragma system_header
|
| 24 |
+
#endif // no system header
|
| 25 |
+
|
| 26 |
+
// Libc++ is shipped by various vendors. In particular, it is used as a system
|
| 27 |
+
// library on macOS, iOS and other Apple platforms. In order for users to be
|
| 28 |
+
// able to compile a binary that is intended to be deployed to an older version
|
| 29 |
+
// of a platform, Clang provides availability attributes [1]. These attributes
|
| 30 |
+
// can be placed on declarations and are used to describe the life cycle of a
|
| 31 |
+
// symbol in the library.
|
| 32 |
+
//
|
| 33 |
+
// The main goal is to ensure a compile-time error if a symbol that hasn't been
|
| 34 |
+
// introduced in a previously released library is used in a program that targets
|
| 35 |
+
// that previously released library. Normally, this would be a load-time error
|
| 36 |
+
// when one tries to launch the program against the older library.
|
| 37 |
+
//
|
| 38 |
+
// For example, the filesystem library was introduced in the dylib in macOS 10.15.
|
| 39 |
+
// If a user compiles on a macOS 10.15 host but targets macOS 10.13 with their
|
| 40 |
+
// program, the compiler would normally not complain (because the required
|
| 41 |
+
// declarations are in the headers), but the dynamic loader would fail to find
|
| 42 |
+
// the symbols when actually trying to launch the program on macOS 10.13. To
|
| 43 |
+
// turn this into a compile-time issue instead, declarations are annotated with
|
| 44 |
+
// when they were introduced, and the compiler can produce a diagnostic if the
|
| 45 |
+
// program references something that isn't available on the deployment target.
|
| 46 |
+
//
|
| 47 |
+
// This mechanism is general in nature, and any vendor can add their markup to
|
| 48 |
+
// the library (see below). Whenever a new feature is added that requires support
|
| 49 |
+
// in the shared library, a macro should be added below to mark this feature
|
| 50 |
+
// as unavailable. When vendors decide to ship the feature as part of their
|
| 51 |
+
// shared library, they can update the markup appropriately.
|
| 52 |
+
//
|
| 53 |
+
// Furthermore, many features in the standard library have corresponding
|
| 54 |
+
// feature-test macros. When a feature is made unavailable on some deployment
|
| 55 |
+
// target, a macro should be defined to signal that it is unavailable. That
|
| 56 |
+
// macro can then be picked up when feature-test macros are generated (see
|
| 57 |
+
// generate_feature_test_macro_components.py) to make sure that feature-test
|
| 58 |
+
// macros don't announce a feature as being implemented if it has been marked
|
| 59 |
+
// as unavailable.
|
| 60 |
+
//
|
| 61 |
+
// Note that this mechanism is disabled by default in the "upstream" libc++.
|
| 62 |
+
// Availability annotations are only meaningful when shipping libc++ inside
|
| 63 |
+
// a platform (i.e. as a system library), and so vendors that want them should
|
| 64 |
+
// turn those annotations on at CMake configuration time.
|
| 65 |
+
//
|
| 66 |
+
// [1]: https://clang.llvm.org/docs/AttributeReference.html#availability
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
// For backwards compatibility, allow users to define _LIBCUDACXX_DISABLE_AVAILABILITY
|
| 70 |
+
// for a while.
|
| 71 |
+
#if defined(_LIBCUDACXX_DISABLE_AVAILABILITY)
|
| 72 |
+
# if !defined(_LIBCUDACXX_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)
|
| 73 |
+
# define _LIBCUDACXX_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS
|
| 74 |
+
# endif
|
| 75 |
+
#endif
|
| 76 |
+
|
| 77 |
+
// Availability markup is disabled when building the library, or when the compiler
|
| 78 |
+
// doesn't support the proper attributes.
|
| 79 |
+
#if defined(_LIBCUDACXX_BUILDING_LIBRARY) || \
|
| 80 |
+
defined(_LIBCXXABI_BUILDING_LIBRARY) || \
|
| 81 |
+
!__has_feature(attribute_availability_with_strict) || \
|
| 82 |
+
!__has_feature(attribute_availability_in_templates) || \
|
| 83 |
+
!__has_extension(pragma_clang_attribute_external_declaration)
|
| 84 |
+
# if !defined(_LIBCUDACXX_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)
|
| 85 |
+
# define _LIBCUDACXX_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS
|
| 86 |
+
# endif
|
| 87 |
+
#endif
|
| 88 |
+
|
| 89 |
+
#if defined(_LIBCUDACXX_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)
|
| 90 |
+
|
| 91 |
+
// This controls the availability of std::shared_mutex and std::shared_timed_mutex,
|
| 92 |
+
// which were added to the dylib later.
|
| 93 |
+
# define _LIBCUDACXX_AVAILABILITY_SHARED_MUTEX
|
| 94 |
+
// # define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex
|
| 95 |
+
// # define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex
|
| 96 |
+
|
| 97 |
+
// These macros control the availability of std::bad_optional_access and
|
| 98 |
+
// other exception types. These were put in the shared library to prevent
|
| 99 |
+
// code bloat from every user program defining the vtable for these exception
|
| 100 |
+
// types.
|
| 101 |
+
//
|
| 102 |
+
// Note that when exceptions are disabled, the methods that normally throw
|
| 103 |
+
// these exceptions can be used even on older deployment targets, but those
|
| 104 |
+
// methods will abort instead of throwing.
|
| 105 |
+
# define _LIBCUDACXX_AVAILABILITY_BAD_OPTIONAL_ACCESS
|
| 106 |
+
# define _LIBCUDACXX_AVAILABILITY_BAD_VARIANT_ACCESS
|
| 107 |
+
# define _LIBCUDACXX_AVAILABILITY_BAD_ANY_CAST
|
| 108 |
+
|
| 109 |
+
// This controls the availability of std::uncaught_exceptions().
|
| 110 |
+
# define _LIBCUDACXX_AVAILABILITY_UNCAUGHT_EXCEPTIONS
|
| 111 |
+
|
| 112 |
+
// This controls the availability of the sized version of ::operator delete,
|
| 113 |
+
// ::operator delete[], and their align_val_t variants, which were all added
|
| 114 |
+
// in C++17, and hence not present in early dylibs.
|
| 115 |
+
# define _LIBCUDACXX_AVAILABILITY_SIZED_NEW_DELETE
|
| 116 |
+
|
| 117 |
+
// This controls the availability of the std::future_error exception.
|
| 118 |
+
//
|
| 119 |
+
// Note that when exceptions are disabled, the methods that normally throw
|
| 120 |
+
// std::future_error can be used even on older deployment targets, but those
|
| 121 |
+
// methods will abort instead of throwing.
|
| 122 |
+
# define _LIBCUDACXX_AVAILABILITY_FUTURE_ERROR
|
| 123 |
+
|
| 124 |
+
// This controls the availability of std::type_info's vtable.
|
| 125 |
+
// I can't imagine how using std::type_info can work at all if
|
| 126 |
+
// this isn't supported.
|
| 127 |
+
# define _LIBCUDACXX_AVAILABILITY_TYPEINFO_VTABLE
|
| 128 |
+
|
| 129 |
+
// This controls the availability of std::locale::category members
|
| 130 |
+
// (e.g. std::locale::collate), which are defined in the dylib.
|
| 131 |
+
# define _LIBCUDACXX_AVAILABILITY_LOCALE_CATEGORY
|
| 132 |
+
|
| 133 |
+
// This controls the availability of atomic operations on std::shared_ptr
|
| 134 |
+
// (e.g. `std::atomic_store(std::shared_ptr)`), which require a shared
|
| 135 |
+
// lock table located in the dylib.
|
| 136 |
+
# define _LIBCUDACXX_AVAILABILITY_ATOMIC_SHARED_PTR
|
| 137 |
+
|
| 138 |
+
// These macros control the availability of all parts of <filesystem> that
|
| 139 |
+
// depend on something in the dylib.
|
| 140 |
+
# define _LIBCUDACXX_AVAILABILITY_FILESYSTEM
|
| 141 |
+
# define _LIBCUDACXX_AVAILABILITY_FILESYSTEM_PUSH
|
| 142 |
+
# define _LIBCUDACXX_AVAILABILITY_FILESYSTEM_POP
|
| 143 |
+
// # define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem
|
| 144 |
+
|
| 145 |
+
// This controls the availability of floating-point std::to_chars functions.
|
| 146 |
+
// These overloads were added later than the integer overloads.
|
| 147 |
+
# define _LIBCUDACXX_AVAILABILITY_TO_CHARS_FLOATING_POINT
|
| 148 |
+
|
| 149 |
+
// This controls the availability of the C++20 synchronization library,
|
| 150 |
+
// which requires shared library support for various operations
|
| 151 |
+
// (see libcxx/src/atomic.cpp). This includes <barier>, <latch>,
|
| 152 |
+
// <semaphore>, and notification functions on std::atomic.
|
| 153 |
+
# define _LIBCUDACXX_AVAILABILITY_SYNC
|
| 154 |
+
// # define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait
|
| 155 |
+
// # define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier
|
| 156 |
+
// # define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_latch
|
| 157 |
+
// # define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore
|
| 158 |
+
|
| 159 |
+
// This controls the availability of the C++20 format library.
|
| 160 |
+
// The library is in development and not ABI stable yet. P2216 is
|
| 161 |
+
// retroactively accepted in C++20. This paper contains ABI breaking
|
| 162 |
+
// changes.
|
| 163 |
+
# define _LIBCUDACXX_AVAILABILITY_FORMAT
|
| 164 |
+
// # define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_format
|
| 165 |
+
|
| 166 |
+
// This controls whether the default verbose termination function is
|
| 167 |
+
// provided by the library.
|
| 168 |
+
//
|
| 169 |
+
// Note that when users provide their own custom function, it doesn't
|
| 170 |
+
// matter whether the dylib provides a default function, and the
|
| 171 |
+
// availability markup can actually give a false positive diagnostic
|
| 172 |
+
// (it will think that no function is provided, when in reality the
|
| 173 |
+
// user has provided their own).
|
| 174 |
+
//
|
| 175 |
+
// Users can pass -D_LIBCUDACXX_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED
|
| 176 |
+
// to the compiler to tell the library not to define its own verbose abort.
|
| 177 |
+
// Note that defining this macro but failing to define a custom function
|
| 178 |
+
// will lead to a load-time error on back-deployment targets, so it should
|
| 179 |
+
// be avoided.
|
| 180 |
+
// # define _LIBCUDACXX_HAS_NO_VERBOSE_ABORT_IN_LIBRARY
|
| 181 |
+
|
| 182 |
+
#elif defined(__APPLE__)
|
| 183 |
+
|
| 184 |
+
# define _LIBCUDACXX_AVAILABILITY_SHARED_MUTEX \
|
| 185 |
+
__attribute__((availability(macos,strict,introduced=10.12))) \
|
| 186 |
+
__attribute__((availability(ios,strict,introduced=10.0))) \
|
| 187 |
+
__attribute__((availability(tvos,strict,introduced=10.0))) \
|
| 188 |
+
__attribute__((availability(watchos,strict,introduced=3.0)))
|
| 189 |
+
# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101200) || \
|
| 190 |
+
(defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 100000) || \
|
| 191 |
+
(defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 100000) || \
|
| 192 |
+
(defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 30000)
|
| 193 |
+
# define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex
|
| 194 |
+
# define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex
|
| 195 |
+
# endif
|
| 196 |
+
|
| 197 |
+
// Note: bad_optional_access & friends were not introduced in the matching
|
| 198 |
+
// macOS and iOS versions, so the version mismatch between macOS and others
|
| 199 |
+
// is intended.
|
| 200 |
+
# define _LIBCUDACXX_AVAILABILITY_BAD_OPTIONAL_ACCESS \
|
| 201 |
+
__attribute__((availability(macos,strict,introduced=10.13))) \
|
| 202 |
+
__attribute__((availability(ios,strict,introduced=12.0))) \
|
| 203 |
+
__attribute__((availability(tvos,strict,introduced=12.0))) \
|
| 204 |
+
__attribute__((availability(watchos,strict,introduced=5.0)))
|
| 205 |
+
# define _LIBCUDACXX_AVAILABILITY_BAD_VARIANT_ACCESS \
|
| 206 |
+
_LIBCUDACXX_AVAILABILITY_BAD_OPTIONAL_ACCESS
|
| 207 |
+
# define _LIBCUDACXX_AVAILABILITY_BAD_ANY_CAST \
|
| 208 |
+
_LIBCUDACXX_AVAILABILITY_BAD_OPTIONAL_ACCESS
|
| 209 |
+
|
| 210 |
+
# define _LIBCUDACXX_AVAILABILITY_UNCAUGHT_EXCEPTIONS \
|
| 211 |
+
__attribute__((availability(macos,strict,introduced=10.12))) \
|
| 212 |
+
__attribute__((availability(ios,strict,introduced=10.0))) \
|
| 213 |
+
__attribute__((availability(tvos,strict,introduced=10.0))) \
|
| 214 |
+
__attribute__((availability(watchos,strict,introduced=3.0)))
|
| 215 |
+
|
| 216 |
+
# define _LIBCUDACXX_AVAILABILITY_SIZED_NEW_DELETE \
|
| 217 |
+
__attribute__((availability(macos,strict,introduced=10.12))) \
|
| 218 |
+
__attribute__((availability(ios,strict,introduced=10.0))) \
|
| 219 |
+
__attribute__((availability(tvos,strict,introduced=10.0))) \
|
| 220 |
+
__attribute__((availability(watchos,strict,introduced=3.0)))
|
| 221 |
+
|
| 222 |
+
# define _LIBCUDACXX_AVAILABILITY_FUTURE_ERROR \
|
| 223 |
+
__attribute__((availability(ios,strict,introduced=6.0)))
|
| 224 |
+
|
| 225 |
+
# define _LIBCUDACXX_AVAILABILITY_TYPEINFO_VTABLE \
|
| 226 |
+
__attribute__((availability(macos,strict,introduced=10.9))) \
|
| 227 |
+
__attribute__((availability(ios,strict,introduced=7.0)))
|
| 228 |
+
|
| 229 |
+
# define _LIBCUDACXX_AVAILABILITY_LOCALE_CATEGORY \
|
| 230 |
+
__attribute__((availability(macos,strict,introduced=10.9))) \
|
| 231 |
+
__attribute__((availability(ios,strict,introduced=7.0)))
|
| 232 |
+
|
| 233 |
+
# define _LIBCUDACXX_AVAILABILITY_ATOMIC_SHARED_PTR \
|
| 234 |
+
__attribute__((availability(macos,strict,introduced=10.9))) \
|
| 235 |
+
__attribute__((availability(ios,strict,introduced=7.0)))
|
| 236 |
+
|
| 237 |
+
# define _LIBCUDACXX_AVAILABILITY_FILESYSTEM \
|
| 238 |
+
__attribute__((availability(macos,strict,introduced=10.15))) \
|
| 239 |
+
__attribute__((availability(ios,strict,introduced=13.0))) \
|
| 240 |
+
__attribute__((availability(tvos,strict,introduced=13.0))) \
|
| 241 |
+
__attribute__((availability(watchos,strict,introduced=6.0)))
|
| 242 |
+
# define _LIBCUDACXX_AVAILABILITY_FILESYSTEM_PUSH \
|
| 243 |
+
_Pragma("clang attribute push(__attribute__((availability(macos,strict,introduced=10.15))), apply_to=any(function,record))") \
|
| 244 |
+
_Pragma("clang attribute push(__attribute__((availability(ios,strict,introduced=13.0))), apply_to=any(function,record))") \
|
| 245 |
+
_Pragma("clang attribute push(__attribute__((availability(tvos,strict,introduced=13.0))), apply_to=any(function,record))") \
|
| 246 |
+
_Pragma("clang attribute push(__attribute__((availability(watchos,strict,introduced=6.0))), apply_to=any(function,record))")
|
| 247 |
+
# define _LIBCUDACXX_AVAILABILITY_FILESYSTEM_POP \
|
| 248 |
+
_Pragma("clang attribute pop") \
|
| 249 |
+
_Pragma("clang attribute pop") \
|
| 250 |
+
_Pragma("clang attribute pop") \
|
| 251 |
+
_Pragma("clang attribute pop")
|
| 252 |
+
# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101500) || \
|
| 253 |
+
(defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 130000) || \
|
| 254 |
+
(defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 130000) || \
|
| 255 |
+
(defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 60000)
|
| 256 |
+
# define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem
|
| 257 |
+
# endif
|
| 258 |
+
|
| 259 |
+
# define _LIBCUDACXX_AVAILABILITY_TO_CHARS_FLOATING_POINT \
|
| 260 |
+
__attribute__((unavailable))
|
| 261 |
+
|
| 262 |
+
# define _LIBCUDACXX_AVAILABILITY_SYNC \
|
| 263 |
+
__attribute__((availability(macos,strict,introduced=11.0))) \
|
| 264 |
+
__attribute__((availability(ios,strict,introduced=14.0))) \
|
| 265 |
+
__attribute__((availability(tvos,strict,introduced=14.0))) \
|
| 266 |
+
__attribute__((availability(watchos,strict,introduced=7.0)))
|
| 267 |
+
# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 110000) || \
|
| 268 |
+
(defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 140000) || \
|
| 269 |
+
(defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 140000) || \
|
| 270 |
+
(defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 70000)
|
| 271 |
+
# define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait
|
| 272 |
+
# define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier
|
| 273 |
+
# define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_latch
|
| 274 |
+
# define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore
|
| 275 |
+
# endif
|
| 276 |
+
|
| 277 |
+
# define _LIBCUDACXX_AVAILABILITY_FORMAT \
|
| 278 |
+
__attribute__((unavailable))
|
| 279 |
+
# define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_format
|
| 280 |
+
|
| 281 |
+
# define _LIBCUDACXX_HAS_NO_VERBOSE_ABORT_IN_LIBRARY
|
| 282 |
+
|
| 283 |
+
#else
|
| 284 |
+
|
| 285 |
+
// ...New vendors can add availability markup here...
|
| 286 |
+
|
| 287 |
+
# error "It looks like you're trying to enable vendor availability markup, but you haven't defined the corresponding macros yet!"
|
| 288 |
+
|
| 289 |
+
#endif
|
| 290 |
+
|
| 291 |
+
// Define availability attributes that depend on _LIBCUDACXX_NO_EXCEPTIONS.
|
| 292 |
+
// Those are defined in terms of the availability attributes above, and
|
| 293 |
+
// should not be vendor-specific.
|
| 294 |
+
#if defined(_LIBCUDACXX_NO_EXCEPTIONS)
|
| 295 |
+
# define _LIBCUDACXX_AVAILABILITY_FUTURE
|
| 296 |
+
# define _LIBCUDACXX_AVAILABILITY_THROW_BAD_ANY_CAST
|
| 297 |
+
# define _LIBCUDACXX_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
|
| 298 |
+
# define _LIBCUDACXX_AVAILABILITY_THROW_BAD_VARIANT_ACCESS
|
| 299 |
+
#else
|
| 300 |
+
# define _LIBCUDACXX_AVAILABILITY_FUTURE _LIBCUDACXX_AVAILABILITY_FUTURE_ERROR
|
| 301 |
+
# define _LIBCUDACXX_AVAILABILITY_THROW_BAD_ANY_CAST _LIBCUDACXX_AVAILABILITY_BAD_ANY_CAST
|
| 302 |
+
# define _LIBCUDACXX_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS _LIBCUDACXX_AVAILABILITY_BAD_OPTIONAL_ACCESS
|
| 303 |
+
# define _LIBCUDACXX_AVAILABILITY_THROW_BAD_VARIANT_ACCESS _LIBCUDACXX_AVAILABILITY_BAD_VARIANT_ACCESS
|
| 304 |
+
#endif
|
| 305 |
+
|
| 306 |
+
#endif // _LIBCUDACXX___AVAILABILITY
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__bit_reference
ADDED
|
@@ -0,0 +1,1293 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// -*- C++ -*-
|
| 2 |
+
//===----------------------------------------------------------------------===//
|
| 3 |
+
//
|
| 4 |
+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
| 5 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 6 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
|
| 10 |
+
#ifndef _LIBCUDACXX___BIT_REFERENCE
|
| 11 |
+
#define _LIBCUDACXX___BIT_REFERENCE
|
| 12 |
+
|
| 13 |
+
#include <__config>
|
| 14 |
+
#include <bit>
|
| 15 |
+
#include <algorithm>
|
| 16 |
+
|
| 17 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 18 |
+
# pragma GCC system_header
|
| 19 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 20 |
+
# pragma clang system_header
|
| 21 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 22 |
+
# pragma system_header
|
| 23 |
+
#endif // no system header
|
| 24 |
+
|
| 25 |
+
_LIBCUDACXX_PUSH_MACROS
|
| 26 |
+
#include <__undef_macros>
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
_LIBCUDACXX_BEGIN_NAMESPACE_STD
|
| 30 |
+
|
| 31 |
+
template <class _Cp, bool _IsConst, typename _Cp::__storage_type = 0> class __bit_iterator;
|
| 32 |
+
template <class _Cp> class __bit_const_reference;
|
| 33 |
+
|
| 34 |
+
template <class _Tp>
|
| 35 |
+
struct __has_storage_type
|
| 36 |
+
{
|
| 37 |
+
static const bool value = false;
|
| 38 |
+
};
|
| 39 |
+
|
| 40 |
+
template <class _Cp, bool = __has_storage_type<_Cp>::value>
|
| 41 |
+
class __bit_reference
|
| 42 |
+
{
|
| 43 |
+
typedef typename _Cp::__storage_type __storage_type;
|
| 44 |
+
typedef typename _Cp::__storage_pointer __storage_pointer;
|
| 45 |
+
|
| 46 |
+
__storage_pointer __seg_;
|
| 47 |
+
__storage_type __mask_;
|
| 48 |
+
|
| 49 |
+
friend typename _Cp::__self;
|
| 50 |
+
|
| 51 |
+
friend class __bit_const_reference<_Cp>;
|
| 52 |
+
friend class __bit_iterator<_Cp, false>;
|
| 53 |
+
public:
|
| 54 |
+
_LIBCUDACXX_INLINE_VISIBILITY
|
| 55 |
+
__bit_reference(const __bit_reference&) = default;
|
| 56 |
+
|
| 57 |
+
_LIBCUDACXX_INLINE_VISIBILITY operator bool() const noexcept
|
| 58 |
+
{return static_cast<bool>(*__seg_ & __mask_);}
|
| 59 |
+
_LIBCUDACXX_INLINE_VISIBILITY bool operator ~() const noexcept
|
| 60 |
+
{return !static_cast<bool>(*this);}
|
| 61 |
+
|
| 62 |
+
_LIBCUDACXX_INLINE_VISIBILITY
|
| 63 |
+
__bit_reference& operator=(bool __x) noexcept
|
| 64 |
+
{
|
| 65 |
+
if (__x)
|
| 66 |
+
*__seg_ |= __mask_;
|
| 67 |
+
else
|
| 68 |
+
*__seg_ &= ~__mask_;
|
| 69 |
+
return *this;
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
_LIBCUDACXX_INLINE_VISIBILITY
|
| 73 |
+
__bit_reference& operator=(const __bit_reference& __x) noexcept
|
| 74 |
+
{return operator=(static_cast<bool>(__x));}
|
| 75 |
+
|
| 76 |
+
_LIBCUDACXX_INLINE_VISIBILITY void flip() noexcept {*__seg_ ^= __mask_;}
|
| 77 |
+
_LIBCUDACXX_INLINE_VISIBILITY __bit_iterator<_Cp, false> operator&() const noexcept
|
| 78 |
+
{return __bit_iterator<_Cp, false>(__seg_, static_cast<unsigned>(__libcpp_ctz(__mask_)));}
|
| 79 |
+
private:
|
| 80 |
+
_LIBCUDACXX_INLINE_VISIBILITY
|
| 81 |
+
__bit_reference(__storage_pointer __s, __storage_type __m) noexcept
|
| 82 |
+
: __seg_(__s), __mask_(__m) {}
|
| 83 |
+
};
|
| 84 |
+
|
| 85 |
+
template <class _Cp>
|
| 86 |
+
class __bit_reference<_Cp, false>
|
| 87 |
+
{
|
| 88 |
+
};
|
| 89 |
+
|
| 90 |
+
template <class _Cp>
|
| 91 |
+
inline _LIBCUDACXX_INLINE_VISIBILITY
|
| 92 |
+
void
|
| 93 |
+
swap(__bit_reference<_Cp> __x, __bit_reference<_Cp> __y) noexcept
|
| 94 |
+
{
|
| 95 |
+
bool __t = __x;
|
| 96 |
+
__x = __y;
|
| 97 |
+
__y = __t;
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
template <class _Cp, class _Dp>
|
| 101 |
+
inline _LIBCUDACXX_INLINE_VISIBILITY
|
| 102 |
+
void
|
| 103 |
+
swap(__bit_reference<_Cp> __x, __bit_reference<_Dp> __y) noexcept
|
| 104 |
+
{
|
| 105 |
+
bool __t = __x;
|
| 106 |
+
__x = __y;
|
| 107 |
+
__y = __t;
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
template <class _Cp>
|
| 111 |
+
inline _LIBCUDACXX_INLINE_VISIBILITY
|
| 112 |
+
void
|
| 113 |
+
swap(__bit_reference<_Cp> __x, bool& __y) noexcept
|
| 114 |
+
{
|
| 115 |
+
bool __t = __x;
|
| 116 |
+
__x = __y;
|
| 117 |
+
__y = __t;
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
template <class _Cp>
|
| 121 |
+
inline _LIBCUDACXX_INLINE_VISIBILITY
|
| 122 |
+
void
|
| 123 |
+
swap(bool& __x, __bit_reference<_Cp> __y) noexcept
|
| 124 |
+
{
|
| 125 |
+
bool __t = __x;
|
| 126 |
+
__x = __y;
|
| 127 |
+
__y = __t;
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
template <class _Cp>
|
| 131 |
+
class __bit_const_reference
|
| 132 |
+
{
|
| 133 |
+
typedef typename _Cp::__storage_type __storage_type;
|
| 134 |
+
typedef typename _Cp::__const_storage_pointer __storage_pointer;
|
| 135 |
+
|
| 136 |
+
__storage_pointer __seg_;
|
| 137 |
+
__storage_type __mask_;
|
| 138 |
+
|
| 139 |
+
friend typename _Cp::__self;
|
| 140 |
+
friend class __bit_iterator<_Cp, true>;
|
| 141 |
+
public:
|
| 142 |
+
_LIBCUDACXX_INLINE_VISIBILITY
|
| 143 |
+
__bit_const_reference(const __bit_const_reference&) = default;
|
| 144 |
+
|
| 145 |
+
_LIBCUDACXX_INLINE_VISIBILITY
|
| 146 |
+
__bit_const_reference(const __bit_reference<_Cp>& __x) noexcept
|
| 147 |
+
: __seg_(__x.__seg_), __mask_(__x.__mask_) {}
|
| 148 |
+
|
| 149 |
+
_LIBCUDACXX_INLINE_VISIBILITY constexpr operator bool() const noexcept
|
| 150 |
+
{return static_cast<bool>(*__seg_ & __mask_);}
|
| 151 |
+
|
| 152 |
+
_LIBCUDACXX_INLINE_VISIBILITY __bit_iterator<_Cp, true> operator&() const noexcept
|
| 153 |
+
{return __bit_iterator<_Cp, true>(__seg_, static_cast<unsigned>(__libcpp_ctz(__mask_)));}
|
| 154 |
+
private:
|
| 155 |
+
_LIBCUDACXX_INLINE_VISIBILITY
|
| 156 |
+
constexpr
|
| 157 |
+
__bit_const_reference(__storage_pointer __s, __storage_type __m) noexcept
|
| 158 |
+
: __seg_(__s), __mask_(__m) {}
|
| 159 |
+
|
| 160 |
+
__bit_const_reference& operator=(const __bit_const_reference&) = delete;
|
| 161 |
+
};
|
| 162 |
+
|
| 163 |
+
// find
|
| 164 |
+
|
| 165 |
+
template <class _Cp, bool _IsConst>
|
| 166 |
+
__bit_iterator<_Cp, _IsConst>
|
| 167 |
+
__find_bool_true(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n)
|
| 168 |
+
{
|
| 169 |
+
typedef __bit_iterator<_Cp, _IsConst> _It;
|
| 170 |
+
typedef typename _It::__storage_type __storage_type;
|
| 171 |
+
static const int __bits_per_word = _It::__bits_per_word;
|
| 172 |
+
// do first partial word
|
| 173 |
+
if (__first.__ctz_ != 0)
|
| 174 |
+
{
|
| 175 |
+
__storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
|
| 176 |
+
__storage_type __dn = _CUDA_VSTD::min(__clz_f, __n);
|
| 177 |
+
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
| 178 |
+
__storage_type __b = *__first.__seg_ & __m;
|
| 179 |
+
if (__b)
|
| 180 |
+
return _It(__first.__seg_, static_cast<unsigned>(_CUDA_VSTD::__libcpp_ctz(__b)));
|
| 181 |
+
if (__n == __dn)
|
| 182 |
+
return __first + __n;
|
| 183 |
+
__n -= __dn;
|
| 184 |
+
++__first.__seg_;
|
| 185 |
+
}
|
| 186 |
+
// do middle whole words
|
| 187 |
+
for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word)
|
| 188 |
+
if (*__first.__seg_)
|
| 189 |
+
return _It(__first.__seg_, static_cast<unsigned>(_CUDA_VSTD::__libcpp_ctz(*__first.__seg_)));
|
| 190 |
+
// do last partial word
|
| 191 |
+
if (__n > 0)
|
| 192 |
+
{
|
| 193 |
+
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
|
| 194 |
+
__storage_type __b = *__first.__seg_ & __m;
|
| 195 |
+
if (__b)
|
| 196 |
+
return _It(__first.__seg_, static_cast<unsigned>(_CUDA_VSTD::__libcpp_ctz(__b)));
|
| 197 |
+
}
|
| 198 |
+
return _It(__first.__seg_, static_cast<unsigned>(__n));
|
| 199 |
+
}
|
| 200 |
+
|
| 201 |
+
template <class _Cp, bool _IsConst>
|
| 202 |
+
__bit_iterator<_Cp, _IsConst>
|
| 203 |
+
__find_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n)
|
| 204 |
+
{
|
| 205 |
+
typedef __bit_iterator<_Cp, _IsConst> _It;
|
| 206 |
+
typedef typename _It::__storage_type __storage_type;
|
| 207 |
+
const int __bits_per_word = _It::__bits_per_word;
|
| 208 |
+
// do first partial word
|
| 209 |
+
if (__first.__ctz_ != 0)
|
| 210 |
+
{
|
| 211 |
+
__storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
|
| 212 |
+
__storage_type __dn = _CUDA_VSTD::min(__clz_f, __n);
|
| 213 |
+
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
| 214 |
+
__storage_type __b = ~*__first.__seg_ & __m;
|
| 215 |
+
if (__b)
|
| 216 |
+
return _It(__first.__seg_, static_cast<unsigned>(_CUDA_VSTD::__libcpp_ctz(__b)));
|
| 217 |
+
if (__n == __dn)
|
| 218 |
+
return __first + __n;
|
| 219 |
+
__n -= __dn;
|
| 220 |
+
++__first.__seg_;
|
| 221 |
+
}
|
| 222 |
+
// do middle whole words
|
| 223 |
+
for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word)
|
| 224 |
+
{
|
| 225 |
+
__storage_type __b = ~*__first.__seg_;
|
| 226 |
+
if (__b)
|
| 227 |
+
return _It(__first.__seg_, static_cast<unsigned>(_CUDA_VSTD::__libcpp_ctz(__b)));
|
| 228 |
+
}
|
| 229 |
+
// do last partial word
|
| 230 |
+
if (__n > 0)
|
| 231 |
+
{
|
| 232 |
+
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
|
| 233 |
+
__storage_type __b = ~*__first.__seg_ & __m;
|
| 234 |
+
if (__b)
|
| 235 |
+
return _It(__first.__seg_, static_cast<unsigned>(_CUDA_VSTD::__libcpp_ctz(__b)));
|
| 236 |
+
}
|
| 237 |
+
return _It(__first.__seg_, static_cast<unsigned>(__n));
|
| 238 |
+
}
|
| 239 |
+
|
| 240 |
+
template <class _Cp, bool _IsConst, class _Tp>
|
| 241 |
+
inline _LIBCUDACXX_INLINE_VISIBILITY
|
| 242 |
+
__bit_iterator<_Cp, _IsConst>
|
| 243 |
+
find(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value_)
|
| 244 |
+
{
|
| 245 |
+
if (static_cast<bool>(__value_))
|
| 246 |
+
return __find_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first));
|
| 247 |
+
return __find_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first));
|
| 248 |
+
}
|
| 249 |
+
|
| 250 |
+
// count
|
| 251 |
+
|
| 252 |
+
template <class _Cp, bool _IsConst>
|
| 253 |
+
typename __bit_iterator<_Cp, _IsConst>::difference_type
|
| 254 |
+
__count_bool_true(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n)
|
| 255 |
+
{
|
| 256 |
+
typedef __bit_iterator<_Cp, _IsConst> _It;
|
| 257 |
+
typedef typename _It::__storage_type __storage_type;
|
| 258 |
+
typedef typename _It::difference_type difference_type;
|
| 259 |
+
const int __bits_per_word = _It::__bits_per_word;
|
| 260 |
+
difference_type __r = 0;
|
| 261 |
+
// do first partial word
|
| 262 |
+
if (__first.__ctz_ != 0)
|
| 263 |
+
{
|
| 264 |
+
__storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
|
| 265 |
+
__storage_type __dn = _CUDA_VSTD::min(__clz_f, __n);
|
| 266 |
+
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
| 267 |
+
__r = _CUDA_VSTD::__libcpp_popcount(*__first.__seg_ & __m);
|
| 268 |
+
__n -= __dn;
|
| 269 |
+
++__first.__seg_;
|
| 270 |
+
}
|
| 271 |
+
// do middle whole words
|
| 272 |
+
for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word)
|
| 273 |
+
__r += _CUDA_VSTD::__libcpp_popcount(*__first.__seg_);
|
| 274 |
+
// do last partial word
|
| 275 |
+
if (__n > 0)
|
| 276 |
+
{
|
| 277 |
+
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
|
| 278 |
+
__r += _CUDA_VSTD::__libcpp_popcount(*__first.__seg_ & __m);
|
| 279 |
+
}
|
| 280 |
+
return __r;
|
| 281 |
+
}
|
| 282 |
+
|
| 283 |
+
template <class _Cp, bool _IsConst>
|
| 284 |
+
typename __bit_iterator<_Cp, _IsConst>::difference_type
|
| 285 |
+
__count_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n)
|
| 286 |
+
{
|
| 287 |
+
typedef __bit_iterator<_Cp, _IsConst> _It;
|
| 288 |
+
typedef typename _It::__storage_type __storage_type;
|
| 289 |
+
typedef typename _It::difference_type difference_type;
|
| 290 |
+
const int __bits_per_word = _It::__bits_per_word;
|
| 291 |
+
difference_type __r = 0;
|
| 292 |
+
// do first partial word
|
| 293 |
+
if (__first.__ctz_ != 0)
|
| 294 |
+
{
|
| 295 |
+
__storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
|
| 296 |
+
__storage_type __dn = _CUDA_VSTD::min(__clz_f, __n);
|
| 297 |
+
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
| 298 |
+
__r = _CUDA_VSTD::__libcpp_popcount(~*__first.__seg_ & __m);
|
| 299 |
+
__n -= __dn;
|
| 300 |
+
++__first.__seg_;
|
| 301 |
+
}
|
| 302 |
+
// do middle whole words
|
| 303 |
+
for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word)
|
| 304 |
+
__r += _CUDA_VSTD::__libcpp_popcount(~*__first.__seg_);
|
| 305 |
+
// do last partial word
|
| 306 |
+
if (__n > 0)
|
| 307 |
+
{
|
| 308 |
+
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
|
| 309 |
+
__r += _CUDA_VSTD::__libcpp_popcount(~*__first.__seg_ & __m);
|
| 310 |
+
}
|
| 311 |
+
return __r;
|
| 312 |
+
}
|
| 313 |
+
|
| 314 |
+
template <class _Cp, bool _IsConst, class _Tp>
|
| 315 |
+
inline _LIBCUDACXX_INLINE_VISIBILITY
|
| 316 |
+
typename __bit_iterator<_Cp, _IsConst>::difference_type
|
| 317 |
+
count(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value_)
|
| 318 |
+
{
|
| 319 |
+
if (static_cast<bool>(__value_))
|
| 320 |
+
return __count_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first));
|
| 321 |
+
return __count_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first));
|
| 322 |
+
}
|
| 323 |
+
|
| 324 |
+
// fill_n
|
| 325 |
+
|
| 326 |
+
template <class _Cp>
|
| 327 |
+
void
|
| 328 |
+
__fill_n_false(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n)
|
| 329 |
+
{
|
| 330 |
+
typedef __bit_iterator<_Cp, false> _It;
|
| 331 |
+
typedef typename _It::__storage_type __storage_type;
|
| 332 |
+
const int __bits_per_word = _It::__bits_per_word;
|
| 333 |
+
// do first partial word
|
| 334 |
+
if (__first.__ctz_ != 0)
|
| 335 |
+
{
|
| 336 |
+
__storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
|
| 337 |
+
__storage_type __dn = _CUDA_VSTD::min(__clz_f, __n);
|
| 338 |
+
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
| 339 |
+
*__first.__seg_ &= ~__m;
|
| 340 |
+
__n -= __dn;
|
| 341 |
+
++__first.__seg_;
|
| 342 |
+
}
|
| 343 |
+
// do middle whole words
|
| 344 |
+
__storage_type __nw = __n / __bits_per_word;
|
| 345 |
+
_CUDA_VSTD::memset(_CUDA_VSTD::__to_raw_pointer(__first.__seg_), 0, __nw * sizeof(__storage_type));
|
| 346 |
+
__n -= __nw * __bits_per_word;
|
| 347 |
+
// do last partial word
|
| 348 |
+
if (__n > 0)
|
| 349 |
+
{
|
| 350 |
+
__first.__seg_ += __nw;
|
| 351 |
+
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
|
| 352 |
+
*__first.__seg_ &= ~__m;
|
| 353 |
+
}
|
| 354 |
+
}
|
| 355 |
+
|
| 356 |
+
template <class _Cp>
|
| 357 |
+
void
|
| 358 |
+
__fill_n_true(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n)
|
| 359 |
+
{
|
| 360 |
+
typedef __bit_iterator<_Cp, false> _It;
|
| 361 |
+
typedef typename _It::__storage_type __storage_type;
|
| 362 |
+
const int __bits_per_word = _It::__bits_per_word;
|
| 363 |
+
// do first partial word
|
| 364 |
+
if (__first.__ctz_ != 0)
|
| 365 |
+
{
|
| 366 |
+
__storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
|
| 367 |
+
__storage_type __dn = _CUDA_VSTD::min(__clz_f, __n);
|
| 368 |
+
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
| 369 |
+
*__first.__seg_ |= __m;
|
| 370 |
+
__n -= __dn;
|
| 371 |
+
++__first.__seg_;
|
| 372 |
+
}
|
| 373 |
+
// do middle whole words
|
| 374 |
+
__storage_type __nw = __n / __bits_per_word;
|
| 375 |
+
_CUDA_VSTD::memset(_CUDA_VSTD::__to_raw_pointer(__first.__seg_), -1, __nw * sizeof(__storage_type));
|
| 376 |
+
__n -= __nw * __bits_per_word;
|
| 377 |
+
// do last partial word
|
| 378 |
+
if (__n > 0)
|
| 379 |
+
{
|
| 380 |
+
__first.__seg_ += __nw;
|
| 381 |
+
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
|
| 382 |
+
*__first.__seg_ |= __m;
|
| 383 |
+
}
|
| 384 |
+
}
|
| 385 |
+
|
| 386 |
+
template <class _Cp>
|
| 387 |
+
inline _LIBCUDACXX_INLINE_VISIBILITY
|
| 388 |
+
void
|
| 389 |
+
fill_n(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n, bool __value_)
|
| 390 |
+
{
|
| 391 |
+
if (__n > 0)
|
| 392 |
+
{
|
| 393 |
+
if (__value_)
|
| 394 |
+
__fill_n_true(__first, __n);
|
| 395 |
+
else
|
| 396 |
+
__fill_n_false(__first, __n);
|
| 397 |
+
}
|
| 398 |
+
}
|
| 399 |
+
|
| 400 |
+
// fill
|
| 401 |
+
|
| 402 |
+
template <class _Cp>
|
| 403 |
+
inline _LIBCUDACXX_INLINE_VISIBILITY
|
| 404 |
+
void
|
| 405 |
+
fill(__bit_iterator<_Cp, false> __first, __bit_iterator<_Cp, false> __last, bool __value_)
|
| 406 |
+
{
|
| 407 |
+
_CUDA_VSTD::fill_n(__first, static_cast<typename _Cp::size_type>(__last - __first), __value_);
|
| 408 |
+
}
|
| 409 |
+
|
| 410 |
+
// copy
|
| 411 |
+
|
| 412 |
+
template <class _Cp, bool _IsConst>
|
| 413 |
+
__bit_iterator<_Cp, false>
|
| 414 |
+
__copy_aligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last,
|
| 415 |
+
__bit_iterator<_Cp, false> __result)
|
| 416 |
+
{
|
| 417 |
+
typedef __bit_iterator<_Cp, _IsConst> _In;
|
| 418 |
+
typedef typename _In::difference_type difference_type;
|
| 419 |
+
typedef typename _In::__storage_type __storage_type;
|
| 420 |
+
const int __bits_per_word = _In::__bits_per_word;
|
| 421 |
+
difference_type __n = __last - __first;
|
| 422 |
+
if (__n > 0)
|
| 423 |
+
{
|
| 424 |
+
// do first word
|
| 425 |
+
if (__first.__ctz_ != 0)
|
| 426 |
+
{
|
| 427 |
+
unsigned __clz = __bits_per_word - __first.__ctz_;
|
| 428 |
+
difference_type __dn = _CUDA_VSTD::min(static_cast<difference_type>(__clz), __n);
|
| 429 |
+
__n -= __dn;
|
| 430 |
+
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz - __dn));
|
| 431 |
+
__storage_type __b = *__first.__seg_ & __m;
|
| 432 |
+
*__result.__seg_ &= ~__m;
|
| 433 |
+
*__result.__seg_ |= __b;
|
| 434 |
+
__result.__seg_ += (__dn + __result.__ctz_) / __bits_per_word;
|
| 435 |
+
__result.__ctz_ = static_cast<unsigned>((__dn + __result.__ctz_) % __bits_per_word);
|
| 436 |
+
++__first.__seg_;
|
| 437 |
+
// __first.__ctz_ = 0;
|
| 438 |
+
}
|
| 439 |
+
// __first.__ctz_ == 0;
|
| 440 |
+
// do middle words
|
| 441 |
+
__storage_type __nw = __n / __bits_per_word;
|
| 442 |
+
_CUDA_VSTD::memmove(_CUDA_VSTD::__to_raw_pointer(__result.__seg_),
|
| 443 |
+
_CUDA_VSTD::__to_raw_pointer(__first.__seg_),
|
| 444 |
+
__nw * sizeof(__storage_type));
|
| 445 |
+
__n -= __nw * __bits_per_word;
|
| 446 |
+
__result.__seg_ += __nw;
|
| 447 |
+
// do last word
|
| 448 |
+
if (__n > 0)
|
| 449 |
+
{
|
| 450 |
+
__first.__seg_ += __nw;
|
| 451 |
+
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
|
| 452 |
+
__storage_type __b = *__first.__seg_ & __m;
|
| 453 |
+
*__result.__seg_ &= ~__m;
|
| 454 |
+
*__result.__seg_ |= __b;
|
| 455 |
+
__result.__ctz_ = static_cast<unsigned>(__n);
|
| 456 |
+
}
|
| 457 |
+
}
|
| 458 |
+
return __result;
|
| 459 |
+
}
|
| 460 |
+
|
| 461 |
+
template <class _Cp, bool _IsConst>
|
| 462 |
+
__bit_iterator<_Cp, false>
|
| 463 |
+
__copy_unaligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last,
|
| 464 |
+
__bit_iterator<_Cp, false> __result)
|
| 465 |
+
{
|
| 466 |
+
typedef __bit_iterator<_Cp, _IsConst> _In;
|
| 467 |
+
typedef typename _In::difference_type difference_type;
|
| 468 |
+
typedef typename _In::__storage_type __storage_type;
|
| 469 |
+
static const int __bits_per_word = _In::__bits_per_word;
|
| 470 |
+
difference_type __n = __last - __first;
|
| 471 |
+
if (__n > 0)
|
| 472 |
+
{
|
| 473 |
+
// do first word
|
| 474 |
+
if (__first.__ctz_ != 0)
|
| 475 |
+
{
|
| 476 |
+
unsigned __clz_f = __bits_per_word - __first.__ctz_;
|
| 477 |
+
difference_type __dn = _CUDA_VSTD::min(static_cast<difference_type>(__clz_f), __n);
|
| 478 |
+
__n -= __dn;
|
| 479 |
+
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
| 480 |
+
__storage_type __b = *__first.__seg_ & __m;
|
| 481 |
+
unsigned __clz_r = __bits_per_word - __result.__ctz_;
|
| 482 |
+
__storage_type __ddn = _CUDA_VSTD::min<__storage_type>(__dn, __clz_r);
|
| 483 |
+
__m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __ddn));
|
| 484 |
+
*__result.__seg_ &= ~__m;
|
| 485 |
+
if (__result.__ctz_ > __first.__ctz_)
|
| 486 |
+
*__result.__seg_ |= __b << (__result.__ctz_ - __first.__ctz_);
|
| 487 |
+
else
|
| 488 |
+
*__result.__seg_ |= __b >> (__first.__ctz_ - __result.__ctz_);
|
| 489 |
+
__result.__seg_ += (__ddn + __result.__ctz_) / __bits_per_word;
|
| 490 |
+
__result.__ctz_ = static_cast<unsigned>((__ddn + __result.__ctz_) % __bits_per_word);
|
| 491 |
+
__dn -= __ddn;
|
| 492 |
+
if (__dn > 0)
|
| 493 |
+
{
|
| 494 |
+
__m = ~__storage_type(0) >> (__bits_per_word - __dn);
|
| 495 |
+
*__result.__seg_ &= ~__m;
|
| 496 |
+
*__result.__seg_ |= __b >> (__first.__ctz_ + __ddn);
|
| 497 |
+
__result.__ctz_ = static_cast<unsigned>(__dn);
|
| 498 |
+
}
|
| 499 |
+
++__first.__seg_;
|
| 500 |
+
// __first.__ctz_ = 0;
|
| 501 |
+
}
|
| 502 |
+
// __first.__ctz_ == 0;
|
| 503 |
+
// do middle words
|
| 504 |
+
unsigned __clz_r = __bits_per_word - __result.__ctz_;
|
| 505 |
+
__storage_type __m = ~__storage_type(0) << __result.__ctz_;
|
| 506 |
+
for (; __n >= __bits_per_word; __n -= __bits_per_word, ++__first.__seg_)
|
| 507 |
+
{
|
| 508 |
+
__storage_type __b = *__first.__seg_;
|
| 509 |
+
*__result.__seg_ &= ~__m;
|
| 510 |
+
*__result.__seg_ |= __b << __result.__ctz_;
|
| 511 |
+
++__result.__seg_;
|
| 512 |
+
*__result.__seg_ &= __m;
|
| 513 |
+
*__result.__seg_ |= __b >> __clz_r;
|
| 514 |
+
}
|
| 515 |
+
// do last word
|
| 516 |
+
if (__n > 0)
|
| 517 |
+
{
|
| 518 |
+
__m = ~__storage_type(0) >> (__bits_per_word - __n);
|
| 519 |
+
__storage_type __b = *__first.__seg_ & __m;
|
| 520 |
+
__storage_type __dn = _CUDA_VSTD::min(__n, static_cast<difference_type>(__clz_r));
|
| 521 |
+
__m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __dn));
|
| 522 |
+
*__result.__seg_ &= ~__m;
|
| 523 |
+
*__result.__seg_ |= __b << __result.__ctz_;
|
| 524 |
+
__result.__seg_ += (__dn + __result.__ctz_) / __bits_per_word;
|
| 525 |
+
__result.__ctz_ = static_cast<unsigned>((__dn + __result.__ctz_) % __bits_per_word);
|
| 526 |
+
__n -= __dn;
|
| 527 |
+
if (__n > 0)
|
| 528 |
+
{
|
| 529 |
+
__m = ~__storage_type(0) >> (__bits_per_word - __n);
|
| 530 |
+
*__result.__seg_ &= ~__m;
|
| 531 |
+
*__result.__seg_ |= __b >> __dn;
|
| 532 |
+
__result.__ctz_ = static_cast<unsigned>(__n);
|
| 533 |
+
}
|
| 534 |
+
}
|
| 535 |
+
}
|
| 536 |
+
return __result;
|
| 537 |
+
}
|
| 538 |
+
|
| 539 |
+
template <class _Cp, bool _IsConst>
|
| 540 |
+
inline _LIBCUDACXX_INLINE_VISIBILITY
|
| 541 |
+
__bit_iterator<_Cp, false>
|
| 542 |
+
copy(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result)
|
| 543 |
+
{
|
| 544 |
+
if (__first.__ctz_ == __result.__ctz_)
|
| 545 |
+
return __copy_aligned(__first, __last, __result);
|
| 546 |
+
return __copy_unaligned(__first, __last, __result);
|
| 547 |
+
}
|
| 548 |
+
|
| 549 |
+
// copy_backward
|
| 550 |
+
|
| 551 |
+
template <class _Cp, bool _IsConst>
|
| 552 |
+
__bit_iterator<_Cp, false>
|
| 553 |
+
__copy_backward_aligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last,
|
| 554 |
+
__bit_iterator<_Cp, false> __result)
|
| 555 |
+
{
|
| 556 |
+
typedef __bit_iterator<_Cp, _IsConst> _In;
|
| 557 |
+
typedef typename _In::difference_type difference_type;
|
| 558 |
+
typedef typename _In::__storage_type __storage_type;
|
| 559 |
+
const int __bits_per_word = _In::__bits_per_word;
|
| 560 |
+
difference_type __n = __last - __first;
|
| 561 |
+
if (__n > 0)
|
| 562 |
+
{
|
| 563 |
+
// do first word
|
| 564 |
+
if (__last.__ctz_ != 0)
|
| 565 |
+
{
|
| 566 |
+
difference_type __dn = _CUDA_VSTD::min(static_cast<difference_type>(__last.__ctz_), __n);
|
| 567 |
+
__n -= __dn;
|
| 568 |
+
unsigned __clz = __bits_per_word - __last.__ctz_;
|
| 569 |
+
__storage_type __m = (~__storage_type(0) << (__last.__ctz_ - __dn)) & (~__storage_type(0) >> __clz);
|
| 570 |
+
__storage_type __b = *__last.__seg_ & __m;
|
| 571 |
+
*__result.__seg_ &= ~__m;
|
| 572 |
+
*__result.__seg_ |= __b;
|
| 573 |
+
__result.__ctz_ = static_cast<unsigned>(((-__dn & (__bits_per_word - 1)) +
|
| 574 |
+
__result.__ctz_) % __bits_per_word);
|
| 575 |
+
// __last.__ctz_ = 0
|
| 576 |
+
}
|
| 577 |
+
// __last.__ctz_ == 0 || __n == 0
|
| 578 |
+
// __result.__ctz_ == 0 || __n == 0
|
| 579 |
+
// do middle words
|
| 580 |
+
__storage_type __nw = __n / __bits_per_word;
|
| 581 |
+
__result.__seg_ -= __nw;
|
| 582 |
+
__last.__seg_ -= __nw;
|
| 583 |
+
_CUDA_VSTD::memmove(_CUDA_VSTD::__to_raw_pointer(__result.__seg_),
|
| 584 |
+
_CUDA_VSTD::__to_raw_pointer(__last.__seg_),
|
| 585 |
+
__nw * sizeof(__storage_type));
|
| 586 |
+
__n -= __nw * __bits_per_word;
|
| 587 |
+
// do last word
|
| 588 |
+
if (__n > 0)
|
| 589 |
+
{
|
| 590 |
+
__storage_type __m = ~__storage_type(0) << (__bits_per_word - __n);
|
| 591 |
+
__storage_type __b = *--__last.__seg_ & __m;
|
| 592 |
+
*--__result.__seg_ &= ~__m;
|
| 593 |
+
*__result.__seg_ |= __b;
|
| 594 |
+
__result.__ctz_ = static_cast<unsigned>(-__n & (__bits_per_word - 1));
|
| 595 |
+
}
|
| 596 |
+
}
|
| 597 |
+
return __result;
|
| 598 |
+
}
|
| 599 |
+
|
| 600 |
+
template <class _Cp, bool _IsConst>
|
| 601 |
+
__bit_iterator<_Cp, false>
|
| 602 |
+
__copy_backward_unaligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last,
|
| 603 |
+
__bit_iterator<_Cp, false> __result)
|
| 604 |
+
{
|
| 605 |
+
typedef __bit_iterator<_Cp, _IsConst> _In;
|
| 606 |
+
typedef typename _In::difference_type difference_type;
|
| 607 |
+
typedef typename _In::__storage_type __storage_type;
|
| 608 |
+
const int __bits_per_word = _In::__bits_per_word;
|
| 609 |
+
difference_type __n = __last - __first;
|
| 610 |
+
if (__n > 0)
|
| 611 |
+
{
|
| 612 |
+
// do first word
|
| 613 |
+
if (__last.__ctz_ != 0)
|
| 614 |
+
{
|
| 615 |
+
difference_type __dn = _CUDA_VSTD::min(static_cast<difference_type>(__last.__ctz_), __n);
|
| 616 |
+
__n -= __dn;
|
| 617 |
+
unsigned __clz_l = __bits_per_word - __last.__ctz_;
|
| 618 |
+
__storage_type __m = (~__storage_type(0) << (__last.__ctz_ - __dn)) & (~__storage_type(0) >> __clz_l);
|
| 619 |
+
__storage_type __b = *__last.__seg_ & __m;
|
| 620 |
+
unsigned __clz_r = __bits_per_word - __result.__ctz_;
|
| 621 |
+
__storage_type __ddn = _CUDA_VSTD::min(__dn, static_cast<difference_type>(__result.__ctz_));
|
| 622 |
+
if (__ddn > 0)
|
| 623 |
+
{
|
| 624 |
+
__m = (~__storage_type(0) << (__result.__ctz_ - __ddn)) & (~__storage_type(0) >> __clz_r);
|
| 625 |
+
*__result.__seg_ &= ~__m;
|
| 626 |
+
if (__result.__ctz_ > __last.__ctz_)
|
| 627 |
+
*__result.__seg_ |= __b << (__result.__ctz_ - __last.__ctz_);
|
| 628 |
+
else
|
| 629 |
+
*__result.__seg_ |= __b >> (__last.__ctz_ - __result.__ctz_);
|
| 630 |
+
__result.__ctz_ = static_cast<unsigned>(((-__ddn & (__bits_per_word - 1)) +
|
| 631 |
+
__result.__ctz_) % __bits_per_word);
|
| 632 |
+
__dn -= __ddn;
|
| 633 |
+
}
|
| 634 |
+
if (__dn > 0)
|
| 635 |
+
{
|
| 636 |
+
// __result.__ctz_ == 0
|
| 637 |
+
--__result.__seg_;
|
| 638 |
+
__result.__ctz_ = static_cast<unsigned>(-__dn & (__bits_per_word - 1));
|
| 639 |
+
__m = ~__storage_type(0) << __result.__ctz_;
|
| 640 |
+
*__result.__seg_ &= ~__m;
|
| 641 |
+
__last.__ctz_ -= __dn + __ddn;
|
| 642 |
+
*__result.__seg_ |= __b << (__result.__ctz_ - __last.__ctz_);
|
| 643 |
+
}
|
| 644 |
+
// __last.__ctz_ = 0
|
| 645 |
+
}
|
| 646 |
+
// __last.__ctz_ == 0 || __n == 0
|
| 647 |
+
// __result.__ctz_ != 0 || __n == 0
|
| 648 |
+
// do middle words
|
| 649 |
+
unsigned __clz_r = __bits_per_word - __result.__ctz_;
|
| 650 |
+
__storage_type __m = ~__storage_type(0) >> __clz_r;
|
| 651 |
+
for (; __n >= __bits_per_word; __n -= __bits_per_word)
|
| 652 |
+
{
|
| 653 |
+
__storage_type __b = *--__last.__seg_;
|
| 654 |
+
*__result.__seg_ &= ~__m;
|
| 655 |
+
*__result.__seg_ |= __b >> __clz_r;
|
| 656 |
+
*--__result.__seg_ &= __m;
|
| 657 |
+
*__result.__seg_ |= __b << __result.__ctz_;
|
| 658 |
+
}
|
| 659 |
+
// do last word
|
| 660 |
+
if (__n > 0)
|
| 661 |
+
{
|
| 662 |
+
__m = ~__storage_type(0) << (__bits_per_word - __n);
|
| 663 |
+
__storage_type __b = *--__last.__seg_ & __m;
|
| 664 |
+
__clz_r = __bits_per_word - __result.__ctz_;
|
| 665 |
+
__storage_type __dn = _CUDA_VSTD::min(__n, static_cast<difference_type>(__result.__ctz_));
|
| 666 |
+
__m = (~__storage_type(0) << (__result.__ctz_ - __dn)) & (~__storage_type(0) >> __clz_r);
|
| 667 |
+
*__result.__seg_ &= ~__m;
|
| 668 |
+
*__result.__seg_ |= __b >> (__bits_per_word - __result.__ctz_);
|
| 669 |
+
__result.__ctz_ = static_cast<unsigned>(((-__dn & (__bits_per_word - 1)) +
|
| 670 |
+
__result.__ctz_) % __bits_per_word);
|
| 671 |
+
__n -= __dn;
|
| 672 |
+
if (__n > 0)
|
| 673 |
+
{
|
| 674 |
+
// __result.__ctz_ == 0
|
| 675 |
+
--__result.__seg_;
|
| 676 |
+
__result.__ctz_ = static_cast<unsigned>(-__n & (__bits_per_word - 1));
|
| 677 |
+
__m = ~__storage_type(0) << __result.__ctz_;
|
| 678 |
+
*__result.__seg_ &= ~__m;
|
| 679 |
+
*__result.__seg_ |= __b << (__result.__ctz_ - (__bits_per_word - __n - __dn));
|
| 680 |
+
}
|
| 681 |
+
}
|
| 682 |
+
}
|
| 683 |
+
return __result;
|
| 684 |
+
}
|
| 685 |
+
|
| 686 |
+
template <class _Cp, bool _IsConst>
|
| 687 |
+
inline _LIBCUDACXX_INLINE_VISIBILITY
|
| 688 |
+
__bit_iterator<_Cp, false>
|
| 689 |
+
copy_backward(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result)
|
| 690 |
+
{
|
| 691 |
+
if (__last.__ctz_ == __result.__ctz_)
|
| 692 |
+
return __copy_backward_aligned(__first, __last, __result);
|
| 693 |
+
return __copy_backward_unaligned(__first, __last, __result);
|
| 694 |
+
}
|
| 695 |
+
|
| 696 |
+
// move
|
| 697 |
+
|
| 698 |
+
template <class _Cp, bool _IsConst>
|
| 699 |
+
inline _LIBCUDACXX_INLINE_VISIBILITY
|
| 700 |
+
__bit_iterator<_Cp, false>
|
| 701 |
+
move(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result)
|
| 702 |
+
{
|
| 703 |
+
return _CUDA_VSTD::copy(__first, __last, __result);
|
| 704 |
+
}
|
| 705 |
+
|
| 706 |
+
// move_backward
|
| 707 |
+
|
| 708 |
+
template <class _Cp, bool _IsConst>
|
| 709 |
+
inline _LIBCUDACXX_INLINE_VISIBILITY
|
| 710 |
+
__bit_iterator<_Cp, false>
|
| 711 |
+
move_backward(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result)
|
| 712 |
+
{
|
| 713 |
+
return _CUDA_VSTD::copy_backward(__first, __last, __result);
|
| 714 |
+
}
|
| 715 |
+
|
| 716 |
+
// swap_ranges
|
| 717 |
+
|
| 718 |
+
template <class __C1, class __C2>
|
| 719 |
+
__bit_iterator<__C2, false>
|
| 720 |
+
__swap_ranges_aligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1, false> __last,
|
| 721 |
+
__bit_iterator<__C2, false> __result)
|
| 722 |
+
{
|
| 723 |
+
typedef __bit_iterator<__C1, false> _I1;
|
| 724 |
+
typedef typename _I1::difference_type difference_type;
|
| 725 |
+
typedef typename _I1::__storage_type __storage_type;
|
| 726 |
+
const int __bits_per_word = _I1::__bits_per_word;
|
| 727 |
+
difference_type __n = __last - __first;
|
| 728 |
+
if (__n > 0)
|
| 729 |
+
{
|
| 730 |
+
// do first word
|
| 731 |
+
if (__first.__ctz_ != 0)
|
| 732 |
+
{
|
| 733 |
+
unsigned __clz = __bits_per_word - __first.__ctz_;
|
| 734 |
+
difference_type __dn = _CUDA_VSTD::min(static_cast<difference_type>(__clz), __n);
|
| 735 |
+
__n -= __dn;
|
| 736 |
+
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz - __dn));
|
| 737 |
+
__storage_type __b1 = *__first.__seg_ & __m;
|
| 738 |
+
*__first.__seg_ &= ~__m;
|
| 739 |
+
__storage_type __b2 = *__result.__seg_ & __m;
|
| 740 |
+
*__result.__seg_ &= ~__m;
|
| 741 |
+
*__result.__seg_ |= __b1;
|
| 742 |
+
*__first.__seg_ |= __b2;
|
| 743 |
+
__result.__seg_ += (__dn + __result.__ctz_) / __bits_per_word;
|
| 744 |
+
__result.__ctz_ = static_cast<unsigned>((__dn + __result.__ctz_) % __bits_per_word);
|
| 745 |
+
++__first.__seg_;
|
| 746 |
+
// __first.__ctz_ = 0;
|
| 747 |
+
}
|
| 748 |
+
// __first.__ctz_ == 0;
|
| 749 |
+
// do middle words
|
| 750 |
+
for (; __n >= __bits_per_word; __n -= __bits_per_word, ++__first.__seg_, ++__result.__seg_)
|
| 751 |
+
swap(*__first.__seg_, *__result.__seg_);
|
| 752 |
+
// do last word
|
| 753 |
+
if (__n > 0)
|
| 754 |
+
{
|
| 755 |
+
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
|
| 756 |
+
__storage_type __b1 = *__first.__seg_ & __m;
|
| 757 |
+
*__first.__seg_ &= ~__m;
|
| 758 |
+
__storage_type __b2 = *__result.__seg_ & __m;
|
| 759 |
+
*__result.__seg_ &= ~__m;
|
| 760 |
+
*__result.__seg_ |= __b1;
|
| 761 |
+
*__first.__seg_ |= __b2;
|
| 762 |
+
__result.__ctz_ = static_cast<unsigned>(__n);
|
| 763 |
+
}
|
| 764 |
+
}
|
| 765 |
+
return __result;
|
| 766 |
+
}
|
| 767 |
+
|
| 768 |
+
template <class __C1, class __C2>
|
| 769 |
+
__bit_iterator<__C2, false>
|
| 770 |
+
__swap_ranges_unaligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1, false> __last,
|
| 771 |
+
__bit_iterator<__C2, false> __result)
|
| 772 |
+
{
|
| 773 |
+
typedef __bit_iterator<__C1, false> _I1;
|
| 774 |
+
typedef typename _I1::difference_type difference_type;
|
| 775 |
+
typedef typename _I1::__storage_type __storage_type;
|
| 776 |
+
const int __bits_per_word = _I1::__bits_per_word;
|
| 777 |
+
difference_type __n = __last - __first;
|
| 778 |
+
if (__n > 0)
|
| 779 |
+
{
|
| 780 |
+
// do first word
|
| 781 |
+
if (__first.__ctz_ != 0)
|
| 782 |
+
{
|
| 783 |
+
unsigned __clz_f = __bits_per_word - __first.__ctz_;
|
| 784 |
+
difference_type __dn = _CUDA_VSTD::min(static_cast<difference_type>(__clz_f), __n);
|
| 785 |
+
__n -= __dn;
|
| 786 |
+
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
| 787 |
+
__storage_type __b1 = *__first.__seg_ & __m;
|
| 788 |
+
*__first.__seg_ &= ~__m;
|
| 789 |
+
unsigned __clz_r = __bits_per_word - __result.__ctz_;
|
| 790 |
+
__storage_type __ddn = _CUDA_VSTD::min<__storage_type>(__dn, __clz_r);
|
| 791 |
+
__m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __ddn));
|
| 792 |
+
__storage_type __b2 = *__result.__seg_ & __m;
|
| 793 |
+
*__result.__seg_ &= ~__m;
|
| 794 |
+
if (__result.__ctz_ > __first.__ctz_)
|
| 795 |
+
{
|
| 796 |
+
unsigned __s = __result.__ctz_ - __first.__ctz_;
|
| 797 |
+
*__result.__seg_ |= __b1 << __s;
|
| 798 |
+
*__first.__seg_ |= __b2 >> __s;
|
| 799 |
+
}
|
| 800 |
+
else
|
| 801 |
+
{
|
| 802 |
+
unsigned __s = __first.__ctz_ - __result.__ctz_;
|
| 803 |
+
*__result.__seg_ |= __b1 >> __s;
|
| 804 |
+
*__first.__seg_ |= __b2 << __s;
|
| 805 |
+
}
|
| 806 |
+
__result.__seg_ += (__ddn + __result.__ctz_) / __bits_per_word;
|
| 807 |
+
__result.__ctz_ = static_cast<unsigned>((__ddn + __result.__ctz_) % __bits_per_word);
|
| 808 |
+
__dn -= __ddn;
|
| 809 |
+
if (__dn > 0)
|
| 810 |
+
{
|
| 811 |
+
__m = ~__storage_type(0) >> (__bits_per_word - __dn);
|
| 812 |
+
__b2 = *__result.__seg_ & __m;
|
| 813 |
+
*__result.__seg_ &= ~__m;
|
| 814 |
+
unsigned __s = __first.__ctz_ + __ddn;
|
| 815 |
+
*__result.__seg_ |= __b1 >> __s;
|
| 816 |
+
*__first.__seg_ |= __b2 << __s;
|
| 817 |
+
__result.__ctz_ = static_cast<unsigned>(__dn);
|
| 818 |
+
}
|
| 819 |
+
++__first.__seg_;
|
| 820 |
+
// __first.__ctz_ = 0;
|
| 821 |
+
}
|
| 822 |
+
// __first.__ctz_ == 0;
|
| 823 |
+
// do middle words
|
| 824 |
+
__storage_type __m = ~__storage_type(0) << __result.__ctz_;
|
| 825 |
+
unsigned __clz_r = __bits_per_word - __result.__ctz_;
|
| 826 |
+
for (; __n >= __bits_per_word; __n -= __bits_per_word, ++__first.__seg_)
|
| 827 |
+
{
|
| 828 |
+
__storage_type __b1 = *__first.__seg_;
|
| 829 |
+
__storage_type __b2 = *__result.__seg_ & __m;
|
| 830 |
+
*__result.__seg_ &= ~__m;
|
| 831 |
+
*__result.__seg_ |= __b1 << __result.__ctz_;
|
| 832 |
+
*__first.__seg_ = __b2 >> __result.__ctz_;
|
| 833 |
+
++__result.__seg_;
|
| 834 |
+
__b2 = *__result.__seg_ & ~__m;
|
| 835 |
+
*__result.__seg_ &= __m;
|
| 836 |
+
*__result.__seg_ |= __b1 >> __clz_r;
|
| 837 |
+
*__first.__seg_ |= __b2 << __clz_r;
|
| 838 |
+
}
|
| 839 |
+
// do last word
|
| 840 |
+
if (__n > 0)
|
| 841 |
+
{
|
| 842 |
+
__m = ~__storage_type(0) >> (__bits_per_word - __n);
|
| 843 |
+
__storage_type __b1 = *__first.__seg_ & __m;
|
| 844 |
+
*__first.__seg_ &= ~__m;
|
| 845 |
+
__storage_type __dn = _CUDA_VSTD::min<__storage_type>(__n, __clz_r);
|
| 846 |
+
__m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __dn));
|
| 847 |
+
__storage_type __b2 = *__result.__seg_ & __m;
|
| 848 |
+
*__result.__seg_ &= ~__m;
|
| 849 |
+
*__result.__seg_ |= __b1 << __result.__ctz_;
|
| 850 |
+
*__first.__seg_ |= __b2 >> __result.__ctz_;
|
| 851 |
+
__result.__seg_ += (__dn + __result.__ctz_) / __bits_per_word;
|
| 852 |
+
__result.__ctz_ = static_cast<unsigned>((__dn + __result.__ctz_) % __bits_per_word);
|
| 853 |
+
__n -= __dn;
|
| 854 |
+
if (__n > 0)
|
| 855 |
+
{
|
| 856 |
+
__m = ~__storage_type(0) >> (__bits_per_word - __n);
|
| 857 |
+
__b2 = *__result.__seg_ & __m;
|
| 858 |
+
*__result.__seg_ &= ~__m;
|
| 859 |
+
*__result.__seg_ |= __b1 >> __dn;
|
| 860 |
+
*__first.__seg_ |= __b2 << __dn;
|
| 861 |
+
__result.__ctz_ = static_cast<unsigned>(__n);
|
| 862 |
+
}
|
| 863 |
+
}
|
| 864 |
+
}
|
| 865 |
+
return __result;
|
| 866 |
+
}
|
| 867 |
+
|
| 868 |
+
template <class __C1, class __C2>
|
| 869 |
+
inline _LIBCUDACXX_INLINE_VISIBILITY
|
| 870 |
+
__bit_iterator<__C2, false>
|
| 871 |
+
swap_ranges(__bit_iterator<__C1, false> __first1, __bit_iterator<__C1, false> __last1,
|
| 872 |
+
__bit_iterator<__C2, false> __first2)
|
| 873 |
+
{
|
| 874 |
+
if (__first1.__ctz_ == __first2.__ctz_)
|
| 875 |
+
return __swap_ranges_aligned(__first1, __last1, __first2);
|
| 876 |
+
return __swap_ranges_unaligned(__first1, __last1, __first2);
|
| 877 |
+
}
|
| 878 |
+
|
| 879 |
+
// rotate
|
| 880 |
+
|
| 881 |
+
template <class _Cp>
|
| 882 |
+
struct __bit_array
|
| 883 |
+
{
|
| 884 |
+
typedef typename _Cp::difference_type difference_type;
|
| 885 |
+
typedef typename _Cp::__storage_type __storage_type;
|
| 886 |
+
typedef typename _Cp::__storage_pointer __storage_pointer;
|
| 887 |
+
typedef typename _Cp::iterator iterator;
|
| 888 |
+
static const unsigned __bits_per_word = _Cp::__bits_per_word;
|
| 889 |
+
static const unsigned _Np = 4;
|
| 890 |
+
|
| 891 |
+
difference_type __size_;
|
| 892 |
+
__storage_type __word_[_Np];
|
| 893 |
+
|
| 894 |
+
_LIBCUDACXX_INLINE_VISIBILITY static difference_type capacity()
|
| 895 |
+
{return static_cast<difference_type>(_Np * __bits_per_word);}
|
| 896 |
+
_LIBCUDACXX_INLINE_VISIBILITY explicit __bit_array(difference_type __s) : __size_(__s) {}
|
| 897 |
+
_LIBCUDACXX_INLINE_VISIBILITY iterator begin()
|
| 898 |
+
{
|
| 899 |
+
return iterator(pointer_traits<__storage_pointer>::pointer_to(__word_[0]), 0);
|
| 900 |
+
}
|
| 901 |
+
_LIBCUDACXX_INLINE_VISIBILITY iterator end()
|
| 902 |
+
{
|
| 903 |
+
return iterator(pointer_traits<__storage_pointer>::pointer_to(__word_[0]) + __size_ / __bits_per_word,
|
| 904 |
+
static_cast<unsigned>(__size_ % __bits_per_word));
|
| 905 |
+
}
|
| 906 |
+
};
|
| 907 |
+
|
| 908 |
+
template <class _Cp>
|
| 909 |
+
__bit_iterator<_Cp, false>
|
| 910 |
+
rotate(__bit_iterator<_Cp, false> __first, __bit_iterator<_Cp, false> __middle, __bit_iterator<_Cp, false> __last)
|
| 911 |
+
{
|
| 912 |
+
typedef __bit_iterator<_Cp, false> _I1;
|
| 913 |
+
typedef typename _I1::difference_type difference_type;
|
| 914 |
+
difference_type __d1 = __middle - __first;
|
| 915 |
+
difference_type __d2 = __last - __middle;
|
| 916 |
+
_I1 __r = __first + __d2;
|
| 917 |
+
while (__d1 != 0 && __d2 != 0)
|
| 918 |
+
{
|
| 919 |
+
if (__d1 <= __d2)
|
| 920 |
+
{
|
| 921 |
+
if (__d1 <= __bit_array<_Cp>::capacity())
|
| 922 |
+
{
|
| 923 |
+
__bit_array<_Cp> __b(__d1);
|
| 924 |
+
_CUDA_VSTD::copy(__first, __middle, __b.begin());
|
| 925 |
+
_CUDA_VSTD::copy(__b.begin(), __b.end(), _CUDA_VSTD::copy(__middle, __last, __first));
|
| 926 |
+
break;
|
| 927 |
+
}
|
| 928 |
+
else
|
| 929 |
+
{
|
| 930 |
+
__bit_iterator<_Cp, false> __mp = _CUDA_VSTD::swap_ranges(__first, __middle, __middle);
|
| 931 |
+
__first = __middle;
|
| 932 |
+
__middle = __mp;
|
| 933 |
+
__d2 -= __d1;
|
| 934 |
+
}
|
| 935 |
+
}
|
| 936 |
+
else
|
| 937 |
+
{
|
| 938 |
+
if (__d2 <= __bit_array<_Cp>::capacity())
|
| 939 |
+
{
|
| 940 |
+
__bit_array<_Cp> __b(__d2);
|
| 941 |
+
_CUDA_VSTD::copy(__middle, __last, __b.begin());
|
| 942 |
+
_CUDA_VSTD::copy_backward(__b.begin(), __b.end(), _CUDA_VSTD::copy_backward(__first, __middle, __last));
|
| 943 |
+
break;
|
| 944 |
+
}
|
| 945 |
+
else
|
| 946 |
+
{
|
| 947 |
+
__bit_iterator<_Cp, false> __mp = __first + __d2;
|
| 948 |
+
_CUDA_VSTD::swap_ranges(__first, __mp, __middle);
|
| 949 |
+
__first = __mp;
|
| 950 |
+
__d1 -= __d2;
|
| 951 |
+
}
|
| 952 |
+
}
|
| 953 |
+
}
|
| 954 |
+
return __r;
|
| 955 |
+
}
|
| 956 |
+
|
| 957 |
+
// equal
|
| 958 |
+
|
| 959 |
+
template <class _Cp, bool _IC1, bool _IC2>
|
| 960 |
+
bool
|
| 961 |
+
__equal_unaligned(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1,
|
| 962 |
+
__bit_iterator<_Cp, _IC2> __first2)
|
| 963 |
+
{
|
| 964 |
+
typedef __bit_iterator<_Cp, _IC1> _It;
|
| 965 |
+
typedef typename _It::difference_type difference_type;
|
| 966 |
+
typedef typename _It::__storage_type __storage_type;
|
| 967 |
+
static const int __bits_per_word = _It::__bits_per_word;
|
| 968 |
+
difference_type __n = __last1 - __first1;
|
| 969 |
+
if (__n > 0)
|
| 970 |
+
{
|
| 971 |
+
// do first word
|
| 972 |
+
if (__first1.__ctz_ != 0)
|
| 973 |
+
{
|
| 974 |
+
unsigned __clz_f = __bits_per_word - __first1.__ctz_;
|
| 975 |
+
difference_type __dn = _CUDA_VSTD::min(static_cast<difference_type>(__clz_f), __n);
|
| 976 |
+
__n -= __dn;
|
| 977 |
+
__storage_type __m = (~__storage_type(0) << __first1.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
| 978 |
+
__storage_type __b = *__first1.__seg_ & __m;
|
| 979 |
+
unsigned __clz_r = __bits_per_word - __first2.__ctz_;
|
| 980 |
+
__storage_type __ddn = _CUDA_VSTD::min<__storage_type>(__dn, __clz_r);
|
| 981 |
+
__m = (~__storage_type(0) << __first2.__ctz_) & (~__storage_type(0) >> (__clz_r - __ddn));
|
| 982 |
+
if (__first2.__ctz_ > __first1.__ctz_)
|
| 983 |
+
{
|
| 984 |
+
if ((*__first2.__seg_ & __m) != (__b << (__first2.__ctz_ - __first1.__ctz_)))
|
| 985 |
+
return false;
|
| 986 |
+
}
|
| 987 |
+
else
|
| 988 |
+
{
|
| 989 |
+
if ((*__first2.__seg_ & __m) != (__b >> (__first1.__ctz_ - __first2.__ctz_)))
|
| 990 |
+
return false;
|
| 991 |
+
}
|
| 992 |
+
__first2.__seg_ += (__ddn + __first2.__ctz_) / __bits_per_word;
|
| 993 |
+
__first2.__ctz_ = static_cast<unsigned>((__ddn + __first2.__ctz_) % __bits_per_word);
|
| 994 |
+
__dn -= __ddn;
|
| 995 |
+
if (__dn > 0)
|
| 996 |
+
{
|
| 997 |
+
__m = ~__storage_type(0) >> (__bits_per_word - __dn);
|
| 998 |
+
if ((*__first2.__seg_ & __m) != (__b >> (__first1.__ctz_ + __ddn)))
|
| 999 |
+
return false;
|
| 1000 |
+
__first2.__ctz_ = static_cast<unsigned>(__dn);
|
| 1001 |
+
}
|
| 1002 |
+
++__first1.__seg_;
|
| 1003 |
+
// __first1.__ctz_ = 0;
|
| 1004 |
+
}
|
| 1005 |
+
// __first1.__ctz_ == 0;
|
| 1006 |
+
// do middle words
|
| 1007 |
+
unsigned __clz_r = __bits_per_word - __first2.__ctz_;
|
| 1008 |
+
__storage_type __m = ~__storage_type(0) << __first2.__ctz_;
|
| 1009 |
+
for (; __n >= __bits_per_word; __n -= __bits_per_word, ++__first1.__seg_)
|
| 1010 |
+
{
|
| 1011 |
+
__storage_type __b = *__first1.__seg_;
|
| 1012 |
+
if ((*__first2.__seg_ & __m) != (__b << __first2.__ctz_))
|
| 1013 |
+
return false;
|
| 1014 |
+
++__first2.__seg_;
|
| 1015 |
+
if ((*__first2.__seg_ & ~__m) != (__b >> __clz_r))
|
| 1016 |
+
return false;
|
| 1017 |
+
}
|
| 1018 |
+
// do last word
|
| 1019 |
+
if (__n > 0)
|
| 1020 |
+
{
|
| 1021 |
+
__m = ~__storage_type(0) >> (__bits_per_word - __n);
|
| 1022 |
+
__storage_type __b = *__first1.__seg_ & __m;
|
| 1023 |
+
__storage_type __dn = _CUDA_VSTD::min(__n, static_cast<difference_type>(__clz_r));
|
| 1024 |
+
__m = (~__storage_type(0) << __first2.__ctz_) & (~__storage_type(0) >> (__clz_r - __dn));
|
| 1025 |
+
if ((*__first2.__seg_ & __m) != (__b << __first2.__ctz_))
|
| 1026 |
+
return false;
|
| 1027 |
+
__first2.__seg_ += (__dn + __first2.__ctz_) / __bits_per_word;
|
| 1028 |
+
__first2.__ctz_ = static_cast<unsigned>((__dn + __first2.__ctz_) % __bits_per_word);
|
| 1029 |
+
__n -= __dn;
|
| 1030 |
+
if (__n > 0)
|
| 1031 |
+
{
|
| 1032 |
+
__m = ~__storage_type(0) >> (__bits_per_word - __n);
|
| 1033 |
+
if ((*__first2.__seg_ & __m) != (__b >> __dn))
|
| 1034 |
+
return false;
|
| 1035 |
+
}
|
| 1036 |
+
}
|
| 1037 |
+
}
|
| 1038 |
+
return true;
|
| 1039 |
+
}
|
| 1040 |
+
|
| 1041 |
+
template <class _Cp, bool _IC1, bool _IC2>
|
| 1042 |
+
bool
|
| 1043 |
+
__equal_aligned(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1,
|
| 1044 |
+
__bit_iterator<_Cp, _IC2> __first2)
|
| 1045 |
+
{
|
| 1046 |
+
typedef __bit_iterator<_Cp, _IC1> _It;
|
| 1047 |
+
typedef typename _It::difference_type difference_type;
|
| 1048 |
+
typedef typename _It::__storage_type __storage_type;
|
| 1049 |
+
static const int __bits_per_word = _It::__bits_per_word;
|
| 1050 |
+
difference_type __n = __last1 - __first1;
|
| 1051 |
+
if (__n > 0)
|
| 1052 |
+
{
|
| 1053 |
+
// do first word
|
| 1054 |
+
if (__first1.__ctz_ != 0)
|
| 1055 |
+
{
|
| 1056 |
+
unsigned __clz = __bits_per_word - __first1.__ctz_;
|
| 1057 |
+
difference_type __dn = _CUDA_VSTD::min(static_cast<difference_type>(__clz), __n);
|
| 1058 |
+
__n -= __dn;
|
| 1059 |
+
__storage_type __m = (~__storage_type(0) << __first1.__ctz_) & (~__storage_type(0) >> (__clz - __dn));
|
| 1060 |
+
if ((*__first2.__seg_ & __m) != (*__first1.__seg_ & __m))
|
| 1061 |
+
return false;
|
| 1062 |
+
++__first2.__seg_;
|
| 1063 |
+
++__first1.__seg_;
|
| 1064 |
+
// __first1.__ctz_ = 0;
|
| 1065 |
+
// __first2.__ctz_ = 0;
|
| 1066 |
+
}
|
| 1067 |
+
// __first1.__ctz_ == 0;
|
| 1068 |
+
// __first2.__ctz_ == 0;
|
| 1069 |
+
// do middle words
|
| 1070 |
+
for (; __n >= __bits_per_word; __n -= __bits_per_word, ++__first1.__seg_, ++__first2.__seg_)
|
| 1071 |
+
if (*__first2.__seg_ != *__first1.__seg_)
|
| 1072 |
+
return false;
|
| 1073 |
+
// do last word
|
| 1074 |
+
if (__n > 0)
|
| 1075 |
+
{
|
| 1076 |
+
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
|
| 1077 |
+
if ((*__first2.__seg_ & __m) != (*__first1.__seg_ & __m))
|
| 1078 |
+
return false;
|
| 1079 |
+
}
|
| 1080 |
+
}
|
| 1081 |
+
return true;
|
| 1082 |
+
}
|
| 1083 |
+
|
| 1084 |
+
template <class _Cp, bool _IC1, bool _IC2>
|
| 1085 |
+
inline _LIBCUDACXX_INLINE_VISIBILITY
|
| 1086 |
+
bool
|
| 1087 |
+
equal(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1, __bit_iterator<_Cp, _IC2> __first2)
|
| 1088 |
+
{
|
| 1089 |
+
if (__first1.__ctz_ == __first2.__ctz_)
|
| 1090 |
+
return __equal_aligned(__first1, __last1, __first2);
|
| 1091 |
+
return __equal_unaligned(__first1, __last1, __first2);
|
| 1092 |
+
}
|
| 1093 |
+
|
| 1094 |
+
template <class _Cp, bool _IsConst,
|
| 1095 |
+
typename _Cp::__storage_type>
|
| 1096 |
+
class __bit_iterator
|
| 1097 |
+
{
|
| 1098 |
+
public:
|
| 1099 |
+
typedef typename _Cp::difference_type difference_type;
|
| 1100 |
+
typedef bool value_type;
|
| 1101 |
+
typedef __bit_iterator pointer;
|
| 1102 |
+
typedef typename conditional<_IsConst, __bit_const_reference<_Cp>, __bit_reference<_Cp> >::type reference;
|
| 1103 |
+
typedef random_access_iterator_tag iterator_category;
|
| 1104 |
+
|
| 1105 |
+
private:
|
| 1106 |
+
typedef typename _Cp::__storage_type __storage_type;
|
| 1107 |
+
typedef typename conditional<_IsConst, typename _Cp::__const_storage_pointer,
|
| 1108 |
+
typename _Cp::__storage_pointer>::type __storage_pointer;
|
| 1109 |
+
static const unsigned __bits_per_word = _Cp::__bits_per_word;
|
| 1110 |
+
|
| 1111 |
+
__storage_pointer __seg_;
|
| 1112 |
+
unsigned __ctz_;
|
| 1113 |
+
|
| 1114 |
+
public:
|
| 1115 |
+
_LIBCUDACXX_INLINE_VISIBILITY __bit_iterator() noexcept
|
| 1116 |
+
#if _LIBCUDACXX_STD_VER > 11
|
| 1117 |
+
: __seg_(nullptr), __ctz_(0)
|
| 1118 |
+
#endif
|
| 1119 |
+
{}
|
| 1120 |
+
// avoid re-declaring a copy constructor for the non-const version.
|
| 1121 |
+
using __type_for_copy_to_const =
|
| 1122 |
+
_If<_IsConst, __bit_iterator<_Cp, false>, struct __private_nat>;
|
| 1123 |
+
|
| 1124 |
+
_LIBCUDACXX_INLINE_VISIBILITY
|
| 1125 |
+
__bit_iterator(const __type_for_copy_to_const& __it) noexcept
|
| 1126 |
+
: __seg_(__it.__seg_), __ctz_(__it.__ctz_) {}
|
| 1127 |
+
|
| 1128 |
+
_LIBCUDACXX_INLINE_VISIBILITY reference operator*() const noexcept
|
| 1129 |
+
{return reference(__seg_, __storage_type(1) << __ctz_);}
|
| 1130 |
+
|
| 1131 |
+
_LIBCUDACXX_INLINE_VISIBILITY __bit_iterator& operator++()
|
| 1132 |
+
{
|
| 1133 |
+
if (__ctz_ != __bits_per_word-1)
|
| 1134 |
+
++__ctz_;
|
| 1135 |
+
else
|
| 1136 |
+
{
|
| 1137 |
+
__ctz_ = 0;
|
| 1138 |
+
++__seg_;
|
| 1139 |
+
}
|
| 1140 |
+
return *this;
|
| 1141 |
+
}
|
| 1142 |
+
|
| 1143 |
+
_LIBCUDACXX_INLINE_VISIBILITY __bit_iterator operator++(int)
|
| 1144 |
+
{
|
| 1145 |
+
__bit_iterator __tmp = *this;
|
| 1146 |
+
++(*this);
|
| 1147 |
+
return __tmp;
|
| 1148 |
+
}
|
| 1149 |
+
|
| 1150 |
+
_LIBCUDACXX_INLINE_VISIBILITY __bit_iterator& operator--()
|
| 1151 |
+
{
|
| 1152 |
+
if (__ctz_ != 0)
|
| 1153 |
+
--__ctz_;
|
| 1154 |
+
else
|
| 1155 |
+
{
|
| 1156 |
+
__ctz_ = __bits_per_word - 1;
|
| 1157 |
+
--__seg_;
|
| 1158 |
+
}
|
| 1159 |
+
return *this;
|
| 1160 |
+
}
|
| 1161 |
+
|
| 1162 |
+
_LIBCUDACXX_INLINE_VISIBILITY __bit_iterator operator--(int)
|
| 1163 |
+
{
|
| 1164 |
+
__bit_iterator __tmp = *this;
|
| 1165 |
+
--(*this);
|
| 1166 |
+
return __tmp;
|
| 1167 |
+
}
|
| 1168 |
+
|
| 1169 |
+
_LIBCUDACXX_INLINE_VISIBILITY __bit_iterator& operator+=(difference_type __n)
|
| 1170 |
+
{
|
| 1171 |
+
if (__n >= 0)
|
| 1172 |
+
__seg_ += (__n + __ctz_) / __bits_per_word;
|
| 1173 |
+
else
|
| 1174 |
+
__seg_ += static_cast<difference_type>(__n - __bits_per_word + __ctz_ + 1)
|
| 1175 |
+
/ static_cast<difference_type>(__bits_per_word);
|
| 1176 |
+
__n &= (__bits_per_word - 1);
|
| 1177 |
+
__ctz_ = static_cast<unsigned>((__n + __ctz_) % __bits_per_word);
|
| 1178 |
+
return *this;
|
| 1179 |
+
}
|
| 1180 |
+
|
| 1181 |
+
_LIBCUDACXX_INLINE_VISIBILITY __bit_iterator& operator-=(difference_type __n)
|
| 1182 |
+
{
|
| 1183 |
+
return *this += -__n;
|
| 1184 |
+
}
|
| 1185 |
+
|
| 1186 |
+
_LIBCUDACXX_INLINE_VISIBILITY __bit_iterator operator+(difference_type __n) const
|
| 1187 |
+
{
|
| 1188 |
+
__bit_iterator __t(*this);
|
| 1189 |
+
__t += __n;
|
| 1190 |
+
return __t;
|
| 1191 |
+
}
|
| 1192 |
+
|
| 1193 |
+
_LIBCUDACXX_INLINE_VISIBILITY __bit_iterator operator-(difference_type __n) const
|
| 1194 |
+
{
|
| 1195 |
+
__bit_iterator __t(*this);
|
| 1196 |
+
__t -= __n;
|
| 1197 |
+
return __t;
|
| 1198 |
+
}
|
| 1199 |
+
|
| 1200 |
+
_LIBCUDACXX_INLINE_VISIBILITY
|
| 1201 |
+
friend __bit_iterator operator+(difference_type __n, const __bit_iterator& __it) {return __it + __n;}
|
| 1202 |
+
|
| 1203 |
+
_LIBCUDACXX_INLINE_VISIBILITY
|
| 1204 |
+
friend difference_type operator-(const __bit_iterator& __x, const __bit_iterator& __y)
|
| 1205 |
+
{return (__x.__seg_ - __y.__seg_) * __bits_per_word + __x.__ctz_ - __y.__ctz_;}
|
| 1206 |
+
|
| 1207 |
+
_LIBCUDACXX_INLINE_VISIBILITY reference operator[](difference_type __n) const {return *(*this + __n);}
|
| 1208 |
+
|
| 1209 |
+
_LIBCUDACXX_INLINE_VISIBILITY friend bool operator==(const __bit_iterator& __x, const __bit_iterator& __y)
|
| 1210 |
+
{return __x.__seg_ == __y.__seg_ && __x.__ctz_ == __y.__ctz_;}
|
| 1211 |
+
|
| 1212 |
+
_LIBCUDACXX_INLINE_VISIBILITY friend bool operator!=(const __bit_iterator& __x, const __bit_iterator& __y)
|
| 1213 |
+
{return !(__x == __y);}
|
| 1214 |
+
|
| 1215 |
+
_LIBCUDACXX_INLINE_VISIBILITY friend bool operator<(const __bit_iterator& __x, const __bit_iterator& __y)
|
| 1216 |
+
{return __x.__seg_ < __y.__seg_ || (__x.__seg_ == __y.__seg_ && __x.__ctz_ < __y.__ctz_);}
|
| 1217 |
+
|
| 1218 |
+
_LIBCUDACXX_INLINE_VISIBILITY friend bool operator>(const __bit_iterator& __x, const __bit_iterator& __y)
|
| 1219 |
+
{return __y < __x;}
|
| 1220 |
+
|
| 1221 |
+
_LIBCUDACXX_INLINE_VISIBILITY friend bool operator<=(const __bit_iterator& __x, const __bit_iterator& __y)
|
| 1222 |
+
{return !(__y < __x);}
|
| 1223 |
+
|
| 1224 |
+
_LIBCUDACXX_INLINE_VISIBILITY friend bool operator>=(const __bit_iterator& __x, const __bit_iterator& __y)
|
| 1225 |
+
{return !(__x < __y);}
|
| 1226 |
+
|
| 1227 |
+
private:
|
| 1228 |
+
_LIBCUDACXX_INLINE_VISIBILITY
|
| 1229 |
+
__bit_iterator(__storage_pointer __s, unsigned __ctz) noexcept
|
| 1230 |
+
: __seg_(__s), __ctz_(__ctz) {}
|
| 1231 |
+
|
| 1232 |
+
friend typename _Cp::__self;
|
| 1233 |
+
|
| 1234 |
+
friend class __bit_reference<_Cp>;
|
| 1235 |
+
friend class __bit_const_reference<_Cp>;
|
| 1236 |
+
friend class __bit_iterator<_Cp, true>;
|
| 1237 |
+
template <class _Dp> friend struct __bit_array;
|
| 1238 |
+
template <class _Dp> friend void __fill_n_false(__bit_iterator<_Dp, false> __first, typename _Dp::size_type __n);
|
| 1239 |
+
template <class _Dp> friend void __fill_n_true(__bit_iterator<_Dp, false> __first, typename _Dp::size_type __n);
|
| 1240 |
+
template <class _Dp, bool _IC> friend __bit_iterator<_Dp, false> __copy_aligned(__bit_iterator<_Dp, _IC> __first,
|
| 1241 |
+
__bit_iterator<_Dp, _IC> __last,
|
| 1242 |
+
__bit_iterator<_Dp, false> __result);
|
| 1243 |
+
template <class _Dp, bool _IC> friend __bit_iterator<_Dp, false> __copy_unaligned(__bit_iterator<_Dp, _IC> __first,
|
| 1244 |
+
__bit_iterator<_Dp, _IC> __last,
|
| 1245 |
+
__bit_iterator<_Dp, false> __result);
|
| 1246 |
+
template <class _Dp, bool _IC> friend __bit_iterator<_Dp, false> copy(__bit_iterator<_Dp, _IC> __first,
|
| 1247 |
+
__bit_iterator<_Dp, _IC> __last,
|
| 1248 |
+
__bit_iterator<_Dp, false> __result);
|
| 1249 |
+
template <class _Dp, bool _IC> friend __bit_iterator<_Dp, false> __copy_backward_aligned(__bit_iterator<_Dp, _IC> __first,
|
| 1250 |
+
__bit_iterator<_Dp, _IC> __last,
|
| 1251 |
+
__bit_iterator<_Dp, false> __result);
|
| 1252 |
+
template <class _Dp, bool _IC> friend __bit_iterator<_Dp, false> __copy_backward_unaligned(__bit_iterator<_Dp, _IC> __first,
|
| 1253 |
+
__bit_iterator<_Dp, _IC> __last,
|
| 1254 |
+
__bit_iterator<_Dp, false> __result);
|
| 1255 |
+
template <class _Dp, bool _IC> friend __bit_iterator<_Dp, false> copy_backward(__bit_iterator<_Dp, _IC> __first,
|
| 1256 |
+
__bit_iterator<_Dp, _IC> __last,
|
| 1257 |
+
__bit_iterator<_Dp, false> __result);
|
| 1258 |
+
template <class __C1, class __C2>friend __bit_iterator<__C2, false> __swap_ranges_aligned(__bit_iterator<__C1, false>,
|
| 1259 |
+
__bit_iterator<__C1, false>,
|
| 1260 |
+
__bit_iterator<__C2, false>);
|
| 1261 |
+
template <class __C1, class __C2>friend __bit_iterator<__C2, false> __swap_ranges_unaligned(__bit_iterator<__C1, false>,
|
| 1262 |
+
__bit_iterator<__C1, false>,
|
| 1263 |
+
__bit_iterator<__C2, false>);
|
| 1264 |
+
template <class __C1, class __C2>friend __bit_iterator<__C2, false> swap_ranges(__bit_iterator<__C1, false>,
|
| 1265 |
+
__bit_iterator<__C1, false>,
|
| 1266 |
+
__bit_iterator<__C2, false>);
|
| 1267 |
+
template <class _Dp> friend __bit_iterator<_Dp, false> rotate(__bit_iterator<_Dp, false>,
|
| 1268 |
+
__bit_iterator<_Dp, false>,
|
| 1269 |
+
__bit_iterator<_Dp, false>);
|
| 1270 |
+
template <class _Dp, bool _IC1, bool _IC2> friend bool __equal_aligned(__bit_iterator<_Dp, _IC1>,
|
| 1271 |
+
__bit_iterator<_Dp, _IC1>,
|
| 1272 |
+
__bit_iterator<_Dp, _IC2>);
|
| 1273 |
+
template <class _Dp, bool _IC1, bool _IC2> friend bool __equal_unaligned(__bit_iterator<_Dp, _IC1>,
|
| 1274 |
+
__bit_iterator<_Dp, _IC1>,
|
| 1275 |
+
__bit_iterator<_Dp, _IC2>);
|
| 1276 |
+
template <class _Dp, bool _IC1, bool _IC2> friend bool equal(__bit_iterator<_Dp, _IC1>,
|
| 1277 |
+
__bit_iterator<_Dp, _IC1>,
|
| 1278 |
+
__bit_iterator<_Dp, _IC2>);
|
| 1279 |
+
template <class _Dp, bool _IC> friend __bit_iterator<_Dp, _IC> __find_bool_true(__bit_iterator<_Dp, _IC>,
|
| 1280 |
+
typename _Dp::size_type);
|
| 1281 |
+
template <class _Dp, bool _IC> friend __bit_iterator<_Dp, _IC> __find_bool_false(__bit_iterator<_Dp, _IC>,
|
| 1282 |
+
typename _Dp::size_type);
|
| 1283 |
+
template <class _Dp, bool _IC> friend typename __bit_iterator<_Dp, _IC>::difference_type
|
| 1284 |
+
__count_bool_true(__bit_iterator<_Dp, _IC>, typename _Dp::size_type);
|
| 1285 |
+
template <class _Dp, bool _IC> friend typename __bit_iterator<_Dp, _IC>::difference_type
|
| 1286 |
+
__count_bool_false(__bit_iterator<_Dp, _IC>, typename _Dp::size_type);
|
| 1287 |
+
};
|
| 1288 |
+
|
| 1289 |
+
_LIBCUDACXX_END_NAMESPACE_STD
|
| 1290 |
+
|
| 1291 |
+
_LIBCUDACXX_POP_MACROS
|
| 1292 |
+
|
| 1293 |
+
#endif // _LIBCUDACXX___BIT_REFERENCE
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__bsd_locale_defaults.h
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// -*- C++ -*-
|
| 2 |
+
//===---------------------- __bsd_locale_defaults.h -----------------------===//
|
| 3 |
+
//
|
| 4 |
+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
| 5 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 6 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
// The BSDs have lots of *_l functions. We don't want to define those symbols
|
| 10 |
+
// on other platforms though, for fear of conflicts with user code. So here,
|
| 11 |
+
// we will define the mapping from an internal macro to the real BSD symbol.
|
| 12 |
+
//===----------------------------------------------------------------------===//
|
| 13 |
+
|
| 14 |
+
#ifndef _LIBCUDACXX_BSD_LOCALE_DEFAULTS_H
|
| 15 |
+
#define _LIBCUDACXX_BSD_LOCALE_DEFAULTS_H
|
| 16 |
+
|
| 17 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 18 |
+
# pragma GCC system_header
|
| 19 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 20 |
+
# pragma clang system_header
|
| 21 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 22 |
+
# pragma system_header
|
| 23 |
+
#endif // no system header
|
| 24 |
+
|
| 25 |
+
#define __libcpp_mb_cur_max_l(loc) MB_CUR_MAX_L(loc)
|
| 26 |
+
#define __libcpp_btowc_l(ch, loc) btowc_l(ch, loc)
|
| 27 |
+
#define __libcpp_wctob_l(wch, loc) wctob_l(wch, loc)
|
| 28 |
+
#define __libcpp_wcsnrtombs_l(dst, src, nwc, len, ps, loc) wcsnrtombs_l(dst, src, nwc, len, ps, loc)
|
| 29 |
+
#define __libcpp_wcrtomb_l(src, wc, ps, loc) wcrtomb_l(src, wc, ps, loc)
|
| 30 |
+
#define __libcpp_mbsnrtowcs_l(dst, src, nms, len, ps, loc) mbsnrtowcs_l(dst, src, nms, len, ps, loc)
|
| 31 |
+
#define __libcpp_mbrtowc_l(pwc, s, n, ps, l) mbrtowc_l(pwc, s, n, ps, l)
|
| 32 |
+
#define __libcpp_mbtowc_l(pwc, pmb, max, l) mbtowc_l(pwc, pmb, max, l)
|
| 33 |
+
#define __libcpp_mbrlen_l(s, n, ps, l) mbrlen_l(s, n, ps, l)
|
| 34 |
+
#define __libcpp_localeconv_l(l) localeconv_l(l)
|
| 35 |
+
#define __libcpp_mbsrtowcs_l(dest, src, len, ps, l) mbsrtowcs_l(dest, src, len, ps, l)
|
| 36 |
+
#define __libcpp_snprintf_l(...) snprintf_l(__VA_ARGS__)
|
| 37 |
+
#define __libcpp_asprintf_l(...) asprintf_l(__VA_ARGS__)
|
| 38 |
+
#define __libcpp_sscanf_l(...) sscanf_l(__VA_ARGS__)
|
| 39 |
+
|
| 40 |
+
#endif // _LIBCUDACXX_BSD_LOCALE_DEFAULTS_H
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__bsd_locale_fallbacks.h
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// -*- C++ -*-
|
| 2 |
+
//===---------------------- __bsd_locale_fallbacks.h ----------------------===//
|
| 3 |
+
//
|
| 4 |
+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
| 5 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 6 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
// The BSDs have lots of *_l functions. This file provides reimplementations
|
| 10 |
+
// of those functions for non-BSD platforms.
|
| 11 |
+
//===----------------------------------------------------------------------===//
|
| 12 |
+
|
| 13 |
+
#ifndef _LIBCUDACXX_BSD_LOCALE_FALLBACKS_DEFAULTS_H
|
| 14 |
+
#define _LIBCUDACXX_BSD_LOCALE_FALLBACKS_DEFAULTS_H
|
| 15 |
+
|
| 16 |
+
#include <stdlib.h>
|
| 17 |
+
#include <stdarg.h>
|
| 18 |
+
#include <memory>
|
| 19 |
+
|
| 20 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 21 |
+
# pragma GCC system_header
|
| 22 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 23 |
+
# pragma clang system_header
|
| 24 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 25 |
+
# pragma system_header
|
| 26 |
+
#endif // no system header
|
| 27 |
+
|
| 28 |
+
_LIBCUDACXX_BEGIN_NAMESPACE_STD
|
| 29 |
+
|
| 30 |
+
inline _LIBCUDACXX_INLINE_VISIBILITY
|
| 31 |
+
decltype(MB_CUR_MAX) __libcpp_mb_cur_max_l(locale_t __l)
|
| 32 |
+
{
|
| 33 |
+
__libcpp_locale_guard __current(__l);
|
| 34 |
+
return MB_CUR_MAX;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
inline _LIBCUDACXX_INLINE_VISIBILITY
|
| 38 |
+
wint_t __libcpp_btowc_l(int __c, locale_t __l)
|
| 39 |
+
{
|
| 40 |
+
__libcpp_locale_guard __current(__l);
|
| 41 |
+
return btowc(__c);
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
inline _LIBCUDACXX_INLINE_VISIBILITY
|
| 45 |
+
int __libcpp_wctob_l(wint_t __c, locale_t __l)
|
| 46 |
+
{
|
| 47 |
+
__libcpp_locale_guard __current(__l);
|
| 48 |
+
return wctob(__c);
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
inline _LIBCUDACXX_INLINE_VISIBILITY
|
| 52 |
+
size_t __libcpp_wcsnrtombs_l(char *__dest, const wchar_t **__src, size_t __nwc,
|
| 53 |
+
size_t __len, mbstate_t *__ps, locale_t __l)
|
| 54 |
+
{
|
| 55 |
+
__libcpp_locale_guard __current(__l);
|
| 56 |
+
return wcsnrtombs(__dest, __src, __nwc, __len, __ps);
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
inline _LIBCUDACXX_INLINE_VISIBILITY
|
| 60 |
+
size_t __libcpp_wcrtomb_l(char *__s, wchar_t __wc, mbstate_t *__ps, locale_t __l)
|
| 61 |
+
{
|
| 62 |
+
__libcpp_locale_guard __current(__l);
|
| 63 |
+
return wcrtomb(__s, __wc, __ps);
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
inline _LIBCUDACXX_INLINE_VISIBILITY
|
| 67 |
+
size_t __libcpp_mbsnrtowcs_l(wchar_t * __dest, const char **__src, size_t __nms,
|
| 68 |
+
size_t __len, mbstate_t *__ps, locale_t __l)
|
| 69 |
+
{
|
| 70 |
+
__libcpp_locale_guard __current(__l);
|
| 71 |
+
return mbsnrtowcs(__dest, __src, __nms, __len, __ps);
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
inline _LIBCUDACXX_INLINE_VISIBILITY
|
| 75 |
+
size_t __libcpp_mbrtowc_l(wchar_t *__pwc, const char *__s, size_t __n,
|
| 76 |
+
mbstate_t *__ps, locale_t __l)
|
| 77 |
+
{
|
| 78 |
+
__libcpp_locale_guard __current(__l);
|
| 79 |
+
return mbrtowc(__pwc, __s, __n, __ps);
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
inline _LIBCUDACXX_INLINE_VISIBILITY
|
| 83 |
+
int __libcpp_mbtowc_l(wchar_t *__pwc, const char *__pmb, size_t __max, locale_t __l)
|
| 84 |
+
{
|
| 85 |
+
__libcpp_locale_guard __current(__l);
|
| 86 |
+
return mbtowc(__pwc, __pmb, __max);
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
inline _LIBCUDACXX_INLINE_VISIBILITY
|
| 90 |
+
size_t __libcpp_mbrlen_l(const char *__s, size_t __n, mbstate_t *__ps, locale_t __l)
|
| 91 |
+
{
|
| 92 |
+
__libcpp_locale_guard __current(__l);
|
| 93 |
+
return mbrlen(__s, __n, __ps);
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
inline _LIBCUDACXX_INLINE_VISIBILITY
|
| 97 |
+
lconv *__libcpp_localeconv_l(locale_t __l)
|
| 98 |
+
{
|
| 99 |
+
__libcpp_locale_guard __current(__l);
|
| 100 |
+
return localeconv();
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
inline _LIBCUDACXX_INLINE_VISIBILITY
|
| 104 |
+
size_t __libcpp_mbsrtowcs_l(wchar_t *__dest, const char **__src, size_t __len,
|
| 105 |
+
mbstate_t *__ps, locale_t __l)
|
| 106 |
+
{
|
| 107 |
+
__libcpp_locale_guard __current(__l);
|
| 108 |
+
return mbsrtowcs(__dest, __src, __len, __ps);
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
inline
|
| 112 |
+
int __libcpp_snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...) {
|
| 113 |
+
va_list __va;
|
| 114 |
+
va_start(__va, __format);
|
| 115 |
+
__libcpp_locale_guard __current(__l);
|
| 116 |
+
int __res = vsnprintf(__s, __n, __format, __va);
|
| 117 |
+
va_end(__va);
|
| 118 |
+
return __res;
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
inline
|
| 122 |
+
int __libcpp_asprintf_l(char **__s, locale_t __l, const char *__format, ...) {
|
| 123 |
+
va_list __va;
|
| 124 |
+
va_start(__va, __format);
|
| 125 |
+
__libcpp_locale_guard __current(__l);
|
| 126 |
+
int __res = vasprintf(__s, __format, __va);
|
| 127 |
+
va_end(__va);
|
| 128 |
+
return __res;
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
inline
|
| 132 |
+
int __libcpp_sscanf_l(const char *__s, locale_t __l, const char *__format, ...) {
|
| 133 |
+
va_list __va;
|
| 134 |
+
va_start(__va, __format);
|
| 135 |
+
__libcpp_locale_guard __current(__l);
|
| 136 |
+
int __res = vsscanf(__s, __format, __va);
|
| 137 |
+
va_end(__va);
|
| 138 |
+
return __res;
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
_LIBCUDACXX_END_NAMESPACE_STD
|
| 142 |
+
|
| 143 |
+
#endif // _LIBCUDACXX_BSD_LOCALE_FALLBACKS_DEFAULTS_H
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__cccl/ptx_isa.h
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of libcu++, the C++ Standard Library for your entire system,
|
| 4 |
+
// under the Apache License v2.0 with LLVM Exceptions.
|
| 5 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 6 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 7 |
+
// SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES.
|
| 8 |
+
//
|
| 9 |
+
//===----------------------------------------------------------------------===//
|
| 10 |
+
|
| 11 |
+
#ifndef __CCCL_PTX_ISA_H_
|
| 12 |
+
#define __CCCL_PTX_ISA_H_
|
| 13 |
+
|
| 14 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 15 |
+
# pragma GCC system_header
|
| 16 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 17 |
+
# pragma clang system_header
|
| 18 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 19 |
+
# pragma system_header
|
| 20 |
+
#endif // no system header
|
| 21 |
+
|
| 22 |
+
#include <nv/target> // __CUDA_MINIMUM_ARCH__ and friends
|
| 23 |
+
|
| 24 |
+
/*
|
| 25 |
+
* Targeting macros
|
| 26 |
+
*
|
| 27 |
+
* Information from:
|
| 28 |
+
* https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#release-notes
|
| 29 |
+
*/
|
| 30 |
+
|
| 31 |
+
// PTX ISA 8.3 is available from CUDA 12.3, driver r545
|
| 32 |
+
// The first define is for future major versions of CUDACC.
|
| 33 |
+
// We make sure that these get the highest known PTX ISA version.
|
| 34 |
+
#if (defined(__CUDACC_VER_MAJOR__) && (__CUDACC_VER_MAJOR__ > 12)) || (!defined(__CUDACC_VER_MAJOR__))
|
| 35 |
+
# define __cccl_ptx_isa 830ULL
|
| 36 |
+
#elif (defined(__CUDACC_VER_MAJOR__) && (__CUDACC_VER_MAJOR__ >= 12 && __CUDACC_VER_MINOR__ >= 3)) \
|
| 37 |
+
|| (!defined(__CUDACC_VER_MAJOR__))
|
| 38 |
+
# define __cccl_ptx_isa 830ULL
|
| 39 |
+
// PTX ISA 8.2 is available from CUDA 12.2, driver r535
|
| 40 |
+
#elif (defined(__CUDACC_VER_MAJOR__) && (__CUDACC_VER_MAJOR__ >= 12 && __CUDACC_VER_MINOR__ >= 2)) \
|
| 41 |
+
|| (!defined(__CUDACC_VER_MAJOR__))
|
| 42 |
+
# define __cccl_ptx_isa 820ULL
|
| 43 |
+
// PTX ISA 8.1 is available from CUDA 12.1, driver r530
|
| 44 |
+
#elif (defined(__CUDACC_VER_MAJOR__) && (__CUDACC_VER_MAJOR__ >= 12 && __CUDACC_VER_MINOR__ >= 1)) \
|
| 45 |
+
|| (!defined(__CUDACC_VER_MAJOR__))
|
| 46 |
+
# define __cccl_ptx_isa 810ULL
|
| 47 |
+
// PTX ISA 8.0 is available from CUDA 12.0, driver r525
|
| 48 |
+
#elif (defined(__CUDACC_VER_MAJOR__) && (__CUDACC_VER_MAJOR__ >= 12 && __CUDACC_VER_MINOR__ >= 0)) \
|
| 49 |
+
|| (!defined(__CUDACC_VER_MAJOR__))
|
| 50 |
+
# define __cccl_ptx_isa 800ULL
|
| 51 |
+
// PTX ISA 7.8 is available from CUDA 11.8, driver r520
|
| 52 |
+
#elif (defined(__CUDACC_VER_MAJOR__) && (__CUDACC_VER_MAJOR__ >= 11 && __CUDACC_VER_MINOR__ >= 8)) \
|
| 53 |
+
|| (!defined(__CUDACC_VER_MAJOR__))
|
| 54 |
+
# define __cccl_ptx_isa 780ULL
|
| 55 |
+
// PTX ISA 7.7 is available from CUDA 11.7, driver r515
|
| 56 |
+
#elif (defined(__CUDACC_VER_MAJOR__) && (__CUDACC_VER_MAJOR__ >= 11 && __CUDACC_VER_MINOR__ >= 7)) \
|
| 57 |
+
|| (!defined(__CUDACC_VER_MAJOR__))
|
| 58 |
+
# define __cccl_ptx_isa 770ULL
|
| 59 |
+
// PTX ISA 7.6 is available from CUDA 11.6, driver r510
|
| 60 |
+
#elif (defined(__CUDACC_VER_MAJOR__) && (__CUDACC_VER_MAJOR__ >= 11 && __CUDACC_VER_MINOR__ >= 6)) \
|
| 61 |
+
|| (!defined(__CUDACC_VER_MAJOR__))
|
| 62 |
+
# define __cccl_ptx_isa 760ULL
|
| 63 |
+
// PTX ISA 7.5 is available from CUDA 11.5, driver r495
|
| 64 |
+
#elif (defined(__CUDACC_VER_MAJOR__) && (__CUDACC_VER_MAJOR__ >= 11 && __CUDACC_VER_MINOR__ >= 5)) \
|
| 65 |
+
|| (!defined(__CUDACC_VER_MAJOR__))
|
| 66 |
+
# define __cccl_ptx_isa 750ULL
|
| 67 |
+
// PTX ISA 7.4 is available from CUDA 11.4, driver r470
|
| 68 |
+
#elif (defined(__CUDACC_VER_MAJOR__) && (__CUDACC_VER_MAJOR__ >= 11 && __CUDACC_VER_MINOR__ >= 4)) \
|
| 69 |
+
|| (!defined(__CUDACC_VER_MAJOR__))
|
| 70 |
+
# define __cccl_ptx_isa 740ULL
|
| 71 |
+
// PTX ISA 7.3 is available from CUDA 11.3, driver r465
|
| 72 |
+
#elif (defined(__CUDACC_VER_MAJOR__) && (__CUDACC_VER_MAJOR__ >= 11 && __CUDACC_VER_MINOR__ >= 3)) \
|
| 73 |
+
|| (!defined(__CUDACC_VER_MAJOR__))
|
| 74 |
+
# define __cccl_ptx_isa 730ULL
|
| 75 |
+
// PTX ISA 7.2 is available from CUDA 11.2, driver r460
|
| 76 |
+
#elif (defined(__CUDACC_VER_MAJOR__) && (__CUDACC_VER_MAJOR__ >= 11 && __CUDACC_VER_MINOR__ >= 2)) \
|
| 77 |
+
|| (!defined(__CUDACC_VER_MAJOR__))
|
| 78 |
+
# define __cccl_ptx_isa 720ULL
|
| 79 |
+
// PTX ISA 7.1 is available from CUDA 11.1, driver r455
|
| 80 |
+
#elif (defined(__CUDACC_VER_MAJOR__) && (__CUDACC_VER_MAJOR__ >= 11 && __CUDACC_VER_MINOR__ >= 1)) \
|
| 81 |
+
|| (!defined(__CUDACC_VER_MAJOR__))
|
| 82 |
+
# define __cccl_ptx_isa 710ULL
|
| 83 |
+
// PTX ISA 7.0 is available from CUDA 11.0, driver r445
|
| 84 |
+
#elif (defined(__CUDACC_VER_MAJOR__) && (__CUDACC_VER_MAJOR__ >= 11 && __CUDACC_VER_MINOR__ >= 0)) \
|
| 85 |
+
|| (!defined(__CUDACC_VER_MAJOR__))
|
| 86 |
+
# define __cccl_ptx_isa 700ULL
|
| 87 |
+
// Fallback case. Define the ISA version to be zero. This ensures that the macro is always defined.
|
| 88 |
+
#else
|
| 89 |
+
# define __cccl_ptx_isa 0ULL
|
| 90 |
+
#endif
|
| 91 |
+
|
| 92 |
+
// We define certain feature test macros depending on availability. When
|
| 93 |
+
// __CUDA_MINIMUM_ARCH__ is not available, we define the following features
|
| 94 |
+
// depending on PTX ISA. This permits checking for the feature in host code.
|
| 95 |
+
// When __CUDA_MINIMUM_ARCH__ is available, we only enable the feature when the
|
| 96 |
+
// hardware supports it.
|
| 97 |
+
#if __cccl_ptx_isa >= 800
|
| 98 |
+
#if (!defined(__CUDA_MINIMUM_ARCH__)) \
|
| 99 |
+
|| (defined(__CUDA_MINIMUM_ARCH__) && 900 <= __CUDA_MINIMUM_ARCH__)
|
| 100 |
+
# define __cccl_lib_local_barrier_arrive_tx
|
| 101 |
+
# define __cccl_lib_experimental_ctk12_cp_async_exposure
|
| 102 |
+
#endif
|
| 103 |
+
#endif // __cccl_ptx_isa >= 800
|
| 104 |
+
|
| 105 |
+
#endif // __CCCL_PTX_ISA_H_
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__cccl/version.h
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of libcu++, the C++ Standard Library for your entire system,
|
| 4 |
+
// under the Apache License v2.0 with LLVM Exceptions.
|
| 5 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 6 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 7 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 8 |
+
//
|
| 9 |
+
//===----------------------------------------------------------------------===//
|
| 10 |
+
|
| 11 |
+
#ifndef __CCCL_VERSION_H
|
| 12 |
+
#define __CCCL_VERSION_H
|
| 13 |
+
|
| 14 |
+
#define CCCL_VERSION 2003002
|
| 15 |
+
#define CCCL_MAJOR_VERSION (CCCL_VERSION / 1000000)
|
| 16 |
+
#define CCCL_MINOR_VERSION (((CCCL_VERSION / 1000) % 1000))
|
| 17 |
+
#define CCCL_PATCH_VERSION (CCCL_VERSION % 1000)
|
| 18 |
+
|
| 19 |
+
#if CCCL_PATCH_VERSION > 99
|
| 20 |
+
#error "CCCL patch version cannot be greater than 99 for compatibility with Thrust/CUB's MMMmmmpp format."
|
| 21 |
+
#endif
|
| 22 |
+
|
| 23 |
+
#endif // __CCCL_VERSION_H
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__cccl/visibility.h
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of libcu++, the C++ Standard Library for your entire system,
|
| 4 |
+
// under the Apache License v2.0 with LLVM Exceptions.
|
| 5 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 6 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 7 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 8 |
+
//
|
| 9 |
+
//===----------------------------------------------------------------------===//
|
| 10 |
+
|
| 11 |
+
#ifndef __CCCL_VISIBILITY_H
|
| 12 |
+
#define __CCCL_VISIBILITY_H
|
| 13 |
+
|
| 14 |
+
#ifndef __CCCL_CONFIG
|
| 15 |
+
#error "<__cccl/visibility.h> should only be included in from <cuda/__cccl_config>"
|
| 16 |
+
#endif // __CCCL_CONFIG
|
| 17 |
+
|
| 18 |
+
// We want to ensure that all warning emmiting from this header are supressed
|
| 19 |
+
#if defined(_CCCL_FORCE_SYSTEM_HEADER_GCC)
|
| 20 |
+
# pragma GCC system_header
|
| 21 |
+
#elif defined(_CCCL_FORCE_SYSTEM_HEADER_CLANG)
|
| 22 |
+
# pragma clang system_header
|
| 23 |
+
#elif defined(_CCCL_FORCE_SYSTEM_HEADER_MSVC)
|
| 24 |
+
# pragma system_header
|
| 25 |
+
#endif // no system header
|
| 26 |
+
|
| 27 |
+
// For unknown reasons, nvc++ need to selectively disable this warning
|
| 28 |
+
// We do not want to use our usual macro because that would have push / pop semantics
|
| 29 |
+
#if defined(_CCCL_COMPILER_NVHPC)
|
| 30 |
+
# pragma nv_diag_suppress 1407
|
| 31 |
+
#endif // _CCCL_COMPILER_NVHPC
|
| 32 |
+
|
| 33 |
+
// Enable us to hide kernels
|
| 34 |
+
#if defined(_CCCL_COMPILER_MSVC)
|
| 35 |
+
# define _CCCL_ATTRIBUTE_HIDDEN
|
| 36 |
+
#elif defined(_CCCL_COMPILER_NVRTC)
|
| 37 |
+
# define _CCCL_ATTRIBUTE_HIDDEN
|
| 38 |
+
#else // ^^^ _CCCL_COMPILER_NVRTC ^^^ / vvv _CCCL_COMPILER_NVRTC vvv
|
| 39 |
+
# define _CCCL_ATTRIBUTE_HIDDEN __attribute__ ((__visibility__("hidden")))
|
| 40 |
+
#endif // !_CCCL_COMPILER_NVRTC
|
| 41 |
+
|
| 42 |
+
#if !defined(CCCL_DETAIL_KERNEL_ATTRIBUTES)
|
| 43 |
+
# define CCCL_DETAIL_KERNEL_ATTRIBUTES __global__ _CCCL_ATTRIBUTE_HIDDEN
|
| 44 |
+
#endif // !CCCL_DETAIL_KERNEL_ATTRIBUTES
|
| 45 |
+
|
| 46 |
+
#endif // __CCCL_VISIBILITY_H
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__cccl_config
ADDED
|
@@ -0,0 +1,194 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of libcu++, the C++ Standard Library for your entire system,
|
| 4 |
+
// under the Apache License v2.0 with LLVM Exceptions.
|
| 5 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 6 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 7 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 8 |
+
//
|
| 9 |
+
//===----------------------------------------------------------------------===//
|
| 10 |
+
|
| 11 |
+
#ifndef __CCCL_CONFIG
|
| 12 |
+
#define __CCCL_CONFIG
|
| 13 |
+
|
| 14 |
+
// Determine the host compiler
|
| 15 |
+
#if defined(__INTEL_LLVM_COMPILER)
|
| 16 |
+
# define _CCCL_COMPILER_ICC_LLVM
|
| 17 |
+
#elif defined(__INTEL_COMPILER)
|
| 18 |
+
# define _CCCL_COMPILER_ICC
|
| 19 |
+
#elif defined(__NVCOMPILER)
|
| 20 |
+
# define _CCCL_COMPILER_NVHPC
|
| 21 |
+
#elif defined(__clang__)
|
| 22 |
+
# define _CCCL_COMPILER_CLANG
|
| 23 |
+
#elif defined(__GNUC__)
|
| 24 |
+
# define _CCCL_COMPILER_GCC
|
| 25 |
+
#elif defined(_MSC_VER)
|
| 26 |
+
# define _CCCL_COMPILER_MSVC
|
| 27 |
+
#elif defined(__IBMCPP__)
|
| 28 |
+
# define _CCCL_COMPILER_IBM
|
| 29 |
+
#elif defined(__CUDACC_RTC__)
|
| 30 |
+
# define _CCCL_COMPILER_NVRTC
|
| 31 |
+
#endif
|
| 32 |
+
|
| 33 |
+
// Convenient shortcut to determine which version of MSVC we are dealing with
|
| 34 |
+
#if defined(_CCCL_COMPILER_MSVC)
|
| 35 |
+
# if _MSC_VER < 1917
|
| 36 |
+
# define _CCCL_COMPILER_MSVC_2017
|
| 37 |
+
# elif _MSC_VER < 1930
|
| 38 |
+
# define _CCCL_COMPILER_MSVC_2019
|
| 39 |
+
# else // _MSC_VER < 1940
|
| 40 |
+
# define _CCCL_COMPILER_MSVC_2022
|
| 41 |
+
# endif // _MSC_VER < 1940
|
| 42 |
+
#endif // _CCCL_COMPILER_MSVC
|
| 43 |
+
|
| 44 |
+
// Determine the cuda compiler
|
| 45 |
+
#if defined(__NVCC__)
|
| 46 |
+
# define _CCCL_CUDA_COMPILER_NVCC
|
| 47 |
+
#elif defined(_NVHPC_CUDA)
|
| 48 |
+
# define _CCCL_CUDA_COMPILER_NVHPC
|
| 49 |
+
#elif defined(__CUDA__) && defined(_CCCL_COMPILER_CLANG)
|
| 50 |
+
# define _CCCL_CUDA_COMPILER_CLANG
|
| 51 |
+
#endif
|
| 52 |
+
|
| 53 |
+
// Shorthand to check whether there is a cuda compiler available
|
| 54 |
+
#if defined(_CCCL_CUDA_COMPILER_NVCC) || defined(_CCCL_CUDA_COMPILER_NVHPC) || defined(_CCCL_CUDA_COMPILER_CLANG) \
|
| 55 |
+
|| defined(_CCCL_COMPILER_NVRTC)
|
| 56 |
+
# define _CCCL_CUDA_COMPILER
|
| 57 |
+
#endif // cuda compiler available
|
| 58 |
+
|
| 59 |
+
// Enforce that cccl headers are treated as system headers
|
| 60 |
+
#if defined(_CCCL_COMPILER_GCC) || defined(_CCCL_COMPILER_NVHPC) || defined(_CCCL_COMPILER_ICC) \
|
| 61 |
+
|| defined(_CCCL_COMPILER_ICC_LLVM)
|
| 62 |
+
# define _CCCL_FORCE_SYSTEM_HEADER_GCC
|
| 63 |
+
#elif defined(_CCCL_COMPILER_CLANG)
|
| 64 |
+
# define _CCCL_FORCE_SYSTEM_HEADER_CLANG
|
| 65 |
+
#elif defined(_CCCL_COMPILER_MSVC)
|
| 66 |
+
# define _CCCL_FORCE_SYSTEM_HEADER_MSVC
|
| 67 |
+
#endif // other compilers
|
| 68 |
+
|
| 69 |
+
// Potentially enable that cccl headers are treated as system headers
|
| 70 |
+
#if !defined(_CCCL_NO_SYSTEM_HEADER) \
|
| 71 |
+
&& !(defined(_CCCL_COMPILER_MSVC) && defined(_LIBCUDACXX_DISABLE_PRAGMA_MSVC_WARNING)) \
|
| 72 |
+
&& !defined(_CCCL_COMPILER_NVRTC) && !defined(_LIBCUDACXX_DISABLE_PRAGMA_GCC_SYSTEM_HEADER)
|
| 73 |
+
# if defined(_CCCL_COMPILER_GCC) || defined(_CCCL_COMPILER_NVHPC) || defined(_CCCL_COMPILER_ICC) \
|
| 74 |
+
|| defined(_CCCL_COMPILER_ICC_LLVM)
|
| 75 |
+
# define _CCCL_IMPLICIT_SYSTEM_HEADER_GCC
|
| 76 |
+
# elif defined(_CCCL_COMPILER_CLANG)
|
| 77 |
+
# define _CCCL_IMPLICIT_SYSTEM_HEADER_CLANG
|
| 78 |
+
# elif defined(_CCCL_COMPILER_MSVC)
|
| 79 |
+
# define _CCCL_IMPLICIT_SYSTEM_HEADER_MSVC
|
| 80 |
+
# endif // other compilers
|
| 81 |
+
#endif // Use system header
|
| 82 |
+
|
| 83 |
+
// Potentially silence all warnings from this header
|
| 84 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 85 |
+
# pragma GCC system_header
|
| 86 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 87 |
+
# pragma clang system_header
|
| 88 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 89 |
+
# pragma system_header
|
| 90 |
+
#endif // no system header
|
| 91 |
+
|
| 92 |
+
// Enable us to selectively silence host compiler warnings
|
| 93 |
+
#define _CCCL_TOSTRING2(_STR) #_STR
|
| 94 |
+
#define _CCCL_TOSTRING(_STR) _CCCL_TOSTRING2(_STR)
|
| 95 |
+
#ifdef _CCCL_COMPILER_CLANG
|
| 96 |
+
# define _CCCL_DIAG_PUSH _Pragma("clang diagnostic push")
|
| 97 |
+
# define _CCCL_DIAG_POP _Pragma("clang diagnostic pop")
|
| 98 |
+
# define _CCCL_DIAG_SUPPRESS_CLANG(str) _Pragma(_CCCL_TOSTRING(clang diagnostic ignored str))
|
| 99 |
+
# define _CCCL_DIAG_SUPPRESS_GCC(str)
|
| 100 |
+
# define _CCCL_DIAG_SUPPRESS_NVHPC(str)
|
| 101 |
+
# define _CCCL_DIAG_SUPPRESS_MSVC(str)
|
| 102 |
+
#elif defined(_CCCL_COMPILER_GCC)
|
| 103 |
+
# define _CCCL_DIAG_PUSH _Pragma("GCC diagnostic push")
|
| 104 |
+
# define _CCCL_DIAG_POP _Pragma("GCC diagnostic pop")
|
| 105 |
+
# define _CCCL_DIAG_SUPPRESS_CLANG(str)
|
| 106 |
+
# define _CCCL_DIAG_SUPPRESS_GCC(str) _Pragma(_CCCL_TOSTRING(GCC diagnostic ignored str))
|
| 107 |
+
# define _CCCL_DIAG_SUPPRESS_NVHPC(str)
|
| 108 |
+
# define _CCCL_DIAG_SUPPRESS_MSVC(str)
|
| 109 |
+
#elif defined(_CCCL_COMPILER_NVHPC)
|
| 110 |
+
# define _CCCL_DIAG_PUSH _Pragma("diagnostic push")
|
| 111 |
+
# define _CCCL_DIAG_POP _Pragma("diagnostic pop")
|
| 112 |
+
# define _CCCL_DIAG_SUPPRESS_CLANG(str)
|
| 113 |
+
# define _CCCL_DIAG_SUPPRESS_GCC(str)
|
| 114 |
+
# define _CCCL_DIAG_SUPPRESS_NVHPC(str) _Pragma(_CCCL_TOSTRING(diag_suppress str))
|
| 115 |
+
# define _CCCL_DIAG_SUPPRESS_MSVC(str)
|
| 116 |
+
#elif defined(_CCCL_COMPILER_MSVC)
|
| 117 |
+
# define _CCCL_DIAG_PUSH __pragma(warning(push))
|
| 118 |
+
# define _CCCL_DIAG_POP __pragma(warning(pop))
|
| 119 |
+
# define _CCCL_DIAG_SUPPRESS_CLANG(str)
|
| 120 |
+
# define _CCCL_DIAG_SUPPRESS_GCC(str)
|
| 121 |
+
# define _CCCL_DIAG_SUPPRESS_NVHPC(str)
|
| 122 |
+
# define _CCCL_DIAG_SUPPRESS_MSVC(str) __pragma(warning(disable : str))
|
| 123 |
+
#else
|
| 124 |
+
# define _CCCL_DIAG_PUSH
|
| 125 |
+
# define _CCCL_DIAG_POP
|
| 126 |
+
# define _CCCL_DIAG_SUPPRESS_CLANG(str)
|
| 127 |
+
# define _CCCL_DIAG_SUPPRESS_GCC(str)
|
| 128 |
+
# define _CCCL_DIAG_SUPPRESS_NVHPC(str)
|
| 129 |
+
# define _CCCL_DIAG_SUPPRESS_MSVC(str)
|
| 130 |
+
#endif
|
| 131 |
+
|
| 132 |
+
// Convenient shortcuts to silence common warnings
|
| 133 |
+
#if defined(_CCCL_COMPILER_CLANG)
|
| 134 |
+
# define _CCCL_DIAG_SUPPRESS_DEPRECATED_PUSH \
|
| 135 |
+
_CCCL_DIAG_PUSH \
|
| 136 |
+
_CCCL_DIAG_SUPPRESS_CLANG("-Wdeprecated") \
|
| 137 |
+
_CCCL_DIAG_SUPPRESS_CLANG("-Wdeprecated-declarations")
|
| 138 |
+
# define _CCCL_DIAG_SUPPRESS_DEPRECATED_POP _CCCL_DIAG_POP
|
| 139 |
+
#elif defined(_CCCL_COMPILER_GCC)
|
| 140 |
+
# define _CCCL_DIAG_SUPPRESS_DEPRECATED_PUSH \
|
| 141 |
+
_CCCL_DIAG_PUSH \
|
| 142 |
+
_CCCL_DIAG_SUPPRESS_GCC("-Wdeprecated") \
|
| 143 |
+
_CCCL_DIAG_SUPPRESS_GCC("-Wdeprecated-declarations")
|
| 144 |
+
# define _CCCL_DIAG_SUPPRESS_DEPRECATED_POP _CCCL_DIAG_POP
|
| 145 |
+
#elif defined(_CCCL_COMPILER_MSVC)
|
| 146 |
+
# define _CCCL_DIAG_SUPPRESS_DEPRECATED_PUSH \
|
| 147 |
+
_CCCL_DIAG_PUSH \
|
| 148 |
+
_CCCL_DIAG_SUPPRESS_MSVC(4996)
|
| 149 |
+
# define _CCCL_DIAG_SUPPRESS_DEPRECATED_POP _CCCL_DIAG_POP
|
| 150 |
+
#else // !_CCCL_COMPILER_CLANG && !_CCCL_COMPILER_GCC
|
| 151 |
+
# define _CCCL_DIAG_SUPPRESS_DEPRECATED_PUSH
|
| 152 |
+
# define _CCCL_DIAG_SUPPRESS_DEPRECATED_POP
|
| 153 |
+
#endif // !_CCCL_COMPILER_CLANG && !_CCCL_COMPILER_GCC
|
| 154 |
+
|
| 155 |
+
// Enable us to selectively silence cuda compiler warnings
|
| 156 |
+
#if defined(__CUDACC__)
|
| 157 |
+
# if !defined(_CCCL_CUDA_COMPILER_CLANG)
|
| 158 |
+
# define _CCCL_NV_DIAG_SUPPRESS(_WARNING)
|
| 159 |
+
# define _CCCL_NV_DIAG_DEFAULT(_WARNING)
|
| 160 |
+
# elif defined(__NVCC_DIAG_PRAGMA_SUPPORT__)
|
| 161 |
+
# if defined(_CCCL_COMPILER_MSVC)
|
| 162 |
+
# define _CCCL_NV_DIAG_SUPPRESS(_WARNING) __pragma(_CCCL_TOSTRING(nv_diag_suppress _WARNING))
|
| 163 |
+
# define _CCCL_NV_DIAG_DEFAULT(_WARNING) __pragma(_CCCL_TOSTRING(nv_diag_default _WARNING))
|
| 164 |
+
# else // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv !_CCCL_COMPILER_MSVC vvv
|
| 165 |
+
# define _CCCL_NV_DIAG_SUPPRESS(_WARNING) \
|
| 166 |
+
_Pragma(_CCCL_TOSTRING(nv_diagnostic push)) _Pragma(_CCCL_TOSTRING(nv_diag_suppress _WARNING))
|
| 167 |
+
# define _CCCL_NV_DIAG_DEFAULT(_WARNING) _Pragma(_CCCL_TOSTRING(nv_diagnostic pop))
|
| 168 |
+
# endif // !_CCCL_COMPILER_MSVC
|
| 169 |
+
# elif defined(_CCCL_COMPILER_NVHPC)
|
| 170 |
+
# define _CCCL_NV_DIAG_SUPPRESS(_WARNING) \
|
| 171 |
+
_Pragma(_CCCL_TOSTRING(diagnostic push)) _Pragma(_CCCL_TOSTRING(diag_suppress _WARNING))
|
| 172 |
+
# define _CCCL_NV_DIAG_DEFAULT(_WARNING) _Pragma(_CCCL_TOSTRING(diagnostic pop))
|
| 173 |
+
# else // ^^^ __NVCC_DIAG_PRAGMA_SUPPORT__ ^^^ / vvv !__NVCC_DIAG_PRAGMA_SUPPORT__ vvv
|
| 174 |
+
# if defined(_CCCL_COMPILER_MSVC_2017) // MSVC 2017 has issues with restoring the warning
|
| 175 |
+
# define _CCCL_NV_DIAG_SUPPRESS(_WARNING) __pragma(_CCCL_TOSTRING(diag_suppress _WARNING))
|
| 176 |
+
# define _CCCL_NV_DIAG_DEFAULT(_WARNING)
|
| 177 |
+
# elif defined(_CCCL_COMPILER_MSVC)
|
| 178 |
+
# define _CCCL_NV_DIAG_SUPPRESS(_WARNING) __pragma(_CCCL_TOSTRING(diag_suppress _WARNING))
|
| 179 |
+
# define _CCCL_NV_DIAG_DEFAULT(_WARNING) __pragma(_CCCL_TOSTRING(diag_default _WARNING))
|
| 180 |
+
# else // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv !_CCCL_COMPILER_MSVC vvv
|
| 181 |
+
# define _CCCL_NV_DIAG_SUPPRESS(_WARNING) _Pragma(_CCCL_TOSTRING(diag_suppress _WARNING))
|
| 182 |
+
# define _CCCL_NV_DIAG_DEFAULT(_WARNING) _Pragma(_CCCL_TOSTRING(diag_default _WARNING))
|
| 183 |
+
# endif // !_CCCL_COMPILER_MSVC
|
| 184 |
+
# endif // !__NVCC_DIAG_PRAGMA_SUPPORT__
|
| 185 |
+
#else // ^^^ __CUDACC__ ^^^ / vvv !__CUDACC__ vvv
|
| 186 |
+
# define _CCCL_NV_DIAG_SUPPRESS(_WARNING)
|
| 187 |
+
# define _CCCL_NV_DIAG_DEFAULT(_WARNING)
|
| 188 |
+
#endif // other compilers
|
| 189 |
+
|
| 190 |
+
#include "__cccl/ptx_isa.h"
|
| 191 |
+
#include "__cccl/version.h"
|
| 192 |
+
#include "__cccl/visibility.h"
|
| 193 |
+
|
| 194 |
+
#endif // __CCCL_CONFIG
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/_One_of.h
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
| 4 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 5 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 6 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
|
| 10 |
+
#ifndef _LIBCUDACXX___CONCEPTS_ONE_OF_H
|
| 11 |
+
#define _LIBCUDACXX___CONCEPTS_ONE_OF_H
|
| 12 |
+
|
| 13 |
+
#ifndef __cuda_std__
|
| 14 |
+
#include <__config>
|
| 15 |
+
#endif //__cuda_std__
|
| 16 |
+
|
| 17 |
+
#include "../__concepts/__concept_macros.h"
|
| 18 |
+
#include "../__type_traits/disjunction.h"
|
| 19 |
+
#include "../__type_traits/is_same.h"
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
_LIBCUDACXX_BEGIN_NAMESPACE_STD
|
| 30 |
+
|
| 31 |
+
#if _LIBCUDACXX_STD_VER > 14
|
| 32 |
+
template <class _Ty, class... _Others>
|
| 33 |
+
_LIBCUDACXX_CONCEPT _One_of = (is_same_v<_Ty, _Others> || ...);
|
| 34 |
+
#elif _LIBCUDACXX_STD_VER > 11
|
| 35 |
+
template <class _Ty, class... _Others>
|
| 36 |
+
_LIBCUDACXX_CONCEPT _One_of = _LIBCUDACXX_TRAIT(disjunction, is_same<_Ty, _Others>...);
|
| 37 |
+
#endif // _LIBCUDACXX_STD_VER > 11
|
| 38 |
+
|
| 39 |
+
_LIBCUDACXX_END_NAMESPACE_STD
|
| 40 |
+
|
| 41 |
+
#endif // _LIBCUDACXX___CONCEPTS_ONE_OF_H
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/__concept_macros.h
ADDED
|
@@ -0,0 +1,299 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Copyright (c) Facebook, Inc. and its affiliates.
|
| 4 |
+
// Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
| 5 |
+
//
|
| 6 |
+
// Part of libcu++, the C++ Standard Library for your entire system,
|
| 7 |
+
// under the Apache License v2.0 with LLVM Exceptions.
|
| 8 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 9 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 10 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 11 |
+
//
|
| 12 |
+
//===----------------------------------------------------------------------===//
|
| 13 |
+
|
| 14 |
+
#ifndef _CUDA___CONCEPTS
|
| 15 |
+
#define _CUDA___CONCEPTS
|
| 16 |
+
|
| 17 |
+
#ifndef __cuda_std__
|
| 18 |
+
#include <__config>
|
| 19 |
+
#endif //__cuda_std__
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
#if _LIBCUDACXX_STD_VER > 11
|
| 30 |
+
|
| 31 |
+
#define _LIBCUDACXX_PP_CAT_(_Xp, ...) _Xp##__VA_ARGS__
|
| 32 |
+
#define _LIBCUDACXX_PP_CAT(_Xp, ...) _LIBCUDACXX_PP_CAT_(_Xp, __VA_ARGS__)
|
| 33 |
+
|
| 34 |
+
#define _LIBCUDACXX_PP_CAT2_(_Xp, ...) _Xp##__VA_ARGS__
|
| 35 |
+
#define _LIBCUDACXX_PP_CAT2(_Xp, ...) _LIBCUDACXX_PP_CAT2_(_Xp, __VA_ARGS__)
|
| 36 |
+
|
| 37 |
+
#define _LIBCUDACXX_PP_CAT3_(_Xp, ...) _Xp##__VA_ARGS__
|
| 38 |
+
#define _LIBCUDACXX_PP_CAT3(_Xp, ...) _LIBCUDACXX_PP_CAT3_(_Xp, __VA_ARGS__)
|
| 39 |
+
|
| 40 |
+
#define _LIBCUDACXX_PP_CAT4_(_Xp, ...) _Xp##__VA_ARGS__
|
| 41 |
+
#define _LIBCUDACXX_PP_CAT4(_Xp, ...) _LIBCUDACXX_PP_CAT4_(_Xp, __VA_ARGS__)
|
| 42 |
+
|
| 43 |
+
#define _LIBCUDACXX_PP_EVAL_(_Xp, _ARGS) _Xp _ARGS
|
| 44 |
+
#define _LIBCUDACXX_PP_EVAL(_Xp, ...) _LIBCUDACXX_PP_EVAL_(_Xp, (__VA_ARGS__))
|
| 45 |
+
|
| 46 |
+
#define _LIBCUDACXX_PP_EVAL2_(_Xp, _ARGS) _Xp _ARGS
|
| 47 |
+
#define _LIBCUDACXX_PP_EVAL2(_Xp, ...) _LIBCUDACXX_PP_EVAL2_(_Xp, (__VA_ARGS__))
|
| 48 |
+
|
| 49 |
+
#define _LIBCUDACXX_PP_EXPAND(...) __VA_ARGS__
|
| 50 |
+
#define _LIBCUDACXX_PP_EAT(...)
|
| 51 |
+
|
| 52 |
+
#define _LIBCUDACXX_PP_CHECK(...) \
|
| 53 |
+
_LIBCUDACXX_PP_EXPAND(_LIBCUDACXX_PP_CHECK_N(__VA_ARGS__, 0, ))
|
| 54 |
+
#define _LIBCUDACXX_PP_CHECK_N(_Xp, _Num, ...) _Num
|
| 55 |
+
#define _LIBCUDACXX_PP_PROBE(_Xp) _Xp, 1,
|
| 56 |
+
#define _LIBCUDACXX_PP_PROBE_N(_Xp, _Num) _Xp, _Num,
|
| 57 |
+
|
| 58 |
+
#define _LIBCUDACXX_PP_IS_PAREN(_Xp) \
|
| 59 |
+
_LIBCUDACXX_PP_CHECK(_LIBCUDACXX_PP_IS_PAREN_PROBE _Xp)
|
| 60 |
+
#define _LIBCUDACXX_PP_IS_PAREN_PROBE(...) _LIBCUDACXX_PP_PROBE(~)
|
| 61 |
+
|
| 62 |
+
// The final _LIBCUDACXX_PP_EXPAND here is to avoid
|
| 63 |
+
// https://stackoverflow.com/questions/5134523/msvc-doesnt-expand-va-args-correctly
|
| 64 |
+
#define _LIBCUDACXX_PP_COUNT(...) \
|
| 65 |
+
_LIBCUDACXX_PP_EXPAND(_LIBCUDACXX_PP_COUNT_( \
|
| 66 |
+
__VA_ARGS__, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, \
|
| 67 |
+
35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, \
|
| 68 |
+
17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, )) \
|
| 69 |
+
/**/
|
| 70 |
+
#define _LIBCUDACXX_PP_COUNT_( \
|
| 71 |
+
_01, _02, _03, _04, _05, _06, _07, _08, _09, _10, _11, _12, _13, _14, _15, \
|
| 72 |
+
_16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, \
|
| 73 |
+
_31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, \
|
| 74 |
+
_46, _47, _48, _49, _50, _Np, ...) \
|
| 75 |
+
_Np /**/
|
| 76 |
+
|
| 77 |
+
#define _LIBCUDACXX_PP_IIF(_BIT) _LIBCUDACXX_PP_CAT_(_LIBCUDACXX_PP_IIF_, _BIT)
|
| 78 |
+
#define _LIBCUDACXX_PP_IIF_0(_TRUE, ...) __VA_ARGS__
|
| 79 |
+
#define _LIBCUDACXX_PP_IIF_1(_TRUE, ...) _TRUE
|
| 80 |
+
|
| 81 |
+
#define _LIBCUDACXX_PP_LPAREN (
|
| 82 |
+
|
| 83 |
+
#define _LIBCUDACXX_PP_NOT(_BIT) _LIBCUDACXX_PP_CAT_(_LIBCUDACXX_PP_NOT_, _BIT)
|
| 84 |
+
#define _LIBCUDACXX_PP_NOT_0 1
|
| 85 |
+
#define _LIBCUDACXX_PP_NOT_1 0
|
| 86 |
+
|
| 87 |
+
#define _LIBCUDACXX_PP_EMPTY()
|
| 88 |
+
#define _LIBCUDACXX_PP_COMMA() ,
|
| 89 |
+
#define _LIBCUDACXX_PP_LBRACE() {
|
| 90 |
+
#define _LIBCUDACXX_PP_RBRACE() }
|
| 91 |
+
#define _LIBCUDACXX_PP_COMMA_IIF(_Xp) \
|
| 92 |
+
_LIBCUDACXX_PP_IIF(_Xp)(_LIBCUDACXX_PP_EMPTY, _LIBCUDACXX_PP_COMMA)() /**/
|
| 93 |
+
|
| 94 |
+
#define _LIBCUDACXX_PP_FOR_EACH(_Mp, ...) \
|
| 95 |
+
_LIBCUDACXX_PP_FOR_EACH_N(_LIBCUDACXX_PP_COUNT(__VA_ARGS__), _Mp, __VA_ARGS__)
|
| 96 |
+
#define _LIBCUDACXX_PP_FOR_EACH_N(_Np, _Mp, ...) \
|
| 97 |
+
_LIBCUDACXX_PP_CAT2(_LIBCUDACXX_PP_FOR_EACH_, _Np)(_Mp, __VA_ARGS__)
|
| 98 |
+
#define _LIBCUDACXX_PP_FOR_EACH_1(_Mp, _1) _Mp(_1)
|
| 99 |
+
#define _LIBCUDACXX_PP_FOR_EACH_2(_Mp, _1, _2) _Mp(_1) _Mp(_2)
|
| 100 |
+
#define _LIBCUDACXX_PP_FOR_EACH_3(_Mp, _1, _2, _3) _Mp(_1) _Mp(_2) _Mp(_3)
|
| 101 |
+
#define _LIBCUDACXX_PP_FOR_EACH_4(_Mp, _1, _2, _3, _4) \
|
| 102 |
+
_Mp(_1) _Mp(_2) _Mp(_3) _Mp(_4)
|
| 103 |
+
#define _LIBCUDACXX_PP_FOR_EACH_5(_Mp, _1, _2, _3, _4, _5) \
|
| 104 |
+
_Mp(_1) _Mp(_2) _Mp(_3) _Mp(_4) _Mp(_5)
|
| 105 |
+
#define _LIBCUDACXX_PP_FOR_EACH_6(_Mp, _1, _2, _3, _4, _5, _6) \
|
| 106 |
+
_Mp(_1) _Mp(_2) _Mp(_3) _Mp(_4) _Mp(_5) _Mp(_6)
|
| 107 |
+
#define _LIBCUDACXX_PP_FOR_EACH_7(_Mp, _1, _2, _3, _4, _5, _6, _7) \
|
| 108 |
+
_Mp(_1) _Mp(_2) _Mp(_3) _Mp(_4) _Mp(_5) _Mp(_6) _Mp(_7)
|
| 109 |
+
#define _LIBCUDACXX_PP_FOR_EACH_8(_Mp, _1, _2, _3, _4, _5, _6, _7, _8) \
|
| 110 |
+
_Mp(_1) _Mp(_2) _Mp(_3) _Mp(_4) _Mp(_5) _Mp(_6) _Mp(_7) _Mp(_8)
|
| 111 |
+
|
| 112 |
+
#define _LIBCUDACXX_PP_PROBE_EMPTY_PROBE__LIBCUDACXX_PP_PROBE_EMPTY \
|
| 113 |
+
_LIBCUDACXX_PP_PROBE(~)
|
| 114 |
+
|
| 115 |
+
#define _LIBCUDACXX_PP_PROBE_EMPTY()
|
| 116 |
+
#define _LIBCUDACXX_PP_IS_NOT_EMPTY(...) \
|
| 117 |
+
_LIBCUDACXX_PP_EVAL( \
|
| 118 |
+
_LIBCUDACXX_PP_CHECK, \
|
| 119 |
+
_LIBCUDACXX_PP_CAT(_LIBCUDACXX_PP_PROBE_EMPTY_PROBE_, \
|
| 120 |
+
_LIBCUDACXX_PP_PROBE_EMPTY __VA_ARGS__())) \
|
| 121 |
+
/**/
|
| 122 |
+
|
| 123 |
+
#define _LIBCUDACXX_PP_TAIL(_, ...) __VA_ARGS__
|
| 124 |
+
|
| 125 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT_REQS_M0(_REQ) \
|
| 126 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT_REQS_SELECT_(_REQ)(_REQ)
|
| 127 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT_REQS_M1(_REQ) _LIBCUDACXX_PP_EXPAND _REQ
|
| 128 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT_REQS_(...) \
|
| 129 |
+
{ _LIBCUDACXX_PP_FOR_EACH(_LIBCUDACXX_CONCEPT_FRAGMENT_REQS_M, __VA_ARGS__) }
|
| 130 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT_REQS_SELECT_(_REQ) \
|
| 131 |
+
_LIBCUDACXX_PP_CAT3( \
|
| 132 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT_REQS_SELECT_, \
|
| 133 |
+
_LIBCUDACXX_PP_EVAL( \
|
| 134 |
+
_LIBCUDACXX_PP_CHECK, \
|
| 135 |
+
_LIBCUDACXX_PP_CAT3(_LIBCUDACXX_CONCEPT_FRAGMENT_REQS_SELECT_PROBE_, \
|
| 136 |
+
_REQ))) \
|
| 137 |
+
/**/
|
| 138 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT_REQS_SELECT_PROBE_requires \
|
| 139 |
+
_LIBCUDACXX_PP_PROBE_N(~, 1)
|
| 140 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT_REQS_SELECT_PROBE_noexcept \
|
| 141 |
+
_LIBCUDACXX_PP_PROBE_N(~, 2)
|
| 142 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT_REQS_SELECT_PROBE_typename \
|
| 143 |
+
_LIBCUDACXX_PP_PROBE_N(~, 3)
|
| 144 |
+
|
| 145 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT_REQS_SELECT_0 _LIBCUDACXX_PP_EXPAND
|
| 146 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT_REQS_SELECT_1 \
|
| 147 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT_REQS_REQUIRES_OR_NOEXCEPT
|
| 148 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT_REQS_SELECT_2 \
|
| 149 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT_REQS_REQUIRES_OR_NOEXCEPT
|
| 150 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT_REQS_SELECT_3 \
|
| 151 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT_REQS_REQUIRES_OR_NOEXCEPT
|
| 152 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT_REQS_REQUIRES_OR_NOEXCEPT(_REQ) \
|
| 153 |
+
_LIBCUDACXX_PP_CAT4(_LIBCUDACXX_CONCEPT_FRAGMENT_REQS_REQUIRES_, _REQ)
|
| 154 |
+
#define _LIBCUDACXX_PP_EAT_TYPENAME_PROBE_typename _LIBCUDACXX_PP_PROBE(~)
|
| 155 |
+
#define _LIBCUDACXX_PP_EAT_TYPENAME_SELECT_(_Xp, ...) \
|
| 156 |
+
_LIBCUDACXX_PP_CAT3( \
|
| 157 |
+
_LIBCUDACXX_PP_EAT_TYPENAME_SELECT_, \
|
| 158 |
+
_LIBCUDACXX_PP_EVAL( \
|
| 159 |
+
_LIBCUDACXX_PP_CHECK, \
|
| 160 |
+
_LIBCUDACXX_PP_CAT3(_LIBCUDACXX_PP_EAT_TYPENAME_PROBE_, _Xp)))
|
| 161 |
+
#define _LIBCUDACXX_PP_EAT_TYPENAME_(...) \
|
| 162 |
+
_LIBCUDACXX_PP_EVAL2(_LIBCUDACXX_PP_EAT_TYPENAME_SELECT_, __VA_ARGS__, ) \
|
| 163 |
+
(__VA_ARGS__)
|
| 164 |
+
#define _LIBCUDACXX_PP_EAT_TYPENAME_SELECT_0(...) __VA_ARGS__
|
| 165 |
+
#define _LIBCUDACXX_PP_EAT_TYPENAME_SELECT_1(...) \
|
| 166 |
+
_LIBCUDACXX_PP_CAT3(_LIBCUDACXX_PP_EAT_TYPENAME_, __VA_ARGS__)
|
| 167 |
+
#define _LIBCUDACXX_PP_EAT_TYPENAME_typename
|
| 168 |
+
|
| 169 |
+
#if (defined(__cpp_concepts) && _LIBCUDACXX_STD_VER >= 20) || \
|
| 170 |
+
defined(_LIBCUDACXX_DOXYGEN_INVOKED)
|
| 171 |
+
|
| 172 |
+
#define _LIBCUDACXX_CONCEPT concept
|
| 173 |
+
|
| 174 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT(_NAME, ...) \
|
| 175 |
+
concept _NAME = \
|
| 176 |
+
_LIBCUDACXX_PP_CAT(_LIBCUDACXX_CONCEPT_FRAGMENT_REQS_, __VA_ARGS__)
|
| 177 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT_REQS_requires(...) \
|
| 178 |
+
requires(__VA_ARGS__) _LIBCUDACXX_CONCEPT_FRAGMENT_REQS_
|
| 179 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT_REQS_M(_REQ) \
|
| 180 |
+
_LIBCUDACXX_PP_CAT2(_LIBCUDACXX_CONCEPT_FRAGMENT_REQS_M, \
|
| 181 |
+
_LIBCUDACXX_PP_IS_PAREN(_REQ)) \
|
| 182 |
+
(_REQ);
|
| 183 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT_REQS_REQUIRES_requires(...) \
|
| 184 |
+
requires __VA_ARGS__
|
| 185 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT_REQS_REQUIRES_typename(...) \
|
| 186 |
+
typename _LIBCUDACXX_PP_EAT_TYPENAME_(__VA_ARGS__)
|
| 187 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT_REQS_REQUIRES_noexcept(...) \
|
| 188 |
+
{ __VA_ARGS__ } \
|
| 189 |
+
noexcept
|
| 190 |
+
|
| 191 |
+
#define _LIBCUDACXX_FRAGMENT(_NAME, ...) _NAME<__VA_ARGS__>
|
| 192 |
+
|
| 193 |
+
#else
|
| 194 |
+
|
| 195 |
+
#define _LIBCUDACXX_CONCEPT _LIBCUDACXX_INLINE_VAR constexpr bool
|
| 196 |
+
|
| 197 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT(_NAME, ...) \
|
| 198 |
+
_LIBCUDACXX_INLINE_VISIBILITY auto _NAME##_LIBCUDACXX_CONCEPT_FRAGMENT_impl_ \
|
| 199 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT_REQS_##__VA_ARGS__ > {} \
|
| 200 |
+
template <typename... _As> \
|
| 201 |
+
_LIBCUDACXX_INLINE_VISIBILITY char _NAME##_LIBCUDACXX_CONCEPT_FRAGMENT_( \
|
| 202 |
+
_Concept::_Tag<_As...> *, \
|
| 203 |
+
decltype(&_NAME##_LIBCUDACXX_CONCEPT_FRAGMENT_impl_<_As...>)); \
|
| 204 |
+
_LIBCUDACXX_INLINE_VISIBILITY char( \
|
| 205 |
+
&_NAME##_LIBCUDACXX_CONCEPT_FRAGMENT_(...))[2] /**/
|
| 206 |
+
#if defined(_MSC_VER) && !defined(__clang__)
|
| 207 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT_TRUE(...) \
|
| 208 |
+
_Concept::_Is_true<decltype(_LIBCUDACXX_PP_FOR_EACH( \
|
| 209 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT_REQS_M, __VA_ARGS__) void())>()
|
| 210 |
+
#else
|
| 211 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT_TRUE(...) \
|
| 212 |
+
!(decltype(_LIBCUDACXX_PP_FOR_EACH(_LIBCUDACXX_CONCEPT_FRAGMENT_REQS_M, \
|
| 213 |
+
__VA_ARGS__) void(), \
|
| 214 |
+
false){})
|
| 215 |
+
#endif
|
| 216 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT_REQS_requires(...) \
|
| 217 |
+
(__VA_ARGS__)->_Concept::_Enable_if_t < _LIBCUDACXX_CONCEPT_FRAGMENT_REQS_2_
|
| 218 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT_REQS_2_(...) \
|
| 219 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT_TRUE(__VA_ARGS__)
|
| 220 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT_REQS_M(_REQ) \
|
| 221 |
+
_LIBCUDACXX_PP_CAT2(_LIBCUDACXX_CONCEPT_FRAGMENT_REQS_M, \
|
| 222 |
+
_LIBCUDACXX_PP_IS_PAREN(_REQ)) \
|
| 223 |
+
(_REQ),
|
| 224 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT_REQS_REQUIRES_requires(...) \
|
| 225 |
+
_Concept::_Requires<__VA_ARGS__>
|
| 226 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT_REQS_REQUIRES_typename(...) \
|
| 227 |
+
static_cast<_Concept::_Tag<__VA_ARGS__> *>(nullptr)
|
| 228 |
+
#if defined(_LIBCUDACXX_COMPILER_GCC)
|
| 229 |
+
// GCC can't mangle noexcept expressions, so just check that the
|
| 230 |
+
// expression is well-formed.
|
| 231 |
+
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70790
|
| 232 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT_REQS_REQUIRES_noexcept(...) __VA_ARGS__
|
| 233 |
+
#else
|
| 234 |
+
#define _LIBCUDACXX_CONCEPT_FRAGMENT_REQS_REQUIRES_noexcept(...) \
|
| 235 |
+
_Concept::_Requires<noexcept(__VA_ARGS__)>
|
| 236 |
+
#endif
|
| 237 |
+
|
| 238 |
+
#define _LIBCUDACXX_FRAGMENT(_NAME, ...) \
|
| 239 |
+
(1u == sizeof(_NAME##_LIBCUDACXX_CONCEPT_FRAGMENT_( \
|
| 240 |
+
static_cast<_Concept::_Tag<__VA_ARGS__> *>(nullptr), nullptr)))
|
| 241 |
+
|
| 242 |
+
#endif
|
| 243 |
+
|
| 244 |
+
////////////////////////////////////////////////////////////////////////////////
|
| 245 |
+
// _LIBCUDACXX_TEMPLATE
|
| 246 |
+
// Usage:
|
| 247 |
+
// _LIBCUDACXX_TEMPLATE(typename A, typename _Bp)
|
| 248 |
+
// _LIBCUDACXX_REQUIRES( Concept1<A> _LIBCUDACXX_AND Concept2<_Bp>)
|
| 249 |
+
// void foo(A a, _Bp b)
|
| 250 |
+
// {}
|
| 251 |
+
#if (defined(__cpp_concepts) && _LIBCUDACXX_STD_VER >= 20)
|
| 252 |
+
#define _LIBCUDACXX_TEMPLATE(...) template <__VA_ARGS__>
|
| 253 |
+
#define _LIBCUDACXX_REQUIRES(...) requires __VA_ARGS__
|
| 254 |
+
#define _LIBCUDACXX_AND &&
|
| 255 |
+
#define _LIBCUDACXX_TRAILING_REQUIRES(...) -> __VA_ARGS__ requires _LIBCUDACXX_PP_EXPAND
|
| 256 |
+
#else
|
| 257 |
+
#define _LIBCUDACXX_TEMPLATE(...) template <__VA_ARGS__
|
| 258 |
+
#define _LIBCUDACXX_REQUIRES(...) \
|
| 259 |
+
, bool _LIBCUDACXX_true_ = true, \
|
| 260 |
+
_Concept::_Enable_if_t <__VA_ARGS__ && \
|
| 261 |
+
_LIBCUDACXX_true_, \
|
| 262 |
+
int > = 0 > /**/
|
| 263 |
+
#define _LIBCUDACXX_AND \
|
| 264 |
+
&& _LIBCUDACXX_true_, int > = 0, _Concept::_Enable_if_t <
|
| 265 |
+
#define _LIBCUDACXX_TRAILING_REQUIRES_AUX_(...) \
|
| 266 |
+
, __VA_ARGS__>
|
| 267 |
+
#define _LIBCUDACXX_TRAILING_REQUIRES(...) \
|
| 268 |
+
-> _Concept::_Requires_t<__VA_ARGS__ _LIBCUDACXX_TRAILING_REQUIRES_AUX_
|
| 269 |
+
#endif
|
| 270 |
+
|
| 271 |
+
namespace _Concept {
|
| 272 |
+
template <bool> struct _Select {};
|
| 273 |
+
|
| 274 |
+
template <> struct _Select<true> { template <class _Tp> using type = _Tp; };
|
| 275 |
+
|
| 276 |
+
template <bool _Bp, class _Tp = void>
|
| 277 |
+
using _Enable_if_t = typename _Select<_Bp>::template type<_Tp>;
|
| 278 |
+
|
| 279 |
+
template <class _Tp, bool _Bp>
|
| 280 |
+
using _Requires_t = typename _Select<_Bp>::template type<_Tp>;
|
| 281 |
+
|
| 282 |
+
template <typename...> struct _Tag;
|
| 283 |
+
template <class>
|
| 284 |
+
_LIBCUDACXX_INLINE_VISIBILITY inline constexpr bool _Is_true() {
|
| 285 |
+
return true;
|
| 286 |
+
}
|
| 287 |
+
|
| 288 |
+
#if defined(_LIBCUDACXX_COMPILER_CLANG) || defined(_LIBCUDACXX_COMPILER_MSVC)
|
| 289 |
+
template <bool _Bp>
|
| 290 |
+
_LIBCUDACXX_INLINE_VISIBILITY _Concept::_Enable_if_t<_Bp> _Requires() {}
|
| 291 |
+
#else
|
| 292 |
+
template <bool _Bp, _Concept::_Enable_if_t<_Bp, int> = 0>
|
| 293 |
+
_LIBCUDACXX_INLINE_VAR constexpr int _Requires = 0;
|
| 294 |
+
#endif
|
| 295 |
+
} // namespace _Concept
|
| 296 |
+
|
| 297 |
+
#endif // _LIBCUDACXX_STD_VER > 11
|
| 298 |
+
|
| 299 |
+
#endif //_CUDA___CONCEPTS
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/arithmetic.h
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
| 4 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 5 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 6 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
|
| 10 |
+
#ifndef _LIBCUDACXX___CONCEPTS_ARITHMETIC_H
|
| 11 |
+
#define _LIBCUDACXX___CONCEPTS_ARITHMETIC_H
|
| 12 |
+
|
| 13 |
+
#ifndef __cuda_std__
|
| 14 |
+
#include <__config>
|
| 15 |
+
#endif //__cuda_std__
|
| 16 |
+
|
| 17 |
+
#include "../__concepts/__concept_macros.h"
|
| 18 |
+
#include "../__type_traits/is_arithmetic.h"
|
| 19 |
+
#include "../__type_traits/is_floating_point.h"
|
| 20 |
+
#include "../__type_traits/is_integral.h"
|
| 21 |
+
#include "../__type_traits/is_signed_integer.h"
|
| 22 |
+
#include "../__type_traits/is_signed.h"
|
| 23 |
+
#include "../__type_traits/is_unsigned_integer.h"
|
| 24 |
+
|
| 25 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 26 |
+
# pragma GCC system_header
|
| 27 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 28 |
+
# pragma clang system_header
|
| 29 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 30 |
+
# pragma system_header
|
| 31 |
+
#endif // no system header
|
| 32 |
+
|
| 33 |
+
_LIBCUDACXX_BEGIN_NAMESPACE_STD
|
| 34 |
+
|
| 35 |
+
#if _LIBCUDACXX_STD_VER > 11
|
| 36 |
+
|
| 37 |
+
// [concepts.arithmetic], arithmetic concepts
|
| 38 |
+
|
| 39 |
+
template<class _Tp>
|
| 40 |
+
_LIBCUDACXX_CONCEPT integral = _LIBCUDACXX_TRAIT(is_integral, _Tp);
|
| 41 |
+
|
| 42 |
+
template<class _Tp>
|
| 43 |
+
_LIBCUDACXX_CONCEPT signed_integral = integral<_Tp> && _LIBCUDACXX_TRAIT(is_signed, _Tp);
|
| 44 |
+
|
| 45 |
+
template<class _Tp>
|
| 46 |
+
_LIBCUDACXX_CONCEPT unsigned_integral = integral<_Tp> && !signed_integral<_Tp>;
|
| 47 |
+
|
| 48 |
+
template<class _Tp>
|
| 49 |
+
_LIBCUDACXX_CONCEPT floating_point = _LIBCUDACXX_TRAIT(is_floating_point, _Tp);
|
| 50 |
+
|
| 51 |
+
// Concept helpers for the internal type traits for the fundamental types.
|
| 52 |
+
template <class _Tp>
|
| 53 |
+
_LIBCUDACXX_CONCEPT __libcpp_unsigned_integer = __libcpp_is_unsigned_integer<_Tp>::value;
|
| 54 |
+
template <class _Tp>
|
| 55 |
+
_LIBCUDACXX_CONCEPT __libcpp_signed_integer = __libcpp_is_signed_integer<_Tp>::value;
|
| 56 |
+
|
| 57 |
+
#endif // _LIBCUDACXX_STD_VER > 11
|
| 58 |
+
|
| 59 |
+
_LIBCUDACXX_END_NAMESPACE_STD
|
| 60 |
+
|
| 61 |
+
#endif // _LIBCUDACXX___CONCEPTS_ARITHMETIC_H
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/assignable.h
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
| 4 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 5 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 6 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
|
| 10 |
+
#ifndef _LIBCUDACXX___CONCEPTS_ASSIGNABLE_H
|
| 11 |
+
#define _LIBCUDACXX___CONCEPTS_ASSIGNABLE_H
|
| 12 |
+
|
| 13 |
+
#ifndef __cuda_std__
|
| 14 |
+
#include <__config>
|
| 15 |
+
#endif //__cuda_std__
|
| 16 |
+
|
| 17 |
+
#include "../__concepts/__concept_macros.h"
|
| 18 |
+
#include "../__concepts/common_reference_with.h"
|
| 19 |
+
#include "../__concepts/same_as.h"
|
| 20 |
+
#include "../__type_traits/is_reference.h"
|
| 21 |
+
#include "../__type_traits/make_const_lvalue_ref.h"
|
| 22 |
+
#include "../__utility/forward.h"
|
| 23 |
+
|
| 24 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 25 |
+
# pragma GCC system_header
|
| 26 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 27 |
+
# pragma clang system_header
|
| 28 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 29 |
+
# pragma system_header
|
| 30 |
+
#endif // no system header
|
| 31 |
+
|
| 32 |
+
_LIBCUDACXX_BEGIN_NAMESPACE_STD
|
| 33 |
+
|
| 34 |
+
#if _LIBCUDACXX_STD_VER > 17
|
| 35 |
+
|
| 36 |
+
// [concept.assignable]
|
| 37 |
+
|
| 38 |
+
template<class _Lhs, class _Rhs>
|
| 39 |
+
concept assignable_from =
|
| 40 |
+
is_lvalue_reference_v<_Lhs> &&
|
| 41 |
+
common_reference_with<__make_const_lvalue_ref<_Lhs>, __make_const_lvalue_ref<_Rhs>> &&
|
| 42 |
+
requires (_Lhs __lhs, _Rhs&& __rhs) {
|
| 43 |
+
{ __lhs = _CUDA_VSTD::forward<_Rhs>(__rhs) } -> same_as<_Lhs>;
|
| 44 |
+
};
|
| 45 |
+
|
| 46 |
+
#elif _LIBCUDACXX_STD_VER > 11
|
| 47 |
+
|
| 48 |
+
template<class _Lhs, class _Rhs>
|
| 49 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT(
|
| 50 |
+
__assignable_from_,
|
| 51 |
+
requires(_Lhs __lhs, _Rhs&& __rhs)(
|
| 52 |
+
requires(_LIBCUDACXX_TRAIT(is_lvalue_reference, _Lhs)),
|
| 53 |
+
requires(common_reference_with<__make_const_lvalue_ref<_Lhs>, __make_const_lvalue_ref<_Rhs>>),
|
| 54 |
+
requires(same_as<_Lhs, decltype(__lhs = _CUDA_VSTD::forward<_Rhs>(__rhs))>)
|
| 55 |
+
));
|
| 56 |
+
|
| 57 |
+
template<class _Lhs, class _Rhs>
|
| 58 |
+
_LIBCUDACXX_CONCEPT assignable_from = _LIBCUDACXX_FRAGMENT(__assignable_from_, _Lhs, _Rhs);
|
| 59 |
+
|
| 60 |
+
#endif // _LIBCUDACXX_STD_VER > 11
|
| 61 |
+
|
| 62 |
+
_LIBCUDACXX_END_NAMESPACE_STD
|
| 63 |
+
|
| 64 |
+
#endif // _LIBCUDACXX___CONCEPTS_ASSIGNABLE_H
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/boolean_testable.h
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
| 4 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 5 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 6 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
|
| 10 |
+
#ifndef _LIBCUDACXX___CONCEPTS_BOOLEAN_TESTABLE_H
|
| 11 |
+
#define _LIBCUDACXX___CONCEPTS_BOOLEAN_TESTABLE_H
|
| 12 |
+
|
| 13 |
+
#ifndef __cuda_std__
|
| 14 |
+
#include <__config>
|
| 15 |
+
#endif //__cuda_std__
|
| 16 |
+
|
| 17 |
+
#include "../__concepts/__concept_macros.h"
|
| 18 |
+
#include "../__concepts/convertible_to.h"
|
| 19 |
+
#include "../__utility/forward.h"
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
_LIBCUDACXX_BEGIN_NAMESPACE_STD
|
| 30 |
+
|
| 31 |
+
#if _LIBCUDACXX_STD_VER > 17
|
| 32 |
+
|
| 33 |
+
// [concepts.booleantestable]
|
| 34 |
+
|
| 35 |
+
template<class _Tp>
|
| 36 |
+
concept __boolean_testable_impl = convertible_to<_Tp, bool>;
|
| 37 |
+
|
| 38 |
+
template<class _Tp>
|
| 39 |
+
concept __boolean_testable = __boolean_testable_impl<_Tp> && requires(_Tp&& __t) {
|
| 40 |
+
{ !_CUDA_VSTD::forward<_Tp>(__t) } -> __boolean_testable_impl;
|
| 41 |
+
};
|
| 42 |
+
|
| 43 |
+
#elif _LIBCUDACXX_STD_VER > 11
|
| 44 |
+
|
| 45 |
+
template<class _Tp>
|
| 46 |
+
_LIBCUDACXX_CONCEPT __boolean_testable_impl = convertible_to<_Tp, bool>;
|
| 47 |
+
|
| 48 |
+
template<class _Tp>
|
| 49 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT(
|
| 50 |
+
__boolean_testable_,
|
| 51 |
+
requires(_Tp&& __t)(
|
| 52 |
+
requires(__boolean_testable_impl<_Tp>),
|
| 53 |
+
requires(__boolean_testable_impl<decltype(!_CUDA_VSTD::forward<_Tp>(__t))>)
|
| 54 |
+
));
|
| 55 |
+
|
| 56 |
+
template<class _Tp>
|
| 57 |
+
_LIBCUDACXX_CONCEPT __boolean_testable = _LIBCUDACXX_FRAGMENT(__boolean_testable_, _Tp);
|
| 58 |
+
|
| 59 |
+
#endif // _LIBCUDACXX_STD_VER > 11
|
| 60 |
+
|
| 61 |
+
_LIBCUDACXX_END_NAMESPACE_STD
|
| 62 |
+
|
| 63 |
+
#endif // _LIBCUDACXX___CONCEPTS_BOOLEAN_TESTABLE_H
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/class_or_enum.h
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
| 4 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 5 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 6 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
|
| 10 |
+
#ifndef _LIBCUDACXX___CONCEPTS_CLASS_OR_ENUM_H
|
| 11 |
+
#define _LIBCUDACXX___CONCEPTS_CLASS_OR_ENUM_H
|
| 12 |
+
|
| 13 |
+
#ifndef __cuda_std__
|
| 14 |
+
#include <__config>
|
| 15 |
+
#endif //__cuda_std__
|
| 16 |
+
|
| 17 |
+
#include "../__concepts/__concept_macros.h"
|
| 18 |
+
#include "../__type_traits/is_class.h"
|
| 19 |
+
#include "../__type_traits/is_enum.h"
|
| 20 |
+
#include "../__type_traits/is_union.h"
|
| 21 |
+
#include "../__type_traits/remove_cvref.h"
|
| 22 |
+
|
| 23 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 24 |
+
# pragma GCC system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 26 |
+
# pragma clang system_header
|
| 27 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 28 |
+
# pragma system_header
|
| 29 |
+
#endif // no system header
|
| 30 |
+
|
| 31 |
+
_LIBCUDACXX_BEGIN_NAMESPACE_STD
|
| 32 |
+
|
| 33 |
+
#if _LIBCUDACXX_STD_VER > 11
|
| 34 |
+
|
| 35 |
+
template<class _Tp>
|
| 36 |
+
_LIBCUDACXX_CONCEPT __class_or_enum = _LIBCUDACXX_TRAIT(is_class, _Tp) || _LIBCUDACXX_TRAIT(is_union, _Tp) || _LIBCUDACXX_TRAIT(is_enum, _Tp);
|
| 37 |
+
|
| 38 |
+
// Work around Clang bug https://llvm.org/PR52970
|
| 39 |
+
// TODO: remove this workaround once libc++ no longer has to support Clang 13 (it was fixed in Clang 14).
|
| 40 |
+
template<class _Tp>
|
| 41 |
+
_LIBCUDACXX_CONCEPT __workaround_52970 = _LIBCUDACXX_TRAIT(is_class, remove_cvref_t<_Tp>) || _LIBCUDACXX_TRAIT(is_union, remove_cvref_t<_Tp>);
|
| 42 |
+
|
| 43 |
+
#endif // _LIBCUDACXX_STD_VER > 11
|
| 44 |
+
|
| 45 |
+
_LIBCUDACXX_END_NAMESPACE_STD
|
| 46 |
+
|
| 47 |
+
#endif // _LIBCUDACXX___CONCEPTS_CLASS_OR_ENUM_H
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/common_reference_with.h
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
| 4 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 5 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 6 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
|
| 10 |
+
#ifndef _LIBCUDACXX___CONCEPTS_COMMON_REFERENCE_WITH_H
|
| 11 |
+
#define _LIBCUDACXX___CONCEPTS_COMMON_REFERENCE_WITH_H
|
| 12 |
+
|
| 13 |
+
#ifndef __cuda_std__
|
| 14 |
+
#include <__config>
|
| 15 |
+
#endif //__cuda_std__
|
| 16 |
+
|
| 17 |
+
#include "../__concepts/__concept_macros.h"
|
| 18 |
+
#include "../__concepts/convertible_to.h"
|
| 19 |
+
#include "../__concepts/same_as.h"
|
| 20 |
+
#include "../__type_traits/common_reference.h"
|
| 21 |
+
#include "../__type_traits/copy_cv.h"
|
| 22 |
+
#include "../__type_traits/copy_cvref.h"
|
| 23 |
+
|
| 24 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 25 |
+
# pragma GCC system_header
|
| 26 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 27 |
+
# pragma clang system_header
|
| 28 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 29 |
+
# pragma system_header
|
| 30 |
+
#endif // no system header
|
| 31 |
+
|
| 32 |
+
_LIBCUDACXX_BEGIN_NAMESPACE_STD
|
| 33 |
+
|
| 34 |
+
#if _LIBCUDACXX_STD_VER > 17
|
| 35 |
+
|
| 36 |
+
// [concept.commonref]
|
| 37 |
+
|
| 38 |
+
template<class _Tp, class _Up>
|
| 39 |
+
concept common_reference_with =
|
| 40 |
+
same_as<common_reference_t<_Tp, _Up>, common_reference_t<_Up, _Tp>> &&
|
| 41 |
+
convertible_to<_Tp, common_reference_t<_Tp, _Up>> &&
|
| 42 |
+
convertible_to<_Up, common_reference_t<_Tp, _Up>>;
|
| 43 |
+
|
| 44 |
+
#elif _LIBCUDACXX_STD_VER > 11
|
| 45 |
+
|
| 46 |
+
template<class _Tp, class _Up>
|
| 47 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT(
|
| 48 |
+
__common_reference_exists_,
|
| 49 |
+
requires()(
|
| 50 |
+
typename(common_reference_t<_Tp, _Up>),
|
| 51 |
+
typename(common_reference_t<_Up, _Tp>)
|
| 52 |
+
));
|
| 53 |
+
|
| 54 |
+
template<class _Tp, class _Up>
|
| 55 |
+
_LIBCUDACXX_CONCEPT _Common_reference_exists = _LIBCUDACXX_FRAGMENT(__common_reference_exists_, _Tp, _Up);
|
| 56 |
+
|
| 57 |
+
template<class _Tp, class _Up>
|
| 58 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT(
|
| 59 |
+
__common_reference_with_,
|
| 60 |
+
requires()(
|
| 61 |
+
requires(_Common_reference_exists<_Tp, _Up>),
|
| 62 |
+
requires(same_as<common_reference_t<_Tp, _Up>, common_reference_t<_Up, _Tp>>),
|
| 63 |
+
requires(convertible_to<_Tp, common_reference_t<_Tp, _Up>>),
|
| 64 |
+
requires(convertible_to<_Up, common_reference_t<_Tp, _Up>>)
|
| 65 |
+
));
|
| 66 |
+
|
| 67 |
+
template<class _Tp, class _Up>
|
| 68 |
+
_LIBCUDACXX_CONCEPT common_reference_with = _LIBCUDACXX_FRAGMENT(__common_reference_with_, _Tp, _Up);
|
| 69 |
+
|
| 70 |
+
#endif // _LIBCUDACXX_STD_VER > 11
|
| 71 |
+
|
| 72 |
+
_LIBCUDACXX_END_NAMESPACE_STD
|
| 73 |
+
|
| 74 |
+
#endif // _LIBCUDACXX___CONCEPTS_COMMON_REFERENCE_WITH_H
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/common_with.h
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
| 4 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 5 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 6 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
|
| 10 |
+
#ifndef _LIBCUDACXX___CONCEPTS_COMMON_WITH_H
|
| 11 |
+
#define _LIBCUDACXX___CONCEPTS_COMMON_WITH_H
|
| 12 |
+
|
| 13 |
+
#ifndef __cuda_std__
|
| 14 |
+
#include <__config>
|
| 15 |
+
#endif //__cuda_std__
|
| 16 |
+
|
| 17 |
+
#include "../__concepts/__concept_macros.h"
|
| 18 |
+
#include "../__concepts/common_reference_with.h"
|
| 19 |
+
#include "../__concepts/same_as.h"
|
| 20 |
+
#include "../__type_traits/add_lvalue_reference.h"
|
| 21 |
+
#include "../__type_traits/common_type.h"
|
| 22 |
+
#include "../__utility/declval.h"
|
| 23 |
+
|
| 24 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 25 |
+
# pragma GCC system_header
|
| 26 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 27 |
+
# pragma clang system_header
|
| 28 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 29 |
+
# pragma system_header
|
| 30 |
+
#endif // no system header
|
| 31 |
+
|
| 32 |
+
_LIBCUDACXX_BEGIN_NAMESPACE_STD
|
| 33 |
+
|
| 34 |
+
#if _LIBCUDACXX_STD_VER > 17
|
| 35 |
+
|
| 36 |
+
// [concept.common]
|
| 37 |
+
|
| 38 |
+
template<class _Tp, class _Up>
|
| 39 |
+
concept common_with =
|
| 40 |
+
same_as<common_type_t<_Tp, _Up>, common_type_t<_Up, _Tp>> &&
|
| 41 |
+
requires {
|
| 42 |
+
static_cast<common_type_t<_Tp, _Up>>(_CUDA_VSTD::declval<_Tp>());
|
| 43 |
+
static_cast<common_type_t<_Tp, _Up>>(_CUDA_VSTD::declval<_Up>());
|
| 44 |
+
} &&
|
| 45 |
+
common_reference_with<
|
| 46 |
+
add_lvalue_reference_t<const _Tp>,
|
| 47 |
+
add_lvalue_reference_t<const _Up>> &&
|
| 48 |
+
common_reference_with<
|
| 49 |
+
add_lvalue_reference_t<common_type_t<_Tp, _Up>>,
|
| 50 |
+
common_reference_t<
|
| 51 |
+
add_lvalue_reference_t<const _Tp>,
|
| 52 |
+
add_lvalue_reference_t<const _Up>>>;
|
| 53 |
+
|
| 54 |
+
#elif _LIBCUDACXX_STD_VER > 11
|
| 55 |
+
|
| 56 |
+
template<class _Tp, class _Up>
|
| 57 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT(
|
| 58 |
+
__common_type_exists_,
|
| 59 |
+
requires()(
|
| 60 |
+
typename(common_type_t<_Tp, _Up>),
|
| 61 |
+
typename(common_type_t<_Up, _Tp>)
|
| 62 |
+
));
|
| 63 |
+
|
| 64 |
+
template<class _Tp, class _Up>
|
| 65 |
+
_LIBCUDACXX_CONCEPT _Common_type_exists = _LIBCUDACXX_FRAGMENT(__common_type_exists_, _Tp, _Up);
|
| 66 |
+
|
| 67 |
+
template<class _Tp, class _Up>
|
| 68 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT(
|
| 69 |
+
__common_type_constructible_,
|
| 70 |
+
requires()(
|
| 71 |
+
requires(_Common_type_exists<_Tp, _Up>),
|
| 72 |
+
static_cast<common_type_t<_Tp, _Up>>(_CUDA_VSTD::declval<_Tp>()),
|
| 73 |
+
static_cast<common_type_t<_Tp, _Up>>(_CUDA_VSTD::declval<_Up>())
|
| 74 |
+
));
|
| 75 |
+
|
| 76 |
+
template<class _Tp, class _Up>
|
| 77 |
+
_LIBCUDACXX_CONCEPT _Common_type_constructible = _LIBCUDACXX_FRAGMENT(__common_type_constructible_, _Tp, _Up);
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+
template<class _Tp, class _Up>
|
| 81 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT(
|
| 82 |
+
__common_with_,
|
| 83 |
+
requires()(
|
| 84 |
+
requires(_Common_type_constructible<_Tp, _Up>),
|
| 85 |
+
requires(same_as<common_type_t<_Tp, _Up>, common_type_t<_Up, _Tp>>),
|
| 86 |
+
requires(common_reference_with<
|
| 87 |
+
add_lvalue_reference_t<const _Tp>,
|
| 88 |
+
add_lvalue_reference_t<const _Up>>),
|
| 89 |
+
requires(common_reference_with<
|
| 90 |
+
add_lvalue_reference_t<common_type_t<_Tp, _Up>>,
|
| 91 |
+
common_reference_t<
|
| 92 |
+
add_lvalue_reference_t<const _Tp>,
|
| 93 |
+
add_lvalue_reference_t<const _Up>>>)));
|
| 94 |
+
|
| 95 |
+
template<class _Tp, class _Up>
|
| 96 |
+
_LIBCUDACXX_CONCEPT common_with = _LIBCUDACXX_FRAGMENT(__common_with_, _Tp, _Up);
|
| 97 |
+
|
| 98 |
+
#endif // _LIBCUDACXX_STD_VER > 11
|
| 99 |
+
|
| 100 |
+
_LIBCUDACXX_END_NAMESPACE_STD
|
| 101 |
+
|
| 102 |
+
#endif // _LIBCUDACXX___CONCEPTS_COMMON_WITH_H
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/constructible.h
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
| 4 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 5 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 6 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
|
| 10 |
+
#ifndef _LIBCUDACXX___CONCEPTS_CONSTRUCTIBLE_H
|
| 11 |
+
#define _LIBCUDACXX___CONCEPTS_CONSTRUCTIBLE_H
|
| 12 |
+
|
| 13 |
+
#ifndef __cuda_std__
|
| 14 |
+
#include <__config>
|
| 15 |
+
#endif //__cuda_std__
|
| 16 |
+
|
| 17 |
+
#include "../__concepts/__concept_macros.h"
|
| 18 |
+
#include "../__concepts/convertible_to.h"
|
| 19 |
+
#include "../__concepts/destructible.h"
|
| 20 |
+
#include "../__type_traits/add_lvalue_reference.h"
|
| 21 |
+
#include "../__type_traits/is_constructible.h"
|
| 22 |
+
|
| 23 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 24 |
+
# pragma GCC system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 26 |
+
# pragma clang system_header
|
| 27 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 28 |
+
# pragma system_header
|
| 29 |
+
#endif // no system header
|
| 30 |
+
|
| 31 |
+
_LIBCUDACXX_BEGIN_NAMESPACE_STD
|
| 32 |
+
|
| 33 |
+
#if _LIBCUDACXX_STD_VER > 17
|
| 34 |
+
|
| 35 |
+
// [concept.constructible]
|
| 36 |
+
template<class _Tp, class... _Args>
|
| 37 |
+
concept constructible_from =
|
| 38 |
+
destructible<_Tp> && is_constructible_v<_Tp, _Args...>;
|
| 39 |
+
|
| 40 |
+
// [concept.default.init]
|
| 41 |
+
template<class _Tp>
|
| 42 |
+
concept __default_initializable = requires { ::new _Tp; };
|
| 43 |
+
|
| 44 |
+
template<class _Tp>
|
| 45 |
+
concept default_initializable = constructible_from<_Tp> &&
|
| 46 |
+
requires { _Tp{}; } && __default_initializable<_Tp>;
|
| 47 |
+
|
| 48 |
+
// [concept.moveconstructible]
|
| 49 |
+
template<class _Tp>
|
| 50 |
+
concept move_constructible =
|
| 51 |
+
constructible_from<_Tp, _Tp> && convertible_to<_Tp, _Tp>;
|
| 52 |
+
|
| 53 |
+
// [concept.copyconstructible]
|
| 54 |
+
template<class _Tp>
|
| 55 |
+
concept copy_constructible =
|
| 56 |
+
move_constructible<_Tp> &&
|
| 57 |
+
constructible_from<_Tp, _Tp&> && convertible_to<_Tp&, _Tp> &&
|
| 58 |
+
constructible_from<_Tp, const _Tp&> && convertible_to<const _Tp&, _Tp> &&
|
| 59 |
+
constructible_from<_Tp, const _Tp> && convertible_to<const _Tp, _Tp>;
|
| 60 |
+
|
| 61 |
+
#elif _LIBCUDACXX_STD_VER > 11
|
| 62 |
+
|
| 63 |
+
template<class _Tp, class... _Args>
|
| 64 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT(
|
| 65 |
+
__constructible_from_,
|
| 66 |
+
requires()(
|
| 67 |
+
requires(destructible<_Tp>),
|
| 68 |
+
requires(_LIBCUDACXX_TRAIT(is_constructible, _Tp, _Args...))
|
| 69 |
+
));
|
| 70 |
+
|
| 71 |
+
template<class _Tp, class... _Args>
|
| 72 |
+
_LIBCUDACXX_CONCEPT constructible_from = _LIBCUDACXX_FRAGMENT(__constructible_from_, _Tp, _Args...);
|
| 73 |
+
|
| 74 |
+
template<class _Tp>
|
| 75 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT(
|
| 76 |
+
__default_initializable_,
|
| 77 |
+
requires()(
|
| 78 |
+
(::new _Tp)
|
| 79 |
+
));
|
| 80 |
+
|
| 81 |
+
template<class _Tp>
|
| 82 |
+
_LIBCUDACXX_CONCEPT __default_initializable = _LIBCUDACXX_FRAGMENT(__default_initializable_, _Tp);
|
| 83 |
+
|
| 84 |
+
template<class _Tp>
|
| 85 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT(
|
| 86 |
+
_Default_initializable_,
|
| 87 |
+
requires(_Tp = _Tp{}) (
|
| 88 |
+
requires(constructible_from<_Tp>),
|
| 89 |
+
requires(__default_initializable<_Tp>)
|
| 90 |
+
));
|
| 91 |
+
|
| 92 |
+
template<class _Tp>
|
| 93 |
+
_LIBCUDACXX_CONCEPT default_initializable = _LIBCUDACXX_FRAGMENT(_Default_initializable_, _Tp);
|
| 94 |
+
|
| 95 |
+
// [concept.moveconstructible]
|
| 96 |
+
template<class _Tp>
|
| 97 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT(
|
| 98 |
+
__move_constructible_,
|
| 99 |
+
requires()(
|
| 100 |
+
requires(constructible_from<_Tp, _Tp>),
|
| 101 |
+
requires(convertible_to<_Tp, _Tp>)
|
| 102 |
+
));
|
| 103 |
+
|
| 104 |
+
template<class _Tp>
|
| 105 |
+
_LIBCUDACXX_CONCEPT move_constructible = _LIBCUDACXX_FRAGMENT(__move_constructible_, _Tp);
|
| 106 |
+
|
| 107 |
+
// [concept.copyconstructible]
|
| 108 |
+
template<class _Tp>
|
| 109 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT(
|
| 110 |
+
__copy_constructible_,
|
| 111 |
+
requires()(
|
| 112 |
+
requires(move_constructible<_Tp>),
|
| 113 |
+
requires(constructible_from<_Tp, add_lvalue_reference_t<_Tp>> && convertible_to<add_lvalue_reference_t<_Tp>, _Tp>),
|
| 114 |
+
requires(constructible_from<_Tp, const add_lvalue_reference_t<_Tp>> && convertible_to<const add_lvalue_reference_t<_Tp>, _Tp>),
|
| 115 |
+
requires(constructible_from<_Tp, const _Tp> && convertible_to<const _Tp, _Tp>)
|
| 116 |
+
));
|
| 117 |
+
|
| 118 |
+
template<class _Tp>
|
| 119 |
+
_LIBCUDACXX_CONCEPT copy_constructible = _LIBCUDACXX_FRAGMENT(__copy_constructible_, _Tp);
|
| 120 |
+
|
| 121 |
+
#endif // _LIBCUDACXX_STD_VER > 11
|
| 122 |
+
|
| 123 |
+
_LIBCUDACXX_END_NAMESPACE_STD
|
| 124 |
+
|
| 125 |
+
#endif // _LIBCUDACXX___CONCEPTS_CONSTRUCTIBLE_H
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/convertible_to.h
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
| 4 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 5 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 6 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
|
| 10 |
+
#ifndef _LIBCUDACXX___CONCEPTS_CONVERTIBLE_TO_H
|
| 11 |
+
#define _LIBCUDACXX___CONCEPTS_CONVERTIBLE_TO_H
|
| 12 |
+
|
| 13 |
+
#ifndef __cuda_std__
|
| 14 |
+
#include <__config>
|
| 15 |
+
#endif //__cuda_std__
|
| 16 |
+
|
| 17 |
+
#include "../__concepts/__concept_macros.h"
|
| 18 |
+
#include "../__type_traits/is_convertible.h"
|
| 19 |
+
#include "../__utility/declval.h"
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
_LIBCUDACXX_BEGIN_NAMESPACE_STD
|
| 30 |
+
|
| 31 |
+
#if _LIBCUDACXX_STD_VER > 17
|
| 32 |
+
|
| 33 |
+
// [concept.convertible]
|
| 34 |
+
|
| 35 |
+
template<class _From, class _To>
|
| 36 |
+
concept convertible_to =
|
| 37 |
+
is_convertible_v<_From, _To> &&
|
| 38 |
+
requires {
|
| 39 |
+
static_cast<_To>(_CUDA_VSTD::declval<_From>());
|
| 40 |
+
};
|
| 41 |
+
|
| 42 |
+
#elif _LIBCUDACXX_STD_VER > 11
|
| 43 |
+
|
| 44 |
+
#if defined(_LIBCUDACXX_COMPILER_MSVC)
|
| 45 |
+
_LIBCUDACXX_NV_DIAG_SUPPRESS(1211) // nonstandard cast to array type ignored
|
| 46 |
+
#endif // _LIBCUDACXX_COMPILER_MSVC
|
| 47 |
+
|
| 48 |
+
// We cannot put this conversion check with the other constraint, as types with deleted operator will break here
|
| 49 |
+
template<class _From, class _To>
|
| 50 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT(
|
| 51 |
+
__test_conversion_,
|
| 52 |
+
requires()(
|
| 53 |
+
static_cast<_To>(_CUDA_VSTD::declval<_From>())
|
| 54 |
+
));
|
| 55 |
+
|
| 56 |
+
template<class _From, class _To>
|
| 57 |
+
_LIBCUDACXX_CONCEPT __test_conversion = _LIBCUDACXX_FRAGMENT(__test_conversion_, _From, _To);
|
| 58 |
+
|
| 59 |
+
template<class _From, class _To>
|
| 60 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT(
|
| 61 |
+
__convertible_to_,
|
| 62 |
+
requires()(
|
| 63 |
+
requires(_LIBCUDACXX_TRAIT(is_convertible, _From, _To)),
|
| 64 |
+
requires(__test_conversion<_From, _To>)
|
| 65 |
+
));
|
| 66 |
+
|
| 67 |
+
template<class _From, class _To>
|
| 68 |
+
_LIBCUDACXX_CONCEPT convertible_to = _LIBCUDACXX_FRAGMENT(__convertible_to_, _From, _To);
|
| 69 |
+
|
| 70 |
+
#if defined(_LIBCUDACXX_COMPILER_MSVC)
|
| 71 |
+
_LIBCUDACXX_NV_DIAG_DEFAULT(1211) // nonstandard cast to array type ignored
|
| 72 |
+
#endif // _LIBCUDACXX_COMPILER_MSVC
|
| 73 |
+
|
| 74 |
+
#endif // _LIBCUDACXX_STD_VER > 11
|
| 75 |
+
|
| 76 |
+
_LIBCUDACXX_END_NAMESPACE_STD
|
| 77 |
+
|
| 78 |
+
#endif // _LIBCUDACXX___CONCEPTS_CONVERTIBLE_TO_H
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/copyable.h
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
| 4 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 5 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 6 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
|
| 10 |
+
#ifndef _LIBCUDACXX___CONCEPTS_COPYABLE_H
|
| 11 |
+
#define _LIBCUDACXX___CONCEPTS_COPYABLE_H
|
| 12 |
+
|
| 13 |
+
#ifndef __cuda_std__
|
| 14 |
+
#include <__config>
|
| 15 |
+
#endif //__cuda_std__
|
| 16 |
+
|
| 17 |
+
#include "../__concepts/__concept_macros.h"
|
| 18 |
+
#include "../__concepts/assignable.h"
|
| 19 |
+
#include "../__concepts/constructible.h"
|
| 20 |
+
#include "../__concepts/movable.h"
|
| 21 |
+
|
| 22 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 23 |
+
# pragma GCC system_header
|
| 24 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 25 |
+
# pragma clang system_header
|
| 26 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 27 |
+
# pragma system_header
|
| 28 |
+
#endif // no system header
|
| 29 |
+
|
| 30 |
+
_LIBCUDACXX_BEGIN_NAMESPACE_STD
|
| 31 |
+
|
| 32 |
+
#if _LIBCUDACXX_STD_VER > 17
|
| 33 |
+
|
| 34 |
+
// [concepts.object]
|
| 35 |
+
|
| 36 |
+
template<class _Tp>
|
| 37 |
+
concept copyable =
|
| 38 |
+
copy_constructible<_Tp> &&
|
| 39 |
+
movable<_Tp> &&
|
| 40 |
+
assignable_from<_Tp&, _Tp&> &&
|
| 41 |
+
assignable_from<_Tp&, const _Tp&> &&
|
| 42 |
+
assignable_from<_Tp&, const _Tp>;
|
| 43 |
+
|
| 44 |
+
#elif _LIBCUDACXX_STD_VER > 11
|
| 45 |
+
|
| 46 |
+
template<class _Tp>
|
| 47 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT(
|
| 48 |
+
__copyable_,
|
| 49 |
+
requires()(
|
| 50 |
+
requires(copy_constructible<_Tp>),
|
| 51 |
+
requires(movable<_Tp>),
|
| 52 |
+
requires(assignable_from<_Tp&, _Tp&>),
|
| 53 |
+
requires(assignable_from<_Tp&, const _Tp&>),
|
| 54 |
+
requires(assignable_from<_Tp&, const _Tp>)
|
| 55 |
+
));
|
| 56 |
+
|
| 57 |
+
template<class _Tp>
|
| 58 |
+
_LIBCUDACXX_CONCEPT copyable = _LIBCUDACXX_FRAGMENT(__copyable_,_Tp);
|
| 59 |
+
|
| 60 |
+
#endif // _LIBCUDACXX_STD_VER > 11
|
| 61 |
+
|
| 62 |
+
_LIBCUDACXX_END_NAMESPACE_STD
|
| 63 |
+
|
| 64 |
+
#endif // _LIBCUDACXX___CONCEPTS_COPYABLE_H
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/derived_from.h
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
| 4 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 5 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 6 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
|
| 10 |
+
#ifndef _LIBCUDACXX___CONCEPTS_DERIVED_FROM_H
|
| 11 |
+
#define _LIBCUDACXX___CONCEPTS_DERIVED_FROM_H
|
| 12 |
+
|
| 13 |
+
#ifndef __cuda_std__
|
| 14 |
+
#include <__config>
|
| 15 |
+
#endif //__cuda_std__
|
| 16 |
+
|
| 17 |
+
#include "../__concepts/__concept_macros.h"
|
| 18 |
+
#include "../__type_traits/add_pointer.h"
|
| 19 |
+
#include "../__type_traits/is_base_of.h"
|
| 20 |
+
#include "../__type_traits/is_convertible.h"
|
| 21 |
+
|
| 22 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 23 |
+
# pragma GCC system_header
|
| 24 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 25 |
+
# pragma clang system_header
|
| 26 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 27 |
+
# pragma system_header
|
| 28 |
+
#endif // no system header
|
| 29 |
+
|
| 30 |
+
_LIBCUDACXX_BEGIN_NAMESPACE_STD
|
| 31 |
+
|
| 32 |
+
#if _LIBCUDACXX_STD_VER > 17
|
| 33 |
+
|
| 34 |
+
// [concept.derived]
|
| 35 |
+
|
| 36 |
+
template<class _Dp, class _Bp>
|
| 37 |
+
concept derived_from =
|
| 38 |
+
is_base_of_v<_Bp, _Dp> &&
|
| 39 |
+
is_convertible_v<const volatile _Dp*, const volatile _Bp*>;
|
| 40 |
+
|
| 41 |
+
#elif _LIBCUDACXX_STD_VER > 11
|
| 42 |
+
|
| 43 |
+
template<class _Dp, class _Bp>
|
| 44 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT(
|
| 45 |
+
__derived_from_,
|
| 46 |
+
requires()(
|
| 47 |
+
requires(_LIBCUDACXX_TRAIT(is_base_of, _Bp, _Dp)),
|
| 48 |
+
requires(_LIBCUDACXX_TRAIT(is_convertible, add_pointer_t<const volatile _Dp>, add_pointer_t<const volatile _Bp>))
|
| 49 |
+
));
|
| 50 |
+
|
| 51 |
+
template<class _Dp, class _Bp>
|
| 52 |
+
_LIBCUDACXX_CONCEPT derived_from = _LIBCUDACXX_FRAGMENT(__derived_from_, _Dp, _Bp);
|
| 53 |
+
|
| 54 |
+
#endif // _LIBCUDACXX_STD_VER > 11
|
| 55 |
+
|
| 56 |
+
_LIBCUDACXX_END_NAMESPACE_STD
|
| 57 |
+
|
| 58 |
+
#endif // _LIBCUDACXX___CONCEPTS_DERIVED_FROM_H
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/destructible.h
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
| 4 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 5 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 6 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
|
| 10 |
+
#ifndef _LIBCUDACXX___CONCEPTS_DESTRUCTIBLE_H
|
| 11 |
+
#define _LIBCUDACXX___CONCEPTS_DESTRUCTIBLE_H
|
| 12 |
+
|
| 13 |
+
#ifndef __cuda_std__
|
| 14 |
+
#include <__config>
|
| 15 |
+
#endif //__cuda_std__
|
| 16 |
+
|
| 17 |
+
#include "../__concepts/__concept_macros.h"
|
| 18 |
+
#include "../__type_traits/enable_if.h"
|
| 19 |
+
#include "../__type_traits/is_destructible.h"
|
| 20 |
+
#include "../__type_traits/is_object.h"
|
| 21 |
+
#include "../__type_traits/is_nothrow_destructible.h"
|
| 22 |
+
#include "../__type_traits/void_t.h"
|
| 23 |
+
#include "../__utility/declval.h"
|
| 24 |
+
|
| 25 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 26 |
+
# pragma GCC system_header
|
| 27 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 28 |
+
# pragma clang system_header
|
| 29 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 30 |
+
# pragma system_header
|
| 31 |
+
#endif // no system header
|
| 32 |
+
|
| 33 |
+
_LIBCUDACXX_BEGIN_NAMESPACE_STD
|
| 34 |
+
|
| 35 |
+
#if _LIBCUDACXX_STD_VER > 11
|
| 36 |
+
|
| 37 |
+
#if defined(_LIBCUDACXX_COMPILER_MSVC)
|
| 38 |
+
|
| 39 |
+
template<class _Tp>
|
| 40 |
+
_LIBCUDACXX_CONCEPT destructible = __is_nothrow_destructible(_Tp);
|
| 41 |
+
|
| 42 |
+
#else // ^^^ _LIBCUDACXX_COMPILER_MSVC ^^^ / vvv !_LIBCUDACXX_COMPILER_MSVC vvv
|
| 43 |
+
|
| 44 |
+
template<class _Tp, class = void, class = void>
|
| 45 |
+
_LIBCUDACXX_INLINE_VAR constexpr bool __destructible_impl = false;
|
| 46 |
+
|
| 47 |
+
template<class _Tp>
|
| 48 |
+
_LIBCUDACXX_INLINE_VAR constexpr bool __destructible_impl<_Tp,
|
| 49 |
+
__enable_if_t<_LIBCUDACXX_TRAIT(is_object, _Tp)>,
|
| 50 |
+
#if defined(_LIBCUDACXX_COMPILER_GCC)
|
| 51 |
+
__enable_if_t<_LIBCUDACXX_TRAIT(is_destructible, _Tp)>>
|
| 52 |
+
#else // ^^^ defined(_LIBCUDACXX_COMPILER_GCC) ^^^ / vvv !_LIBCUDACXX_COMPILER_GCC vvv
|
| 53 |
+
__void_t<decltype(_CUDA_VSTD::declval<_Tp>().~_Tp())>>
|
| 54 |
+
#endif // !_LIBCUDACXX_COMPILER_GCC
|
| 55 |
+
= noexcept(_CUDA_VSTD::declval<_Tp>().~_Tp());
|
| 56 |
+
|
| 57 |
+
template<class _Tp>
|
| 58 |
+
_LIBCUDACXX_INLINE_VAR constexpr bool __destructible = __destructible_impl<_Tp>;
|
| 59 |
+
|
| 60 |
+
template<class _Tp>
|
| 61 |
+
_LIBCUDACXX_INLINE_VAR constexpr bool __destructible<_Tp&> = true;
|
| 62 |
+
|
| 63 |
+
template<class _Tp>
|
| 64 |
+
_LIBCUDACXX_INLINE_VAR constexpr bool __destructible<_Tp&&> = true;
|
| 65 |
+
|
| 66 |
+
template<class _Tp, size_t _Nm>
|
| 67 |
+
_LIBCUDACXX_INLINE_VAR constexpr bool __destructible<_Tp[_Nm]> = __destructible<_Tp>;
|
| 68 |
+
|
| 69 |
+
template<class _Tp>
|
| 70 |
+
_LIBCUDACXX_CONCEPT destructible = __destructible<_Tp>;
|
| 71 |
+
|
| 72 |
+
#endif // !_LIBCUDACXX_COMPILER_MSVC
|
| 73 |
+
|
| 74 |
+
#endif // _LIBCUDACXX_STD_VER > 11
|
| 75 |
+
|
| 76 |
+
_LIBCUDACXX_END_NAMESPACE_STD
|
| 77 |
+
|
| 78 |
+
#endif // _LIBCUDACXX___CONCEPTS_DESTRUCTIBLE_H
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/different_from.h
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
| 4 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 5 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 6 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
|
| 10 |
+
#ifndef _LIBCUDACXX___CONCEPTS_DIFFERENT_FROM_H
|
| 11 |
+
#define _LIBCUDACXX___CONCEPTS_DIFFERENT_FROM_H
|
| 12 |
+
|
| 13 |
+
#ifndef __cuda_std__
|
| 14 |
+
#include <__config>
|
| 15 |
+
#endif //__cuda_std__
|
| 16 |
+
|
| 17 |
+
#include "../__concepts/__concept_macros.h"
|
| 18 |
+
#include "../__concepts/same_as.h"
|
| 19 |
+
#include "../__type_traits/remove_cvref.h"
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
_LIBCUDACXX_BEGIN_NAMESPACE_STD
|
| 30 |
+
|
| 31 |
+
#if _LIBCUDACXX_STD_VER > 11
|
| 32 |
+
|
| 33 |
+
template<class _Tp, class _Up>
|
| 34 |
+
_LIBCUDACXX_CONCEPT __different_from = !same_as<remove_cvref_t<_Tp>, remove_cvref_t<_Up>>;
|
| 35 |
+
|
| 36 |
+
#endif // _LIBCUDACXX_STD_VER > 11
|
| 37 |
+
|
| 38 |
+
_LIBCUDACXX_END_NAMESPACE_STD
|
| 39 |
+
|
| 40 |
+
#endif // _LIBCUDACXX___CONCEPTS_DIFFERENT_FROM_H
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/equality_comparable.h
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
| 4 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 5 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 6 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
|
| 10 |
+
#ifndef _LIBCUDACXX___CONCEPTS_EQUALITY_COMPARABLE_H
|
| 11 |
+
#define _LIBCUDACXX___CONCEPTS_EQUALITY_COMPARABLE_H
|
| 12 |
+
|
| 13 |
+
#ifndef __cuda_std__
|
| 14 |
+
#include <__config>
|
| 15 |
+
#endif //__cuda_std__
|
| 16 |
+
|
| 17 |
+
#include "../__concepts/__concept_macros.h"
|
| 18 |
+
#include "../__concepts/boolean_testable.h"
|
| 19 |
+
#include "../__concepts/common_reference_with.h"
|
| 20 |
+
#include "../__type_traits/common_reference.h"
|
| 21 |
+
#include "../__type_traits/make_const_lvalue_ref.h"
|
| 22 |
+
|
| 23 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 24 |
+
# pragma GCC system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 26 |
+
# pragma clang system_header
|
| 27 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 28 |
+
# pragma system_header
|
| 29 |
+
#endif // no system header
|
| 30 |
+
|
| 31 |
+
_LIBCUDACXX_BEGIN_NAMESPACE_STD
|
| 32 |
+
|
| 33 |
+
#if _LIBCUDACXX_STD_VER > 17
|
| 34 |
+
|
| 35 |
+
// [concept.equalitycomparable]
|
| 36 |
+
|
| 37 |
+
template<class _Tp, class _Up>
|
| 38 |
+
concept __weakly_equality_comparable_with =
|
| 39 |
+
requires(__make_const_lvalue_ref<_Tp> __t, __make_const_lvalue_ref<_Up> __u) {
|
| 40 |
+
{ __t == __u } -> __boolean_testable;
|
| 41 |
+
{ __t != __u } -> __boolean_testable;
|
| 42 |
+
{ __u == __t } -> __boolean_testable;
|
| 43 |
+
{ __u != __t } -> __boolean_testable;
|
| 44 |
+
};
|
| 45 |
+
|
| 46 |
+
template<class _Tp>
|
| 47 |
+
concept equality_comparable = __weakly_equality_comparable_with<_Tp, _Tp>;
|
| 48 |
+
|
| 49 |
+
template<class _Tp, class _Up>
|
| 50 |
+
concept equality_comparable_with =
|
| 51 |
+
equality_comparable<_Tp> && equality_comparable<_Up> &&
|
| 52 |
+
common_reference_with<__make_const_lvalue_ref<_Tp>, __make_const_lvalue_ref<_Up>> &&
|
| 53 |
+
equality_comparable<
|
| 54 |
+
common_reference_t<
|
| 55 |
+
__make_const_lvalue_ref<_Tp>,
|
| 56 |
+
__make_const_lvalue_ref<_Up>>> &&
|
| 57 |
+
__weakly_equality_comparable_with<_Tp, _Up>;
|
| 58 |
+
|
| 59 |
+
#elif _LIBCUDACXX_STD_VER > 11
|
| 60 |
+
|
| 61 |
+
template<class _Tp>
|
| 62 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT(
|
| 63 |
+
__with_lvalue_reference_,
|
| 64 |
+
requires()(
|
| 65 |
+
typename(__make_const_lvalue_ref<_Tp>)
|
| 66 |
+
));
|
| 67 |
+
|
| 68 |
+
template<class _Tp>
|
| 69 |
+
_LIBCUDACXX_CONCEPT _With_lvalue_reference = _LIBCUDACXX_FRAGMENT(__with_lvalue_reference_, _Tp);
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
template<class _Tp, class _Up>
|
| 73 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT(
|
| 74 |
+
__weakly_equality_comparable_with_,
|
| 75 |
+
requires(__make_const_lvalue_ref<_Tp> __t, __make_const_lvalue_ref<_Up> __u)(
|
| 76 |
+
requires(_With_lvalue_reference<_Tp>),
|
| 77 |
+
requires(_With_lvalue_reference<_Up>),
|
| 78 |
+
requires(__boolean_testable<decltype(__t == __u)>),
|
| 79 |
+
requires(__boolean_testable<decltype(__t != __u)>),
|
| 80 |
+
requires(__boolean_testable<decltype(__u == __t)>),
|
| 81 |
+
requires(__boolean_testable<decltype(__u != __t)>)
|
| 82 |
+
));
|
| 83 |
+
|
| 84 |
+
template<class _Tp, class _Up>
|
| 85 |
+
_LIBCUDACXX_CONCEPT __weakly_equality_comparable_with =
|
| 86 |
+
_LIBCUDACXX_FRAGMENT(__weakly_equality_comparable_with_, _Tp, _Up);
|
| 87 |
+
|
| 88 |
+
template<class _Tp>
|
| 89 |
+
_LIBCUDACXX_CONCEPT equality_comparable = __weakly_equality_comparable_with<_Tp, _Tp>;
|
| 90 |
+
|
| 91 |
+
template<class _Tp, class _Up>
|
| 92 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT(
|
| 93 |
+
__equality_comparable_with_,
|
| 94 |
+
requires()(
|
| 95 |
+
requires(equality_comparable<_Tp>),
|
| 96 |
+
requires(equality_comparable<_Up>),
|
| 97 |
+
requires(common_reference_with<__make_const_lvalue_ref<_Tp>, __make_const_lvalue_ref<_Up>>),
|
| 98 |
+
requires(equality_comparable<
|
| 99 |
+
common_reference_t<
|
| 100 |
+
__make_const_lvalue_ref<_Tp>,
|
| 101 |
+
__make_const_lvalue_ref<_Up>>>),
|
| 102 |
+
requires(__weakly_equality_comparable_with<_Tp, _Up>)));
|
| 103 |
+
|
| 104 |
+
template<class _Tp, class _Up>
|
| 105 |
+
_LIBCUDACXX_CONCEPT equality_comparable_with = _LIBCUDACXX_FRAGMENT(__equality_comparable_with_, _Tp, _Up);
|
| 106 |
+
|
| 107 |
+
#endif // _LIBCUDACXX_STD_VER > 11
|
| 108 |
+
|
| 109 |
+
_LIBCUDACXX_END_NAMESPACE_STD
|
| 110 |
+
|
| 111 |
+
#endif // _LIBCUDACXX___CONCEPTS_EQUALITY_COMPARABLE_H
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/invocable.h
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
| 4 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 5 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 6 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
|
| 10 |
+
#ifndef _LIBCUDACXX___CONCEPTS_INVOCABLE_H
|
| 11 |
+
#define _LIBCUDACXX___CONCEPTS_INVOCABLE_H
|
| 12 |
+
|
| 13 |
+
#ifndef __cuda_std__
|
| 14 |
+
#include <__config>
|
| 15 |
+
#endif //__cuda_std__
|
| 16 |
+
|
| 17 |
+
#include "../__concepts/__concept_macros.h"
|
| 18 |
+
#include "../__functional/invoke.h"
|
| 19 |
+
#include "../__utility/forward.h"
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
_LIBCUDACXX_BEGIN_NAMESPACE_STD
|
| 30 |
+
|
| 31 |
+
#if _LIBCUDACXX_STD_VER > 17
|
| 32 |
+
|
| 33 |
+
// [concept.invocable]
|
| 34 |
+
|
| 35 |
+
template<class _Fn, class... _Args>
|
| 36 |
+
concept invocable = requires(_Fn&& __fn, _Args&&... __args) {
|
| 37 |
+
_CUDA_VSTD::__invoke(_CUDA_VSTD::forward<_Fn>(__fn), _CUDA_VSTD::forward<_Args>(__args)...); // not required to be equality preserving
|
| 38 |
+
};
|
| 39 |
+
|
| 40 |
+
// [concept.regular.invocable]
|
| 41 |
+
|
| 42 |
+
template<class _Fn, class... _Args>
|
| 43 |
+
concept regular_invocable = invocable<_Fn, _Args...>;
|
| 44 |
+
|
| 45 |
+
template <class _Fun, class... _Args>
|
| 46 |
+
concept __invoke_constructible = requires(_Fun&& __fun, _Args&&... __args) {
|
| 47 |
+
static_cast<remove_cvref_t<invoke_result_t<_Fun, _Args...>>>(
|
| 48 |
+
_CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Fun>(__fun), _CUDA_VSTD::forward<_Args>(__args)...));
|
| 49 |
+
};
|
| 50 |
+
|
| 51 |
+
#elif _LIBCUDACXX_STD_VER > 11
|
| 52 |
+
|
| 53 |
+
template<class _Fn, class... _Args>
|
| 54 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT(
|
| 55 |
+
_Invocable_,
|
| 56 |
+
requires(_Fn&& __fn, _Args&&... __args)(
|
| 57 |
+
(_CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Fn>(__fn), _CUDA_VSTD::forward<_Args>(__args)...))
|
| 58 |
+
));
|
| 59 |
+
|
| 60 |
+
template<class _Fn, class... _Args>
|
| 61 |
+
_LIBCUDACXX_CONCEPT invocable = _LIBCUDACXX_FRAGMENT(_Invocable_, _Fn, _Args...);
|
| 62 |
+
|
| 63 |
+
template<class _Fn, class... _Args>
|
| 64 |
+
_LIBCUDACXX_CONCEPT regular_invocable = invocable<_Fn, _Args...>;
|
| 65 |
+
|
| 66 |
+
template <class _Fun, class... _Args>
|
| 67 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT(
|
| 68 |
+
__invoke_constructible_,
|
| 69 |
+
requires(_Fun&& __fun, _Args&&... __args)(
|
| 70 |
+
(static_cast<__remove_cvref_t<invoke_result_t<_Fun, _Args...>>>(
|
| 71 |
+
_CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Fun>(__fun), _CUDA_VSTD::forward<_Args>(__args)...)))
|
| 72 |
+
));
|
| 73 |
+
template <class _Fun, class... _Args>
|
| 74 |
+
_LIBCUDACXX_CONCEPT __invoke_constructible = _LIBCUDACXX_FRAGMENT(__invoke_constructible_, _Fun, _Args...);
|
| 75 |
+
|
| 76 |
+
#endif // _LIBCUDACXX_STD_VER > 11
|
| 77 |
+
|
| 78 |
+
_LIBCUDACXX_END_NAMESPACE_STD
|
| 79 |
+
|
| 80 |
+
#endif // _LIBCUDACXX___CONCEPTS_INVOCABLE_H
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/movable.h
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
| 4 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 5 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 6 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
|
| 10 |
+
#ifndef _LIBCUDACXX___CONCEPTS_MOVABLE_H
|
| 11 |
+
#define _LIBCUDACXX___CONCEPTS_MOVABLE_H
|
| 12 |
+
|
| 13 |
+
#ifndef __cuda_std__
|
| 14 |
+
#include <__config>
|
| 15 |
+
#endif //__cuda_std__
|
| 16 |
+
|
| 17 |
+
#include "../__concepts/__concept_macros.h"
|
| 18 |
+
#include "../__concepts/assignable.h"
|
| 19 |
+
#include "../__concepts/constructible.h"
|
| 20 |
+
#include "../__concepts/swappable.h"
|
| 21 |
+
#include "../__type_traits/is_object.h"
|
| 22 |
+
|
| 23 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 24 |
+
# pragma GCC system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 26 |
+
# pragma clang system_header
|
| 27 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 28 |
+
# pragma system_header
|
| 29 |
+
#endif // no system header
|
| 30 |
+
|
| 31 |
+
_LIBCUDACXX_BEGIN_NAMESPACE_STD
|
| 32 |
+
|
| 33 |
+
#if _LIBCUDACXX_STD_VER > 17
|
| 34 |
+
|
| 35 |
+
template<class _Tp>
|
| 36 |
+
concept movable =
|
| 37 |
+
is_object_v<_Tp> &&
|
| 38 |
+
move_constructible<_Tp>&&
|
| 39 |
+
assignable_from<_Tp&, _Tp> &&
|
| 40 |
+
swappable<_Tp>;
|
| 41 |
+
|
| 42 |
+
#elif _LIBCUDACXX_STD_VER > 11
|
| 43 |
+
|
| 44 |
+
// [concepts.object]
|
| 45 |
+
template<class _Tp>
|
| 46 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT(
|
| 47 |
+
_Movable_,
|
| 48 |
+
requires()(//
|
| 49 |
+
requires(is_object_v<_Tp>),
|
| 50 |
+
requires(move_constructible<_Tp>),
|
| 51 |
+
requires(assignable_from<_Tp&, _Tp>),
|
| 52 |
+
requires(swappable<_Tp>)
|
| 53 |
+
));
|
| 54 |
+
|
| 55 |
+
template<class _Tp>
|
| 56 |
+
_LIBCUDACXX_CONCEPT movable = _LIBCUDACXX_FRAGMENT(_Movable_, _Tp);
|
| 57 |
+
|
| 58 |
+
#endif // _LIBCUDACXX_STD_VER > 11
|
| 59 |
+
|
| 60 |
+
_LIBCUDACXX_END_NAMESPACE_STD
|
| 61 |
+
|
| 62 |
+
#endif // _LIBCUDACXX___CONCEPTS_MOVABLE_H
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/predicate.h
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
| 4 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 5 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 6 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
|
| 10 |
+
#ifndef _LIBCUDACXX___CONCEPTS_PREDICATE_H
|
| 11 |
+
#define _LIBCUDACXX___CONCEPTS_PREDICATE_H
|
| 12 |
+
|
| 13 |
+
#ifndef __cuda_std__
|
| 14 |
+
#include <__config>
|
| 15 |
+
#endif //__cuda_std__
|
| 16 |
+
|
| 17 |
+
#include "../__concepts/__concept_macros.h"
|
| 18 |
+
#include "../__concepts/boolean_testable.h"
|
| 19 |
+
#include "../__concepts/invocable.h"
|
| 20 |
+
#include "../__functional/invoke.h"
|
| 21 |
+
|
| 22 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 23 |
+
# pragma GCC system_header
|
| 24 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 25 |
+
# pragma clang system_header
|
| 26 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 27 |
+
# pragma system_header
|
| 28 |
+
#endif // no system header
|
| 29 |
+
|
| 30 |
+
_LIBCUDACXX_BEGIN_NAMESPACE_STD
|
| 31 |
+
|
| 32 |
+
#if _LIBCUDACXX_STD_VER > 17
|
| 33 |
+
|
| 34 |
+
template<class _Fn, class... _Args>
|
| 35 |
+
concept predicate =
|
| 36 |
+
regular_invocable<_Fn, _Args...> && __boolean_testable<invoke_result_t<_Fn, _Args...>>;
|
| 37 |
+
|
| 38 |
+
#elif _LIBCUDACXX_STD_VER > 11
|
| 39 |
+
|
| 40 |
+
// [concept.predicate]
|
| 41 |
+
template<class _Fn, class... _Args>
|
| 42 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT(
|
| 43 |
+
_Predicate_,
|
| 44 |
+
requires()(//
|
| 45 |
+
requires(regular_invocable<_Fn, _Args...>),
|
| 46 |
+
requires(__boolean_testable<invoke_result_t<_Fn, _Args...>>)
|
| 47 |
+
));
|
| 48 |
+
|
| 49 |
+
template<class _Fn, class... _Args>
|
| 50 |
+
_LIBCUDACXX_CONCEPT predicate = _LIBCUDACXX_FRAGMENT(_Predicate_, _Fn, _Args...);
|
| 51 |
+
|
| 52 |
+
#endif // _LIBCUDACXX_STD_VER > 11
|
| 53 |
+
|
| 54 |
+
_LIBCUDACXX_END_NAMESPACE_STD
|
| 55 |
+
|
| 56 |
+
#endif // _LIBCUDACXX___CONCEPTS_PREDICATE_H
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/regular.h
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
| 4 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 5 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 6 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
|
| 10 |
+
#ifndef _LIBCUDACXX___CONCEPTS_REGULAR_H
|
| 11 |
+
#define _LIBCUDACXX___CONCEPTS_REGULAR_H
|
| 12 |
+
|
| 13 |
+
#ifndef __cuda_std__
|
| 14 |
+
#include <__config>
|
| 15 |
+
#endif //__cuda_std__
|
| 16 |
+
|
| 17 |
+
#include "../__concepts/__concept_macros.h"
|
| 18 |
+
#include "../__concepts/equality_comparable.h"
|
| 19 |
+
#include "../__concepts/semiregular.h"
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
_LIBCUDACXX_BEGIN_NAMESPACE_STD
|
| 30 |
+
|
| 31 |
+
#if _LIBCUDACXX_STD_VER > 17
|
| 32 |
+
|
| 33 |
+
// [concept.object]
|
| 34 |
+
|
| 35 |
+
template<class _Tp>
|
| 36 |
+
concept regular = semiregular<_Tp> && equality_comparable<_Tp>;
|
| 37 |
+
|
| 38 |
+
#elif _LIBCUDACXX_STD_VER > 11
|
| 39 |
+
|
| 40 |
+
// [concept.object]
|
| 41 |
+
|
| 42 |
+
template<class _Tp>
|
| 43 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT(
|
| 44 |
+
__regular_,
|
| 45 |
+
requires()(
|
| 46 |
+
requires(semiregular<_Tp>),
|
| 47 |
+
requires(equality_comparable<_Tp>)
|
| 48 |
+
));
|
| 49 |
+
|
| 50 |
+
template<class _Tp>
|
| 51 |
+
_LIBCUDACXX_CONCEPT regular = _LIBCUDACXX_FRAGMENT(__regular_, _Tp);
|
| 52 |
+
|
| 53 |
+
#endif // _LIBCUDACXX_STD_VER > 11
|
| 54 |
+
|
| 55 |
+
_LIBCUDACXX_END_NAMESPACE_STD
|
| 56 |
+
|
| 57 |
+
#endif // _LIBCUDACXX___CONCEPTS_REGULAR_H
|
cuda_toolkit/include/cuda/std/detail/libcxx/include/__concepts/relation.h
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
| 4 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 5 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 6 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
|
| 10 |
+
#ifndef _LIBCUDACXX___CONCEPTS_RELATION_H
|
| 11 |
+
#define _LIBCUDACXX___CONCEPTS_RELATION_H
|
| 12 |
+
|
| 13 |
+
#ifndef __cuda_std__
|
| 14 |
+
#include <__config>
|
| 15 |
+
#endif //__cuda_std__
|
| 16 |
+
|
| 17 |
+
#include "../__concepts/__concept_macros.h"
|
| 18 |
+
#include "../__concepts/predicate.h"
|
| 19 |
+
|
| 20 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 21 |
+
# pragma GCC system_header
|
| 22 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 23 |
+
# pragma clang system_header
|
| 24 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 25 |
+
# pragma system_header
|
| 26 |
+
#endif // no system header
|
| 27 |
+
|
| 28 |
+
_LIBCUDACXX_BEGIN_NAMESPACE_STD
|
| 29 |
+
|
| 30 |
+
#if _LIBCUDACXX_STD_VER > 17
|
| 31 |
+
|
| 32 |
+
// [concept.relation]
|
| 33 |
+
|
| 34 |
+
template<class _Rp, class _Tp, class _Up>
|
| 35 |
+
concept relation =
|
| 36 |
+
predicate<_Rp, _Tp, _Tp> && predicate<_Rp, _Up, _Up> &&
|
| 37 |
+
predicate<_Rp, _Tp, _Up> && predicate<_Rp, _Up, _Tp>;
|
| 38 |
+
|
| 39 |
+
// [concept.equiv]
|
| 40 |
+
|
| 41 |
+
template<class _Rp, class _Tp, class _Up>
|
| 42 |
+
concept equivalence_relation = relation<_Rp, _Tp, _Up>;
|
| 43 |
+
|
| 44 |
+
// [concept.strictweakorder]
|
| 45 |
+
|
| 46 |
+
template<class _Rp, class _Tp, class _Up>
|
| 47 |
+
concept strict_weak_order = relation<_Rp, _Tp, _Up>;
|
| 48 |
+
|
| 49 |
+
#elif _LIBCUDACXX_STD_VER > 11
|
| 50 |
+
|
| 51 |
+
template<class _Rp, class _Tp, class _Up>
|
| 52 |
+
_LIBCUDACXX_CONCEPT_FRAGMENT(
|
| 53 |
+
__relation_,
|
| 54 |
+
requires()(
|
| 55 |
+
requires(predicate<_Rp, _Tp, _Tp>),
|
| 56 |
+
requires(predicate<_Rp, _Up, _Up>),
|
| 57 |
+
requires(predicate<_Rp, _Tp, _Up>),
|
| 58 |
+
requires(predicate<_Rp, _Up, _Tp>)
|
| 59 |
+
));
|
| 60 |
+
|
| 61 |
+
template<class _Rp, class _Tp, class _Up>
|
| 62 |
+
_LIBCUDACXX_CONCEPT relation = _LIBCUDACXX_FRAGMENT(__relation_, _Rp, _Tp, _Up);
|
| 63 |
+
|
| 64 |
+
// [concept.equiv]
|
| 65 |
+
|
| 66 |
+
template<class _Rp, class _Tp, class _Up>
|
| 67 |
+
_LIBCUDACXX_CONCEPT equivalence_relation = relation<_Rp, _Tp, _Up>;
|
| 68 |
+
|
| 69 |
+
// [concept.strictweakorder]
|
| 70 |
+
|
| 71 |
+
template<class _Rp, class _Tp, class _Up>
|
| 72 |
+
_LIBCUDACXX_CONCEPT strict_weak_order = relation<_Rp, _Tp, _Up>;
|
| 73 |
+
|
| 74 |
+
#endif // _LIBCUDACXX_STD_VER > 11
|
| 75 |
+
|
| 76 |
+
_LIBCUDACXX_END_NAMESPACE_STD
|
| 77 |
+
|
| 78 |
+
#endif // _LIBCUDACXX___CONCEPTS_RELATION_H
|