You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This applies a set of clang-tidy rules to enforce LLVM coding standards
and some common cleanups.
This PR configures clang-tidy to enforce a swath of rules that comply with and enforce LLVM's coding standards.
Two new CMake options are added:
OFFLOADTEST_USE_CLANG_TIDY - When set to On this runs clang-tidy on non-third-party sources in the offload-test-suite as part of the build process.
OFFLOADTEST_CLANG_TIDY_APPLY_FIX - When set to On passes --fix to clang-tidy to automatically apply fix-its for any issues that have fixes available (Requires OFFLOADTEST_USE_CLANG_TIDY=On).
The enabled warning set is:
clang-diagnostic-* - Clang compiler diagnostics.
llvm-* - LLVM coding standards
misc-* - All miscellaneous rules except:
misc-use-anonymous-namespace, which violates LLVM coding standards which prefers static for functions.
misc-include-cleaner, which did some unholy things to a few source files and caused them to fail to compile.
*misc-non-private-member-variables-in-classes, which conflicts with common patterns in LLVM code.
readability-identifier-naming - Apply LLVM naming conventions
Additionally this PR adds the QualifierAlignment: Left option to the .clang-format configuration because the clang-tidy misc-const-correctness rule adds const to the right of the type which is less common in every codebase ever (Thank's Clang!).
Copy file name to clipboardExpand all lines: README.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,12 @@ compiler to use by passing:
36
36
-DDXC_DIR=<path to folder containing dxc & dxv>
37
37
```
38
38
39
+
## Enabling clang-tidy
40
+
41
+
The offload test suite's code is clang-tidy clean for a limited ruleset.
42
+
If you have clang-tidy installed locally you can enable clang-tidy by adding `-DOFFLOADTEST_USE_CLANG_TIDY=On` to your CMake invocation.
43
+
You can also add `-DOFFLOADTEST_CLANG_TIDY_APPLY_FIX=On` to enable automatically applying the clang-tidy fix-its for any warnings that have automated fixes.
44
+
39
45
# YAML Pipeline Format
40
46
41
47
This framework provides a YAML representation for describing GPU pipelines and buffers. The format is implemented by the `API/Pipeline.{h|cpp}` sources. The following is an example pipeline YAML description:
Copy file name to clipboardExpand all lines: docs/WSL.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,10 +20,10 @@ Alternatively, build and install the DirectX-Headers from the [original repo](ht
20
20
- Fix: Use a newer version of DXC that includes the validator binary `dxv`
21
21
-`double free or corruption (!prev)` may occur when `api-query` and `offloader` exit, which then follows with an infinite stall instead of program termination
22
22
- A workaround is implemented which avoids this issue on normal program exit (i.e., `return 0;` from main)
23
-
- This issue appears to occur whenever `DeviceContext::Devices` from `lib/API/Device.cpp` contains more than one device.
24
-
When `api-query` or `offloader` exit, some memory resources are failing to automatically free themselves.
25
-
Valgrind output suggests the core issue stems from the implementation of `Microsoft::WRL::ComPtr::InternalRelease` in WSL.
23
+
- This issue appears to occur whenever `DeviceContext::Devices` from `lib/API/Device.cpp` contains more than one device.
24
+
When `api-query` or `offloader` exit, some memory resources are failing to automatically free themselves.
25
+
Valgrind output suggests the core issue stems from the implementation of `Microsoft::WRL::ComPtr::InternalRelease` in WSL.
26
26
Manually clearing `DeviceContext::Devices` before a program exit appears to eliminate the issue for the exit
27
-
- An additional workaround that would cover all possible program exit points is to only select one `DXDevice` by editing `lib/API/DX/Device.cpp` to `break;` at the end of the first iteration of the for-loop in the function `InitializeDXDevices()`
27
+
- An additional workaround that would cover all possible program exit points is to only select one `DXDevice` by editing `lib/API/DX/Device.cpp` to `break;` at the end of the first iteration of the for-loop in the function `initializeDXDevices()`
28
28
- Before implementing this workaround, you can run `api-query` to list all GPU devices available. Afterwards, edit the `AdapterIndex` of the for-loop to select the index of the desired GPU
0 commit comments