Skip to content

Commit 67f91df

Browse files
committed
stdpar Tutorial: Change iterator_category of cartesian product view iterators to random access. This fixes the major performance bug where thrust::distance/cuda::std::distance will be O(N) for cartesian product views.
1 parent e9e8dc5 commit 67f91df

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdpar-tutorial/include/ranges

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9588,7 +9588,7 @@ namespace views::__adaptor
95889588
friend cartesian_product_view;
95899589

95909590
public:
9591-
using iterator_category = input_iterator_tag;
9591+
using iterator_category = random_access_iterator_tag;
95929592
using iterator_concept = decltype(_S_iter_concept());
95939593
using value_type
95949594
= __detail::__tuple_or_pair_t<range_value_t<__maybe_const_t<_Const, _First>>,

0 commit comments

Comments
 (0)