Skip to content

Enable performance-* in clang-tidy.#8281

Draft
Jacobfaib wants to merge 14 commits intoNVIDIA:mainfrom
Jacobfaib:jacobf/2026-04-02/clang-tidy-performance
Draft

Enable performance-* in clang-tidy.#8281
Jacobfaib wants to merge 14 commits intoNVIDIA:mainfrom
Jacobfaib:jacobf/2026-04-02/clang-tidy-performance

Conversation

@Jacobfaib
Copy link
Copy Markdown
Contributor

Description

closes

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@Jacobfaib Jacobfaib self-assigned this Apr 2, 2026
@github-project-automation github-project-automation bot moved this to Todo in CCCL Apr 2, 2026
@copy-pr-bot
Copy link
Copy Markdown
Contributor

copy-pr-bot bot commented Apr 2, 2026

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@Jacobfaib
Copy link
Copy Markdown
Contributor Author

/ok to test

@cccl-authenticator-app cccl-authenticator-app bot moved this from Todo to In Progress in CCCL Apr 2, 2026
Copy link
Copy Markdown
Contributor

@davebayer davebayer left a comment

Choose a reason for hiding this comment

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

I'm not sure if we can just slap noexcept to many of these functions, we must be extremely careful, it can lead to program termination..


// print the output
std::cout << "Tuple functor" << std::endl;
std::cout << "Tuple functor" << '\n';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do we actually care about these? I feel like they make it harder to read

Comment on lines 287 to 290
_CCCL_API friend void swap(tuple& __t, tuple& __u) noexcept
{
__t.swap(__u);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think this is correct

Comment on lines 876 to +877
_CCCL_EXEC_CHECK_DISABLE
_CCCL_API friend constexpr void swap(__compressed_movable_box& __x, __compressed_movable_box& __y)
_CCCL_API friend constexpr void swap(__compressed_movable_box& __x, __compressed_movable_box& __y) noexcept
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure whether this is correct, @miscco can you have a look, please

@Jacobfaib
Copy link
Copy Markdown
Contributor Author

I'm not sure if we can just slap noexcept to many of these functions, we must be extremely careful, it can lead to program termination..

For move constructors/assignment operators at least, unless these functions are incredibly carefully implemented to have strong exception guarantees (which it does not appear a lot of them are), program termination is arguably preferable to leaving zombie objects.

Similarly with swap which usually do multi-step swapping of members. In those cases, is it really preferable (unless we are otherwise constrained by the standard) to propagate the exception at the expense of leaving the object half swapped-from?

@Jacobfaib
Copy link
Copy Markdown
Contributor Author

/ok to test

1 similar comment
@Jacobfaib
Copy link
Copy Markdown
Contributor Author

/ok to test

@github-actions

This comment has been minimized.

@Jacobfaib
Copy link
Copy Markdown
Contributor Author

/ok to test

1 similar comment
@Jacobfaib
Copy link
Copy Markdown
Contributor Author

/ok to test

@github-actions

This comment has been minimized.

@Jacobfaib
Copy link
Copy Markdown
Contributor Author

/ok to test

@Jacobfaib Jacobfaib force-pushed the jacobf/2026-04-02/clang-tidy-performance branch from fd30838 to de54eb0 Compare April 3, 2026 16:52
@github-actions

This comment has been minimized.

@Jacobfaib
Copy link
Copy Markdown
Contributor Author

/ok to test

@github-actions

This comment has been minimized.


//! @brief Source access order for copy_bytes
enum class source_access_order
enum class source_access_order : ::cuda::std::uint8_t
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This an ABI break

[[nodiscard]] _CCCL_API _CCCL_FORCEINLINE ::cudaStream_t __invalid_stream() noexcept
{
return reinterpret_cast<::cudaStream_t>(~0ull);
return ::cudaStream_t{};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is not correct, please, revert this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah good catch, I missed the ~ in ~0ull when reading this. Fixed.

@Jacobfaib
Copy link
Copy Markdown
Contributor Author

/ok to test

@Jacobfaib Jacobfaib force-pushed the jacobf/2026-04-02/clang-tidy-performance branch from 762f2d0 to 6f5f8f2 Compare April 3, 2026 20:25
@Jacobfaib
Copy link
Copy Markdown
Contributor Author

/ok to test

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

😬 CI Workflow Results

🟥 Finished in 30m 38s: Pass: 0%/1 | Total: 30m 38s | Max: 30m 38s

See results here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants