|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#pragma once |
|
|
|
|
|
#include <thrust/detail/config.h> |
|
|
|
|
|
#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 |
|
|
|
|
|
THRUST_NAMESPACE_BEGIN |
|
|
|
|
|
namespace detail |
|
|
{ |
|
|
|
|
|
struct execution_policy_marker {}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<typename DerivedPolicy> |
|
|
struct execution_policy_base : execution_policy_marker {}; |
|
|
|
|
|
|
|
|
template<typename DerivedPolicy> |
|
|
constexpr __host__ __device__ |
|
|
execution_policy_base<DerivedPolicy> &strip_const(const execution_policy_base<DerivedPolicy> &x) |
|
|
{ |
|
|
return const_cast<execution_policy_base<DerivedPolicy>&>(x); |
|
|
} |
|
|
|
|
|
|
|
|
template<typename DerivedPolicy> |
|
|
constexpr __host__ __device__ |
|
|
DerivedPolicy &derived_cast(execution_policy_base<DerivedPolicy> &x) |
|
|
{ |
|
|
return static_cast<DerivedPolicy&>(x); |
|
|
} |
|
|
|
|
|
|
|
|
template<typename DerivedPolicy> |
|
|
constexpr __host__ __device__ |
|
|
const DerivedPolicy &derived_cast(const execution_policy_base<DerivedPolicy> &x) |
|
|
{ |
|
|
return static_cast<const DerivedPolicy&>(x); |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
template<typename DerivedPolicy> |
|
|
struct execution_policy |
|
|
: thrust::detail::execution_policy_base<DerivedPolicy> |
|
|
{}; |
|
|
|
|
|
THRUST_NAMESPACE_END |
|
|
|