Skip to content

Commit

Permalink
fix common_type in fast_div_mod
Browse files Browse the repository at this point in the history
  • Loading branch information
fbusato committed Nov 18, 2024
1 parent 699a6ad commit e5b9f90
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cub/cub/detail/fast_modulo_division.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,15 @@ class fast_div_mod
{
static_assert(supported_integral<T1>::value, "unsupported type");

// uint16_t is a special case that would requires complex logic. Workaround: convert to unsigned
using T = ::cuda::std::conditional_t<::cuda::std::is_same<T1, ::cuda::std::uint16_t>::value, unsigned, T1>;
// uint16_t is a special case that would requires complex logic. Workaround: convert to int
using T = ::cuda::std::conditional_t<::cuda::std::is_same<T1, ::cuda::std::uint16_t>::value, int, T1>;
using unsigned_t = unsigned_implicit_prom_t<T>;

public:
template <typename R>
struct result
{
using common_t = decltype(R{} / T1{});
using common_t = decltype(R{} / T{});
common_t quotient;
common_t remainder;
};
Expand Down

0 comments on commit e5b9f90

Please sign in to comment.