Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Summary
Priority: ⬇️ Low Change: Other Merge Risk: ⚪ Minimal · up to
|
|
| suite.run("ctx_device.ctx_set_current", [&]() { | ||
| check_cu(cuCtxSetCurrent(ctx), "cuCtxSetCurrent failed"); | ||
| }); | ||
| suite.run("ctx_device.ctx_set_current", [&]() { check_cu(cuCtxSetCurrent(ctx), "cuCtxSetCurrent failed"); }); |
There was a problem hiding this comment.
This is where the line limit should inform the formatter to break the lambda across multiple lines the way it was before. Take a look at the clang-format settings I proposed in the issue ticket.
There was a problem hiding this comment.
This doesn't exceed the line limit of 120. I think what you may really be asking for is to always break inside of the {}?
| for (int i = 0; i < 16; ++i) | ||
| packed_16[i] = &int_ptrs[i]; | ||
| void *packed_16[16]; | ||
| for (int i = 0; i < 16; ++i) packed_16[i] = &int_ptrs[i]; |
There was a problem hiding this comment.
This is another example where the format should break to a new line.
There was a problem hiding this comment.
I think the intention of the rule here is that single-line for loops are on the same line to prevent this kind of confusion:
for (int i = 0; i < 16; ++i)
packed_16[i] = &int_ptrs[i];
packed_16[i] = &int_ptrs[i];
So the fix is to add explicit {}.
rparolin
left a comment
There was a problem hiding this comment.
This largely looks fine, but I would fix the lambda's so they are not all slammed onto a single line.
This adds a pre-commit hook for clang-format, and then updates our C, C++ and CUDA code to follow that convention.
To be familiar for other developers of Python/C extensions, the formatting rules are based on PEP7, but deviating in 2 important ways:
Follow-on
After this is merged, I plan to continue with
clang-tidyas well.Also after this is merged, we should add the merge commit's hash to
.git-blame-ignore-revsso thatgit blamewill skip over it (this is merely reformatting and generally would not be useful to agit blamequery).