Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 18 additions & 4 deletions libcudacxx/include/cuda/std/__algorithm/sort.h
Original file line number Diff line number Diff line change
Expand Up @@ -601,8 +601,12 @@ __bitset_partition(_RandomAccessIterator __first, _RandomAccessIterator __last,
}
else
{
while (++__first < __last && !__comp(__pivot, *__first))
while (++__first < __last)
{
if (__comp(__pivot, *__first))
{
break;
}
}
}
// Find the last element less than or equal to the pivot.
Expand Down Expand Up @@ -705,8 +709,14 @@ __partition_with_equals_on_right(_RandomAccessIterator __first, _RandomAccessIte
// Find the last element less than the pivot.
if (__begin == __first - difference_type(1))
{
while (__first < __last && !__comp(*--__last, __pivot))
;
while (__first < __last)
{
--__last;
if (__comp(*__last, __pivot))
{
break;
}
}
}
else
{
Expand Down Expand Up @@ -777,8 +787,12 @@ __partition_with_equals_on_left(_RandomAccessIterator __first, _RandomAccessIter
}
else
{
while (++__first < __last && !__comp(__pivot, *__first))
while (++__first < __last)
{
if (__comp(__pivot, *__first))
{
break;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT linear_congruential_engine
private:
result_type __x_{};

static constexpr const result_type _Mp = result_type(~0);
static constexpr result_type _Mp = static_cast<result_type>(~0);

static_assert(__M == 0 || __A < __M, "linear_congruential_engine invalid parameters");
static_assert(__M == 0 || __C < __M, "linear_congruential_engine invalid parameters");
Expand Down
Loading