-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: Add make style target and refactor RAJA with clang-format #1767
base: develop
Are you sure you want to change the base?
Conversation
@rhornung67 and I worked on the settings this morning. Here is what we settled on:
|
c11bf7c
to
9a33df6
Compare
} | ||
); | ||
forall<seq_exec>(seg, [&](typename CONTAINER_T::value_type idx) { | ||
if (conditional(idx)) tcon.push_back(idx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're allowing no-curly braces in single line conditionals?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we may have to move to clang-format 15 according to this: llvm/llvm-project@77e60bc
Note that we also get things like this currently: https://github.com/LLNL/RAJA/pull/1767/files#diff-e97c4ae7afcd5abc30afbee9cca754dcab6a4b2415e6396be367fd2d93103e22R54
static constexpr bool use_host_invoke = dispatcher_use_host_invoke(platform); | ||
using dispatch_policy = ::RAJA::direct_dispatch<T>; | ||
using void_ptr_wrapper = DispatcherVoidPtrWrapper<DispatcherID>; | ||
using dispatch_policy = ::RAJA::direct_dispatch<T>; | ||
using void_ptr_wrapper = DispatcherVoidPtrWrapper<DispatcherID>; | ||
using void_cptr_wrapper = DispatcherVoidConstPtrWrapper<DispatcherID>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting indentation matching choice.
: m_vec(0, aloc), | ||
m_aloc(aloc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess my way of placing commas was not normal. Hopefully clang format understands that it can't pull commas out of ifdefs.
if (loop_storage_size > storage_capacity()) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we decided to put the curly on the line after conditionals.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. John discussed this in a recent meeting.
using Base = reduce::detail::BaseMultiReduce##OP_NAME< \ | ||
DATA<T, RAJA::reduce::OP<T>, tuning>>; \ | ||
using Base::Base; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess something confused its indentation alignment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think clang-format has problems with making nested templates look pretty and readable, in general. That's why we won't be running it in the examples, exercises, and test directories.
3a680ce
to
11ccdbc
Compare
|
||
|
||
|
||
#. The CMake build target `style` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rhornung67 I added docs to this PR if you'd like to review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good with most of the formatting choices. There is still some weirdness involving nested templates, and it's not entirely clear to me when opening curly braces should appear on a new line or at the end of the current line. Hopefully, we can make adjustments as we get used to this.
This PR applies clang-format to the include and src directories of develop