Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Deallocation should be noexcept#1416

Merged
rapids-bot[bot] merged 1 commit intorapidsai:branch-25.12from
bdice:use-noexcept-on-deallocation
Oct 9, 2025
Merged

Deallocation should be noexcept#1416
rapids-bot[bot] merged 1 commit intorapidsai:branch-25.12from
bdice:use-noexcept-on-deallocation

Conversation

@bdice
Copy link
Contributor

@bdice bdice commented Oct 9, 2025

Update for compatibility with rapidsai/rmm#2077.

@bdice bdice requested a review from a team as a code owner October 9, 2025 03:09
@bdice bdice added bug Something isn't working non-breaking Introduces a non-breaking change labels Oct 9, 2025
void do_deallocate(void* ptr, std::size_t size, rmm::cuda_stream_view) override
void do_deallocate(void* ptr, std::size_t size, rmm::cuda_stream_view) noexcept override
{
if (munmap(ptr, size) == -1) { RAFT_FAIL("huge_page_resource::munmap"); }
Copy link
Contributor Author

@bdice bdice Oct 9, 2025

Choose a reason for hiding this comment

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

This function must be made noexcept. Throwing in noexcept code forces std::terminate, so this RAFT_FAIL will trigger that. I don't know if this error message will be displayed, but my suspicion is that it won't show up. The right solution is probably to adopt a macro that outputs to std::cerr before throwing/terminating rather than relying on the C++ exception message to show? We have had to do similar tricks with RMM_ASSERT_CUDA_SUCCESS because it can't throw in noexcept functions.

Since this fix is probably necessary to unblock builds (and I need to file similar fixes for other repos), I am leaving this as a follow-up task for the cuVS team to handle whichever way they prefer.

Copy link
Member

Choose a reason for hiding this comment

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

Can you capture this in an issue?

Copy link
Contributor

Choose a reason for hiding this comment

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

@achirkin
Copy link
Contributor

achirkin commented Oct 9, 2025

/merge

@rapids-bot rapids-bot bot merged commit bc58741 into rapidsai:branch-25.12 Oct 9, 2025
86 checks passed
rapids-bot bot pushed a commit that referenced this pull request Oct 9, 2025
A follow-up fix for #1416

Authors:
  - Artem M. Chirkin (https://github.com/achirkin)

Approvers:
  - Divye Gala (https://github.com/divyegala)

URL: #1417
robertmaynard pushed a commit to robertmaynard/cuvs that referenced this pull request Oct 10, 2025
Update for compatibility with rapidsai/rmm#2077.

Authors:
  - Bradley Dice (https://github.com/bdice)

Approvers:
  - Divye Gala (https://github.com/divyegala)

URL: rapidsai#1416
robertmaynard pushed a commit to robertmaynard/cuvs that referenced this pull request Oct 10, 2025
julianmi pushed a commit to julianmi/cuvs that referenced this pull request Oct 13, 2025
Update for compatibility with rapidsai/rmm#2077.

Authors:
  - Bradley Dice (https://github.com/bdice)

Approvers:
  - Divye Gala (https://github.com/divyegala)

URL: rapidsai#1416
julianmi pushed a commit to julianmi/cuvs that referenced this pull request Oct 13, 2025
enp1s0 pushed a commit to enp1s0/cuvs that referenced this pull request Oct 22, 2025
Update for compatibility with rapidsai/rmm#2077.

Authors:
  - Bradley Dice (https://github.com/bdice)

Approvers:
  - Divye Gala (https://github.com/divyegala)

URL: rapidsai#1416
enp1s0 pushed a commit to enp1s0/cuvs that referenced this pull request Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working non-breaking Introduces a non-breaking change

Development

Successfully merging this pull request may close these issues.

3 participants

Comments