This repository was archived by the owner on Mar 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 758
Expand file tree
/
Copy pathiterator_categories.cu
More file actions
22 lines (18 loc) · 1.88 KB
/
iterator_categories.cu
File metadata and controls
22 lines (18 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <thrust/iterator/detail/iterator_category_with_system_and_traversal.h>
#include <thrust/iterator/iterator_categories.h>
#include <thrust/iterator/iterator_traits.h>
template <class IteratorCategory>
using _category_to_system_t =
typename thrust::detail::iterator_category_to_system<IteratorCategory>::type;
static_assert(std::is_same<thrust::device_system_tag, _category_to_system_t<thrust::output_device_iterator_tag>>::value, "");
static_assert(std::is_same<thrust::device_system_tag, _category_to_system_t<thrust::input_device_iterator_tag>>::value, "");
// static_assert(std::is_same<thrust::device_system_tag, _category_to_system_t<thrust::forward_device_iterator_tag>>::value, ""); // Still broken
// static_assert(std::is_same<thrust::device_system_tag, _category_to_system_t<thrust::bidirectional_device_iterator_tag>>::value, ""); // Still broken
// static_assert(std::is_same<thrust::device_system_tag, _category_to_system_t<thrust::random_access_device_iterator_tag>>::value, ""); // Still broken
static_assert(std::is_same<thrust::host_system_tag, _category_to_system_t<thrust::output_host_iterator_tag>>::value, "");
static_assert(std::is_same<thrust::host_system_tag, _category_to_system_t<thrust::input_host_iterator_tag>>::value, "");
static_assert(std::is_same<thrust::host_system_tag, _category_to_system_t<thrust::forward_host_iterator_tag>>::value, "");
static_assert(std::is_same<thrust::host_system_tag, _category_to_system_t<thrust::bidirectional_host_iterator_tag>>::value, "");
static_assert(std::is_same<thrust::host_system_tag, _category_to_system_t<thrust::random_access_host_iterator_tag>>::value, "");
// static_assert(!std::is_convertible<thrust::input_device_iterator_tag, thrust::input_host_iterator_tag>::value, ""); // Still broken
static_assert(!std::is_convertible<thrust::input_host_iterator_tag, thrust::input_device_iterator_tag>::value, "");