/* * 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 #include #include namespace thrust { // XXX WAR circular #inclusion with forward declarations struct random_access_universal_iterator_tag; struct input_universal_iterator_tag; struct output_universal_iterator_tag; namespace detail { // forward declaration template struct is_iterator_system; template struct device_iterator_category_to_backend_system; // XXX this should work entirely differently // we should just specialize this metafunction for iterator_category_with_system_and_traversal template struct iterator_category_to_system // convertible to any iterator? : eval_if< or_< is_convertible, is_convertible >::value, detail::identity_, // convertible to host iterator? eval_if< or_< is_convertible, is_convertible >::value, detail::identity_, // convertible to device iterator? eval_if< or_< is_convertible, is_convertible >::value, detail::identity_, // unknown system detail::identity_ > // if device > // if host > // if any { }; // end iterator_category_to_system template struct iterator_category_or_traversal_to_system : eval_if< is_iterator_system::value, detail::identity_, iterator_category_to_system > { }; // end iterator_category_or_traversal_to_system } // end detail } // end thrust