| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #pragma once |
|
|
| |
|
|
| #if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) |
| # pragma GCC system_header |
| #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) |
| # pragma clang system_header |
| #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) |
| # pragma system_header |
| #endif |
|
|
| #include <thrust/detail/config/cpp_dialect.h> |
|
|
| #include <cstddef> |
|
|
| #ifndef __has_cpp_attribute |
| # define __has_cpp_attribute(X) 0 |
| #endif |
|
|
| |
| |
| #if defined(THRUST_DOXYGEN) |
| # define THRUST_TRAILING_RETURN(...) |
| #else |
| # define THRUST_TRAILING_RETURN(...) -> __VA_ARGS__ |
| #endif |
|
|
| #if THRUST_CPP_DIALECT >= 2014 && __has_cpp_attribute(nodiscard) |
| # define THRUST_NODISCARD [[nodiscard]] |
| #else |
| # define THRUST_NODISCARD |
| #endif |
|
|
| #if THRUST_CPP_DIALECT >= 2017 && __cpp_if_constexpr |
| # define THRUST_IF_CONSTEXPR if constexpr |
| #else |
| # define THRUST_IF_CONSTEXPR if |
| #endif |
|
|
| |
| |
| |
| #if defined(__CUDA_ARCH__) || defined(_NVHPC_CUDA) |
| |
| |
| |
| |
| # if THRUST_CPP_DIALECT >= 2011 |
| # define THRUST_INLINE_CONSTANT static const __device__ |
| # define THRUST_INLINE_INTEGRAL_MEMBER_CONSTANT static constexpr |
| # else |
| # define THRUST_INLINE_CONSTANT static const __device__ |
| # define THRUST_INLINE_INTEGRAL_MEMBER_CONSTANT static const |
| # endif |
| #else |
| |
| |
| |
| |
| # if THRUST_CPP_DIALECT >= 2011 |
| # define THRUST_INLINE_CONSTANT static constexpr |
| # define THRUST_INLINE_INTEGRAL_MEMBER_CONSTANT static constexpr |
| # else |
| # define THRUST_INLINE_CONSTANT static const |
| # define THRUST_INLINE_INTEGRAL_MEMBER_CONSTANT static const |
| # endif |
| #endif |
|
|
| |
| |
| |
| |
| |
| |
| #ifdef THRUST_PROVIDE_LEGACY_ARCH_MACROS |
| #ifndef THRUST_IS_DEVICE_CODE |
| #if defined(_NVHPC_CUDA) |
| #define THRUST_IS_DEVICE_CODE __builtin_is_device_code() |
| #define THRUST_IS_HOST_CODE (!__builtin_is_device_code()) |
| #define THRUST_INCLUDE_DEVICE_CODE 1 |
| #define THRUST_INCLUDE_HOST_CODE 1 |
| #elif defined(__CUDA_ARCH__) |
| #define THRUST_IS_DEVICE_CODE 1 |
| #define THRUST_IS_HOST_CODE 0 |
| #define THRUST_INCLUDE_DEVICE_CODE 1 |
| #define THRUST_INCLUDE_HOST_CODE 0 |
| #else |
| #define THRUST_IS_DEVICE_CODE 0 |
| #define THRUST_IS_HOST_CODE 1 |
| #define THRUST_INCLUDE_DEVICE_CODE 0 |
| #define THRUST_INCLUDE_HOST_CODE 1 |
| #endif |
| #endif |
| #endif |
|
|