Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
0976243
64-bit indexing for DeviceSegmentedReduce
jecs Sep 7, 2023
525aef9
Fixed minor mistake in OffsetT static_assert
jecs Sep 7, 2023
6905d7f
Fixed type checking in choose_offset.cuh
jecs Sep 7, 2023
2b9e144
Undid erroneous changes due to using old Cub repository
jecs Sep 7, 2023
e3d3ec6
Undid the last few erroneous changes
jecs Sep 7, 2023
34c733d
Converted tabs to spaces
jecs Sep 7, 2023
5b82798
64-bit indexing for DeviceSegmentedReduce
jecs Sep 11, 2023
d7a7ed4
fixed minor formatting issue
jecs Sep 11, 2023
5f694d7
Merge branch 'NVIDIA:main' into device-reduce-64bit
jecs Sep 11, 2023
a4c032b
Made test input sequences with number of elements >= 2^32
jecs Sep 12, 2023
39bad5d
Merge branch 'device-reduce-64bit' of github.com:jecs/cccl into devic…
jecs Sep 12, 2023
cfef155
Removed some cruft
jecs Sep 12, 2023
129b95c
Removed defaulted assignment operators for C++11 compatibility
jecs Sep 13, 2023
5a5eb76
Merge branch 'NVIDIA:main' into device-reduce-64bit
jecs Sep 13, 2023
9af36d7
Implemented suggestions to clean up and improve code
jecs Sep 13, 2023
8f59ed2
Tab to spaces
jecs Sep 13, 2023
f94bf3a
New test + clang-format on modified files
jecs Sep 14, 2023
31554f8
Test signed offset types in segmented reduce
gevtushenko Sep 18, 2023
46dc4c8
Return old offset type to segmented arg reductions
gevtushenko Sep 19, 2023
b598341
Merge pull request #1 from senior-zero/device-reduce-64bit
jecs Sep 19, 2023
a270c0d
Merge branch 'main' into device-reduce-64bit
gevtushenko Sep 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions cub/cub/detail/choose_offset.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@

#include <cub/config.cuh>

#include <cuda/std/iterator>
#include <cuda/std/type_traits>

#include <cstdint>
#include <type_traits>

CUB_NAMESPACE_BEGIN

Expand All @@ -45,18 +47,28 @@ template <typename NumItemsT>
struct ChooseOffsetT
{
// NumItemsT must be an integral type (but not bool).
static_assert(
std::is_integral<NumItemsT>::value &&
!std::is_same<typename std::remove_cv<NumItemsT>::type, bool>::value,
"NumItemsT must be an integral type, but not bool");
static_assert(std::is_integral<NumItemsT>::value &&
!std::is_same<typename std::remove_cv<NumItemsT>::type, bool>::value,
"NumItemsT must be an integral type, but not bool");

// Unsigned integer type for global offsets.
using Type = typename std::conditional<sizeof(NumItemsT) <= 4,
std::uint32_t,
unsigned long long>::type;
using Type =
typename std::conditional<sizeof(NumItemsT) <= 4, std::uint32_t, unsigned long long>::type;
};

/**
* common_iterator_value sets member type to the common_type of
* value_type for all argument types. used to get OffsetT in
* DeviceSegmentedReduce.
*/
template <typename... Iter>
struct common_iterator_value
{
using type = ::cuda::std::__common_type_t<::cuda::std::__iter_value_type<Iter>...>;
};
template <typename... Iter>
using common_iterator_value_t = typename common_iterator_value<Iter...>::type;

} // namespace detail

CUB_NAMESPACE_END

Loading