/* * Copyright 2008-2013 NVIDIA Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include #if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) # pragma GCC system_header #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) # pragma clang system_header #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) # pragma system_header #endif // no system header #include #include #include #include THRUST_NAMESPACE_BEGIN template struct iterator_value { typedef typename thrust::iterator_traits::value_type type; }; // end iterator_value template using iterator_value_t = typename iterator_value::type; template struct iterator_pointer { typedef typename thrust::iterator_traits::pointer type; }; // end iterator_pointer template using iterator_pointer_t = typename iterator_pointer::type; template struct iterator_reference { typedef typename iterator_traits::reference type; }; // end iterator_reference template using iterator_reference_t = typename iterator_reference::type; template struct iterator_difference { typedef typename thrust::iterator_traits::difference_type type; }; // end iterator_difference template using iterator_difference_t = typename iterator_difference::type; namespace detail { template struct iterator_system_impl {}; template struct iterator_system_impl::iterator_category>::type> : detail::iterator_category_to_system::iterator_category> {}; } // namespace detail template struct iterator_system : detail::iterator_system_impl {}; // specialize iterator_system for void *, which has no category template <> struct iterator_system { typedef thrust::iterator_system::type type; }; // end iterator_system template <> struct iterator_system { typedef thrust::iterator_system::type type; }; // end iterator_system template using iterator_system_t = typename iterator_system::type; template struct iterator_traversal : detail::iterator_category_to_traversal::iterator_category> {}; // end iterator_traversal namespace detail { template struct is_iterator_traversal : ::cuda::std::is_convertible {}; // end is_iterator_traversal template struct is_iterator_system : ::cuda::std::disjunction<::cuda::std::is_convertible, ::cuda::std::disjunction<::cuda::std::is_convertible, ::cuda::std::is_convertible>> {}; // end is_iterator_system } // end namespace detail THRUST_NAMESPACE_END