Skip to content
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

Enabled clang-tidy checks in header files #2338

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

vpirogov
Copy link
Member

@vpirogov vpirogov commented Jan 3, 2025

Our current setup does not run any clang-tidy check on header files. One wrinkle is that we don't want it to touch any header files from third party components embedded in the source code, but current version of clang-tidy does not offer a way to exclude these. There are couple options:

  • Uses ExcludeHeaderFilterRegex option available in clang-tidy >=19.0
  • Move all third party components to separate folder (like /third-party) (in this PR)

With these changes CI will continue to scan source code only to avoid noise. Scan for headers will be available with ONEDNN_USE_CLANG_TIDY=CHECK_ALL option or manual clan-tidy invocation. With that we have 1390 unique warnings for Intel CPU/GPU build.

Related to MFDNN-12943.

@vpirogov vpirogov requested review from a team as code owners January 3, 2025 23:14
@vpirogov vpirogov marked this pull request as draft January 3, 2025 23:14
@github-actions github-actions bot added platform:cpu-x64 Intel64/AMD64 processors. Codeowner: @oneapi-src/onednn-cpu-x64 platform:cpu-aarch64 Codeowner: @oneapi-src/onednn-cpu-aarch64 platform:gpu-intel Codeowner: @oneapi-src/onednn-gpu-intel component:tests Codeowner: @oneapi-src/onednn-arch component:build labels Jan 3, 2025
@theComputeKid
Copy link
Member

We could temporarily add another non blocking check that checks for warnings in the headers, and allow the current one to remain while we fix them.

@theComputeKid
Copy link
Member

Also, 3p should ideally be in a separate folder anyways.

.clang-tidy Outdated Show resolved Hide resolved
@vpirogov vpirogov force-pushed the vpirogov/clang-tidy-fix branch from b3db2ee to c12dde1 Compare January 8, 2025 06:08
@github-actions github-actions bot added the documentation A request to change/fix/improve the documentation. Codeowner: @oneapi-src/onednn-doc label Jan 8, 2025
Copy link
Contributor

@mgouicem mgouicem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all cmake changes, I believe we need to use PROJECT_SOURCE_DIR instead of CMAKE_SOURCE_DIR for cases where oneDNN is build as a cmake subproject.

@vpirogov vpirogov force-pushed the vpirogov/clang-tidy-fix branch 2 times, most recently from b41a9f9 to 9f692ba Compare January 9, 2025 18:50
@github-actions github-actions bot added component:api Codeowner: @oneapi-src/onednn-arch component:graph-api Codeowner: @oneapi-src/onednn-graph labels Jan 9, 2025
@vpirogov vpirogov force-pushed the vpirogov/clang-tidy-fix branch from 9f692ba to d14cbe6 Compare January 9, 2025 19:03
@github-actions github-actions bot removed the component:graph-api Codeowner: @oneapi-src/onednn-graph label Jan 9, 2025
@vpirogov vpirogov force-pushed the vpirogov/clang-tidy-fix branch from d14cbe6 to 29a4258 Compare January 9, 2025 20:44
@vpirogov vpirogov force-pushed the vpirogov/clang-tidy-fix branch from 29a4258 to 122c4d9 Compare January 9, 2025 20:56
@vpirogov vpirogov marked this pull request as ready for review January 9, 2025 21:18
@vpirogov vpirogov requested a review from a team as a code owner January 9, 2025 21:18
@vpirogov
Copy link
Member Author

vpirogov commented Jan 9, 2025

make test

@vpirogov
Copy link
Member Author

vpirogov commented Jan 9, 2025

make test Lightweight_scans

1 similar comment
@vpirogov
Copy link
Member Author

vpirogov commented Jan 9, 2025

make test Lightweight_scans

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:api Codeowner: @oneapi-src/onednn-arch component:build component:tests Codeowner: @oneapi-src/onednn-arch documentation A request to change/fix/improve the documentation. Codeowner: @oneapi-src/onednn-doc platform:cpu-aarch64 Codeowner: @oneapi-src/onednn-cpu-aarch64 platform:cpu-x64 Intel64/AMD64 processors. Codeowner: @oneapi-src/onednn-cpu-x64 platform:gpu-intel Codeowner: @oneapi-src/onednn-gpu-intel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants