#include #include #include #include #if THRUST_CPP_DIALECT >= 2011 #include #include #include #endif #include #if THRUST_CPP_DIALECT >= 2017 #include #endif #include #include #include #include #include #include #include #include THRUST_STATIC_ASSERT((thrust::is_contiguous_iterator< std::string::iterator >::value)); THRUST_STATIC_ASSERT((thrust::is_contiguous_iterator< std::wstring::iterator >::value)); #if THRUST_CPP_DIALECT >= 2017 THRUST_STATIC_ASSERT((thrust::is_contiguous_iterator< std::string_view::iterator >::value)); THRUST_STATIC_ASSERT((thrust::is_contiguous_iterator< std::wstring_view::iterator >::value)); #endif THRUST_STATIC_ASSERT((!thrust::is_contiguous_iterator< std::vector::iterator >::value)); template __host__ void test_is_contiguous_iterator() { THRUST_STATIC_ASSERT((thrust::is_contiguous_iterator< T* >::value)); THRUST_STATIC_ASSERT((thrust::is_contiguous_iterator< T const* >::value)); THRUST_STATIC_ASSERT((thrust::is_contiguous_iterator< thrust::device_ptr >::value)); THRUST_STATIC_ASSERT((thrust::is_contiguous_iterator< typename std::vector::iterator >::value)); THRUST_STATIC_ASSERT((!thrust::is_contiguous_iterator< typename std::vector::reverse_iterator >::value)); #if THRUST_CPP_DIALECT >= 2011 THRUST_STATIC_ASSERT((thrust::is_contiguous_iterator< typename std::array::iterator >::value)); #endif THRUST_STATIC_ASSERT((!thrust::is_contiguous_iterator< typename std::list::iterator >::value)); THRUST_STATIC_ASSERT((!thrust::is_contiguous_iterator< typename std::deque::iterator >::value)); THRUST_STATIC_ASSERT((!thrust::is_contiguous_iterator< typename std::set::iterator >::value)); THRUST_STATIC_ASSERT((!thrust::is_contiguous_iterator< typename std::multiset::iterator >::value)); THRUST_STATIC_ASSERT((!thrust::is_contiguous_iterator< typename std::map::iterator >::value)); THRUST_STATIC_ASSERT((!thrust::is_contiguous_iterator< typename std::multimap::iterator >::value)); #if THRUST_CPP_DIALECT >= 2011 THRUST_STATIC_ASSERT((!thrust::is_contiguous_iterator< typename std::unordered_set::iterator >::value)); THRUST_STATIC_ASSERT((!thrust::is_contiguous_iterator< typename std::unordered_multiset::iterator >::value)); THRUST_STATIC_ASSERT((!thrust::is_contiguous_iterator< typename std::unordered_map::iterator >::value)); THRUST_STATIC_ASSERT((!thrust::is_contiguous_iterator< typename std::unordered_multimap::iterator >::value)); #endif THRUST_STATIC_ASSERT((!thrust::is_contiguous_iterator< std::istream_iterator >::value)); THRUST_STATIC_ASSERT((!thrust::is_contiguous_iterator< std::ostream_iterator >::value)); } DECLARE_GENERIC_UNITTEST(test_is_contiguous_iterator); template __host__ void test_is_contiguous_iterator_vectors() { THRUST_STATIC_ASSERT((thrust::is_contiguous_iterator< typename Vector::iterator >::value)); } DECLARE_VECTOR_UNITTEST(test_is_contiguous_iterator_vectors);