Skip to content

Conversation

@davebayer
Copy link
Contributor

This PR specializes std::formatter for cuda::arch_id and cuda::compute_capability

@davebayer davebayer requested a review from a team as a code owner January 23, 2026 14:09
@davebayer davebayer requested a review from ericniebler January 23, 2026 14:09
@github-project-automation github-project-automation bot moved this to Todo in CCCL Jan 23, 2026
@cccl-authenticator-app cccl-authenticator-app bot moved this from Todo to In Review in CCCL Jan 23, 2026
assert(std::format(TEST_STRLIT(C, "{}"), cuda::arch_id::sm_103a) == TEST_STRLIT(C, "103a"));
assert(std::format(TEST_STRLIT(C, "{}"), cuda::arch_id::sm_110a) == TEST_STRLIT(C, "110a"));
assert(std::format(TEST_STRLIT(C, "{}"), cuda::arch_id::sm_120a) == TEST_STRLIT(C, "120a"));
assert(std::format(TEST_STRLIT(C, "{}"), cuda::arch_id::sm_121a) == TEST_STRLIT(C, "121a"));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bernhardmgruber is formatting cuda::arch_id as "NM[a]" what you want? We could make it "sm_NM[a]", too.

Or alternatively, we can make it part of the formatting options as std::format("{:p}", arch_id) no add the sm_ prefix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Another option would be:

  • b for binary architecture, the output would look as sm_NM[a]
  • v for virtual architecture, the output would look as compute_NM[a]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe it would be better to keep it as is, you can always prepend the right prefix that works for your compiler.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would love if it was just spelled like the enum, so sm_103a for example :)

@github-actions
Copy link
Contributor

😬 CI Workflow Results

🟥 Finished in 1h 59m: Pass: 97%/84 | Total: 1d 12h | Max: 1h 59m | Hits: 95%/199098

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 Review

Development

Successfully merging this pull request may close these issues.

2 participants