Skip to content

Commit

Permalink
debugging iterator differences
Browse files Browse the repository at this point in the history
  • Loading branch information
elstehle committed Jan 13, 2025
1 parent fe22c33 commit b1f37dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions cub/cub/device/device_segmented_sort.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@
CUB_NAMESPACE_BEGIN


template<typename RefT, typename WrappedItT, typename VanillaItT>
void debug_fail(WrappedItT wrapped, VanillaItT vanilla)
template<typename BaseItT, typename AdvancedItT>
void debug_fail(BaseItT wrapped, AdvancedItT vanilla)
{
static_assert(std::is_same<WrappedItT, void>::value, "Debug...");
static_assert(std::is_same<BaseItT, void>::value, "Debug...");
}

template <typename Iterator, typename OffsetItT>
Expand All @@ -79,7 +79,8 @@ private:

_CCCL_HOST_DEVICE typename super_t::reference dereference() const
{
debug_fail<typename super_t::reference>(*(this->base() + (*offset_it)), *it);
debug_fail(it, it + *offset_it);
// debug_fail<typename super_t::reference>(*(this->base() + (*offset_it)), *it);
return *(this->base() + (*offset_it));
}
};
Expand Down
2 changes: 1 addition & 1 deletion thrust/thrust/iterator/iterator_adaptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class _CCCL_DECLSPEC_EMPTY_BASES iterator_adaptor

// counting_iterator will pick eg. diff_t=int64 when base=int32.
// Explicitly cast to avoid static conversion warnings.
m_iterator = (m_iterator + n);
m_iterator = static_cast<base_type>(m_iterator + n);
}

_CCCL_EXEC_CHECK_DISABLE
Expand Down

0 comments on commit b1f37dc

Please sign in to comment.