[libcu++] Backport cuda::std::constant_wrapper to C++17 - #10687
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughSummary by CodeRabbit
WalkthroughChangesThe Constant-wrapper compatibility
Possibly related PRs
Suggested reviewers: Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/unary_ops.pass.cpp (1)
121-185: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winsuggestion: Rename the detection templates to the required naming convention. Rename
Tto a PascalCase name such asType. RenameHasPlus,HasMinus,HasBitNot,HasNot,HasBitAnd,HasDeref, and theHasNoexcept*templates to snake_case names.As per coding guidelines, use PascalCase for template parameter names and snake_case for all other symbols.
Source: Coding guidelines
libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/binary_ops.pass.cpp (1)
192-346: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoffsuggestion: collapse the 24 detection templates with a macro.
Each pair differs only by the operator token. One macro removes about 150 lines of copy-paste and keeps the SFINAE key and the
noexceptexpression in sync by construction.+#define DEFINE_BINARY_OP_TRAITS(Name, Op) \ + template <class L, class R, class = void> \ + inline constexpr bool Has##Name = false; \ + template <class L, class R> \ + inline constexpr bool \ + Has##Name<L, R, cuda::std::void_t<decltype(cuda::std::declval<L&>() Op cuda::std::declval<R&>())>> = true; \ + template <class L, class R, class = void> \ + inline constexpr bool HasNoexcept##Name = false; \ + template <class L, class R> \ + inline constexpr bool \ + HasNoexcept##Name<L, R, cuda::std::void_t<decltype(cuda::std::declval<L&>() Op cuda::std::declval<R&>())>> = \ + noexcept(cuda::std::declval<L&>() Op cuda::std::declval<R&>()) + +DEFINE_BINARY_OP_TRAITS(Plus, +); +DEFINE_BINARY_OP_TRAITS(Minus, -); +// ... remaining operators
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 8e16e497-0482-4403-8cc3-71de68ee7573
📒 Files selected for processing (17)
libcudacxx/include/cuda/std/__utility/constant_wrapper.hlibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/adl.compile.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/assign.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/binary_ops.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/call.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/comma.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/comp.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/convert.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/cw.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/general.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/kernel_parameter.array.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/kernel_parameter.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/mem_ptr.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/pseudo_mutators.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/subscript.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/types.compile.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/unary_ops.pass.cpp
💤 Files with no reviewable changes (2)
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/kernel_parameter.pass.cpp
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/kernel_parameter.array.pass.cpp
3f25828 to
5aa6ac6
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
This comment has been minimized.
This comment has been minimized.
5aa6ac6 to
31a7623
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 7d3e900f-fcd1-4f15-a0ad-5fff3e3fd565
📒 Files selected for processing (17)
libcudacxx/include/cuda/std/__utility/constant_wrapper.hlibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/adl.compile.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/assign.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/binary_ops.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/call.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/comma.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/comp.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/convert.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/cw.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/general.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/kernel_parameter.array.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/kernel_parameter.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/mem_ptr.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/pseudo_mutators.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/subscript.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/types.compile.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/unary_ops.pass.cpp
💤 Files with no reviewable changes (2)
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/kernel_parameter.pass.cpp
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/kernel_parameter.array.pass.cpp
🚧 Files skipped from review as they are similar to previous changes (13)
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/adl.compile.pass.cpp
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/mem_ptr.pass.cpp
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/comma.pass.cpp
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/convert.pass.cpp
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/binary_ops.pass.cpp
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/types.compile.pass.cpp
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/unary_ops.pass.cpp
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/cw.pass.cpp
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/call.pass.cpp
- libcudacxx/include/cuda/std/__utility/constant_wrapper.h
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/comp.pass.cpp
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/general.pass.cpp
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/subscript.pass.cpp
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
31a7623 to
216af9c
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 777000c5-7fb0-486e-bb49-80e7b851eb0a
📒 Files selected for processing (17)
libcudacxx/include/cuda/std/__utility/constant_wrapper.hlibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/adl.compile.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/assign.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/binary_ops.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/call.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/comma.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/comp.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/convert.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/cw.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/general.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/kernel_parameter.array.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/kernel_parameter.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/mem_ptr.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/pseudo_mutators.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/subscript.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/types.compile.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/unary_ops.pass.cpp
💤 Files with no reviewable changes (2)
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/kernel_parameter.array.pass.cpp
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/kernel_parameter.pass.cpp
🚧 Files skipped from review as they are similar to previous changes (11)
- libcudacxx/include/cuda/std/__utility/constant_wrapper.h
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/types.compile.pass.cpp
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/mem_ptr.pass.cpp
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/adl.compile.pass.cpp
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/general.pass.cpp
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/unary_ops.pass.cpp
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/binary_ops.pass.cpp
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/call.pass.cpp
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/comma.pass.cpp
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/convert.pass.cpp
- libcudacxx/test/libcudacxx/std/utilities/const.wrap.class/subscript.pass.cpp
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
⏱️ CCCL compile-time benchmark comparison: Public headers compile-time benchResult: 2 regression row(s), 12 improvement row(s) above threshold.
Artifacts: reports and traces TU total compilation
🔴 TU total compilation — Regressions
🟢 TU total compilation — Improvements
Direct file processing
🟢 Direct file processing — Improvements
|
🥳 CI Workflow Results🟩 Finished in 2h 12m: Pass: 100%/115 | Total: 1d 01h | Max: 1h 11m | Hits: 99%/327444See results here. |
No description provided.