[Backends] use c++20 to improve error messages#1814
Conversation
|
Thanks @tdavidcl for opening this PR! You can do multiple things directly here: Once the workflow completes a message will appear displaying informations related to the run. Also the PR gets automatically reviewed by gemini, you can: |
There was a problem hiding this comment.
Code Review
This pull request introduces a kernel_invocable concept and supporting template infrastructure to enforce type-safe signatures for kernel calls. Feedback indicates that the added test case in kernel_call_tests.cpp contains redundant logic and a type mismatch—specifically, passing a constant buffer to a non-const lambda parameter—which will cause a compilation failure under the new constraints.
| sham::kernel_call( | ||
| dev_sched->get_queue(), | ||
| sham::MultiRef{rho_field_const, uint_field_const}, | ||
| sham::MultiRef{P_field, cs_field}, | ||
| size, | ||
| [](u32 i, const T *__restrict rho, T *__restrict U, T *__restrict P, T *__restrict cs) { | ||
| T r = rho[i]; | ||
| T u = U[i]; | ||
|
|
||
| P[i] = r; | ||
| cs[i] = u; | ||
| }); |
There was a problem hiding this comment.
This sham::kernel_call block is redundant as it performs the same operation as the previous call (lines 52-67). Please refactor this duplicated logic into a helper function or lambda to improve readability and maintainability. Additionally, it contains a type mismatch: uint_field_const is a const buffer providing a const T*, but the lambda signature expects a non-const T*. This mismatch will cause a compilation error with the kernel_invocable concept, preventing the test suite from compiling.
References
- Refactor duplicated logic into a helper function or lambda to improve readability and maintainability.
Workflow reportworkflow report corresponding to commit a71d343 Light CI is enabled. This will only run the basic tests and not the full tests. Pre-commit check reportPre-commit check: ✅ Test pipeline can run. Doxygen diff with
|
No description provided.