Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How to format code

Adam Dickin edited this pageJun 13, 2025 ·9 revisions

Format via make commands

There are now two make commands in the repo that can help with formatting.

make check_format: this will check your format and output an error if something is incorrectly formatted.Does not make changes
make format: this will format any files that are incorrectly formatted automatically.Makes Changes

Format Via External Script

Run this script from the root of MIOpen tree (where the.clang-format file resides) prior committing your edits to avoid formatting failures:

CLANG_FORMAT='clang-format-12'if!command -v$CLANG_FORMAT2>&1 /dev/nullthenecho"${CLANG_FORMAT} is not installed or in your path"exit 1fifind. -iname'*.h' \    -o -iname'*.hpp' \    -o -iname'*.cpp' \    -o -iname'*.h.in' \    -o -iname'*.hpp.in' \    -o -iname'*.cpp.in' \    -o -iname'*.cl' \| grep -v -E'(build/)|(install/)' \| xargs -n 1 -P$(nproc) -I{} -t${CLANG_FORMAT} -style=file {} -i2>/dev/null

The script reformats source files, when necessary. Please do not forget to commit reformatted source files after that.

Note:| grep -v -E '(build/)|(install/)' is used to avoid formatting within./build/ and./install/; please fix this line according to your needs.

Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp