Skip to content

Cleanups for random module#6951

Merged
davebayer merged 7 commits intoNVIDIA:mainfrom
RAMitchell:random-cleanup
Dec 12, 2025
Merged

Cleanups for random module#6951
davebayer merged 7 commits intoNVIDIA:mainfrom
RAMitchell:random-cleanup

Conversation

@RAMitchell
Copy link
Contributor

  • Add generate_canonical to random header, add basic test.
  • Rename libcpp assertions to cccl

@RAMitchell RAMitchell requested a review from a team as a code owner December 11, 2025 13:05
@RAMitchell RAMitchell requested a review from wmaxey December 11, 2025 13:05
@github-project-automation github-project-automation bot moved this to Todo in CCCL Dec 11, 2025
@cccl-authenticator-app cccl-authenticator-app bot moved this from Todo to In Review in CCCL Dec 11, 2025
@github-project-automation github-project-automation bot moved this from In Review to In Progress in CCCL Dec 11, 2025
Comment on lines +50 to +51
inline constexpr bool __cccl_random_is_valid_inttype =
::cuda::std::__cccl_is_integer_v<_Type> && !::cuda::std::is_const_v<_Type>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!::cuda::std::is_const_v<_Type> is not necessary, __cccl_is_integer_v already requires the type to be cv-unqualified

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, at this point, I would use __cccl_is_integer_v directly

#endif // _CCCL_HAS_LONG_DOUBLE()
template <class _Type>
inline constexpr bool __cccl_random_is_valid_realtype =
::cuda::std::is_floating_point_v<_Type> && !::cuda::std::is_const_v<_Type>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you wait for #6952, you can just use __cccl_is_floating_point_v, which will be cv uqualified :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, we can replace __cccl_random_is_valid_realtype with __cccl_is_floating_point_v

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, have updated that.

@github-actions

This comment has been minimized.

@github-project-automation github-project-automation bot moved this from In Progress to In Review in CCCL Dec 12, 2025
@davebayer davebayer enabled auto-merge (squash) December 12, 2025 09:13
@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

🥳 CI Workflow Results

🟩 Finished in 2h 04m: Pass: 100%/91 | Total: 1d 14h | Max: 2h 04m | Hits: 84%/209380

See results here.

@davebayer davebayer merged commit d9435a4 into NVIDIA:main Dec 12, 2025
103 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Done in CCCL Dec 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants