coding style

  • Shilei asked what coding style should be used for openmp libraries. Currently it is inconsistent an example is device_id
  • Suggestion is to use llvm style coding for new code as it would involve lot of work to retroactively fix all the code.
  • The rewrite of the device rtl should already be following llvm style.

I’d like us to run clang-format with the llvm config across all of libomptarget. Failing that, at least over all of deviceRTL.

Any objections? Any time spent on whitespace in reviews is time badly spent.

There’s also the current_naming_system vs int V difference. If anyone knows a tool that will convert between the two reliably I’d like us to run that too. We may have API stability conflicts there though.

Cheers

      * Shilei asked what coding style should be used for openmp
libraries. Currently it is inconsistent an example is device_id
      * Suggestion is to use llvm style coding for new code as it would
involve lot of work to retroactively fix all the code.
      * The rewrite of the device rtl should already be following llvm
style.

I'd like us to run clang-format with the llvm config across all of
libomptarget. Failing that, at least over all of deviceRTL.

I'm fine doing that for deviceRTL in one swoop, it is changed and moved anyway.

We can decide for the others later.

Any objections? Any time spent on whitespace in reviews is time badly spent.

Yes, and just running clang format on the code makes things way easier :wink:

There's also the current_naming_system vs int V difference. If anyone knows
a tool that will convert between the two reliably I'd like us to run that
too. We may have API stability conflicts there though.

As with the above, deviceRTL can be our first candidate for a change, not really any API stability problem there.

The public APIs have to stay, and I do prefer the style we have for them actually.

Tthe internal ones could be renamed, also helping to make the distinction clear.

Cheers,

Johannes

    
     * Shilei asked what coding style should be used for openmp
    libraries. Currently it is inconsistent an example is device_id
     * Suggestion is to use llvm style coding for new code as it
    would involve lot of work to retroactively fix all the code.
     * The rewrite of the device rtl should already be following
    llvm style.

I'd like us to run clang-format with the llvm config across all of
libomptarget. Failing that, at least over all of deviceRTL.

Any objections? Any time spent on whitespace in reviews is time badly spent.

There's also the current_naming_system vs int V difference. If anyone
knows a tool that will convert between the two reliably I'd like us to
run that too. We may have API stability conflicts there though.

Harbormaster suggests using clang-tidy. (And marks failures in all
reviews as, when different style is used.)

A quick test with the runtime src shows, that clang-tidy does not modify
the variables when uses in defines like KE_TRACE, which are used all
over the runtime code. I could not find a flag to change this behavior.

- Joachim