From 0400592034291e5a0f1275d8bb3356dbf948060b Mon Sep 17 00:00:00 2001 From: Elias Stehle <3958403+elstehle@users.noreply.github.com> Date: Sat, 11 Jan 2025 11:05:37 -0800 Subject: [PATCH] debug types --- .../device/dispatch/dispatch_segmented_sort.cuh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/cub/cub/device/dispatch/dispatch_segmented_sort.cuh b/cub/cub/device/dispatch/dispatch_segmented_sort.cuh index c2b5e04eef..8ea7edc9bc 100644 --- a/cub/cub/device/dispatch/dispatch_segmented_sort.cuh +++ b/cub/cub/device/dispatch/dispatch_segmented_sort.cuh @@ -80,6 +80,12 @@ using per_invocation_segment_offset_t = int; // Type used for total number of segments and to index within segments globally using global_segment_offset_t = int; +template +void foo(Base base, Deref deref) +{ + static_assert(std::is_same::value, "Debug."); +} + template struct DereferenceHelper { using type = decltype(*std::declval().base()); @@ -91,8 +97,7 @@ class OffsetIteratorT Iterator, THRUST_NS_QUALIFIER::use_default, THRUST_NS_QUALIFIER::any_system_tag, - THRUST_NS_QUALIFIER::random_access_traversal_tag, - typename ::cuda::std::iterator_traits::value_type> + THRUST_NS_QUALIFIER::random_access_traversal_tag> { public: using super_t = @@ -100,8 +105,7 @@ public: Iterator, THRUST_NS_QUALIFIER::use_default, THRUST_NS_QUALIFIER::any_system_tag, - THRUST_NS_QUALIFIER::random_access_traversal_tag, - typename ::cuda::std::iterator_traits::value_type>; + THRUST_NS_QUALIFIER::random_access_traversal_tag>; OffsetIteratorT() = default; @@ -120,7 +124,9 @@ private: _CCCL_HOST_DEVICE _CCCL_FORCEINLINE typename ::cuda::std::iterator_traits::value_type dereference() const { - return *(it + static_cast(*offset_it)); +foo(*this->base(), *it); + // return *(it + static_cast(*offset_it)); + return *it; } };