| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #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 |
| #include <thrust/detail/functional/composite.h> |
| #include <thrust/detail/functional/operators/assignment_operator.h> |
| #include <thrust/functional.h> |
| #include <thrust/type_traits/logical_metafunctions.h> |
|
|
| #include <type_traits> |
|
|
| THRUST_NAMESPACE_BEGIN |
|
|
| namespace detail |
| { |
| namespace functional |
| { |
|
|
| template<typename Eval> |
| __host__ __device__ |
| constexpr actor<Eval> |
| ::actor() |
| : eval_type() |
| {} |
|
|
| template<typename Eval> |
| __host__ __device__ |
| actor<Eval> |
| ::actor(const Eval &base) |
| : eval_type(base) |
| {} |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| template <typename T> |
| using actor_check_ref_type = |
| ::cuda::std::integral_constant<bool, |
| ( std::is_lvalue_reference<T>::value || |
| thrust::detail::is_wrapped_reference<T>::value )>; |
|
|
| template <typename... Ts> |
| using actor_check_ref_types = |
| thrust::conjunction<actor_check_ref_type<Ts>...>; |
|
|
| template<typename Eval> |
| template<typename... Ts> |
| __host__ __device__ |
| typename apply_actor<typename actor<Eval>::eval_type, |
| thrust::tuple<eval_ref<Ts>...>>::type |
| actor<Eval>::operator()(Ts&&... ts) const |
| { |
| static_assert(actor_check_ref_types<Ts...>::value, |
| "Actor evaluations only support rvalue references to " |
| "thrust::reference subclasses."); |
| using tuple_type = thrust::tuple<eval_ref<Ts>...>; |
| return eval_type::eval(tuple_type(THRUST_FWD(ts)...)); |
| } |
|
|
| template<typename Eval> |
| template<typename T> |
| __host__ __device__ |
| typename assign_result<Eval,T>::type |
| actor<Eval> |
| ::operator=(const T& _1) const |
| { |
| return do_assign(*this,_1); |
| } |
|
|
| } |
| } |
| THRUST_NAMESPACE_END |
|
|