/* * Copyright 2008-2012 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 #include #include #include #include namespace thrust { // XXX WAR circular #inclusion with these forward declarations struct bidirectional_universal_iterator_tag; struct forward_universal_iterator_tag; namespace detail { // forward declarations template struct is_iterator_system; template struct is_iterator_traversal; // make type_traits easy to access using namespace thrust::detail; template struct host_system_category_to_traversal : eval_if< is_convertible::value, detail::identity_, eval_if< is_convertible::value, detail::identity_, eval_if< is_convertible::value, detail::identity_, eval_if< is_convertible::value, detail::identity_, eval_if< is_convertible::value, detail::identity_, void > > > > > { }; // end host_system_category_to_traversal template struct device_system_category_to_traversal : eval_if< is_convertible::value, detail::identity_, eval_if< is_convertible::value, detail::identity_, eval_if< is_convertible::value, detail::identity_, eval_if< is_convertible::value, detail::identity_, eval_if< is_convertible::value, detail::identity_, void > > > > > { }; // end device_system_category_to_traversal template struct any_system_category_to_traversal : eval_if< is_convertible::value, identity_, eval_if< is_convertible::value, identity_, eval_if< is_convertible::value, identity_, eval_if< is_convertible::value, identity_, eval_if< is_convertible::value, identity_, // unknown traversal void > > > > > { }; // end any_system_category_to_traversal template struct category_to_traversal // check for any system : eval_if< or_< is_convertible, is_convertible >::value, any_system_category_to_traversal, // check for host system eval_if< or_< is_convertible, is_convertible >::value, host_system_category_to_traversal, // check for device system eval_if< or_< is_convertible, is_convertible >::value, device_system_category_to_traversal, // unknown category void > > > {}; template struct iterator_category_to_traversal : eval_if< is_iterator_traversal::value, detail::identity_, category_to_traversal > { }; // end iterator_category_to_traversal } // end detail } // end thrust