| 1 |
# Contributing to AMD SMI # |
| 2 |
|
| 3 |
We welcome contributions to AMD SMI. |
| 4 |
Please follow these details to help ensure your contributions will be successfully accepted. |
| 5 |
|
| 6 |
## Issue Discussion ## |
| 7 |
|
| 8 |
Please use the GitHub Issues tab to notify us of issues. |
| 9 |
|
| 10 |
* Use your best judgement for issue creation. If your issue is already listed, upvote the issue and |
| 11 |
comment or post to provide additional details, such as how you reproduced this issue. |
| 12 |
* If you're not sure if your issue is the same, err on the side of caution and file your issue. |
| 13 |
You can add a comment to include the issue number (and link) for the similar issue. If we evaluate |
| 14 |
your issue as being the same as the existing issue, we'll close the duplicate. |
| 15 |
* If your issue doesn't exist, use the issue template to file a new issue. |
| 16 |
* When filing an issue, be sure to provide as much information as possible, including script output so |
| 17 |
we can collect information about your configuration. This helps reduce the time required to |
| 18 |
reproduce your issue. |
| 19 |
* Check your issue regularly, as we may require additional information to successfully reproduce the |
| 20 |
issue. |
| 21 |
* You may also open an issue to ask questions to the maintainers about whether a proposed change |
| 22 |
meets the acceptance criteria, or to discuss an idea pertaining to the library. |
| 23 |
|
| 24 |
## Acceptance Criteria ## |
| 25 |
|
| 26 |
The goal of AMD SMI project is to provide a simple CLI interface and a library |
| 27 |
for interacting with AMD GPUs. |
| 28 |
|
| 29 |
## Coding Style ## |
| 30 |
|
| 31 |
Please refer to `.clang-format`. It is suggested you use `pre-commit` tool. |
| 32 |
It mostly follows Google C++ formatting with 100 character line limit. |
| 33 |
|
| 34 |
## Pull Request Guidelines ## |
| 35 |
|
| 36 |
When you create a pull request, you should target the default branch. Our |
| 37 |
current default branch is the **amd-staging** branch, which serves as our |
| 38 |
integration branch. |
| 39 |
|
| 40 |
### Deliverables ### |
| 41 |
|
| 42 |
For each new file in repository, |
| 43 |
Please include the licensing header |
| 44 |
|
| 45 |
/* |
| 46 |
* ============================================================================= |
| 47 |
* Copyright (c) 2019-2025 Advanced Micro Devices, Inc. |
| 48 |
* |
| 49 |
* Permission is hereby granted, free of charge, to any person obtaining a copy |
| 50 |
* of this software and associated documentation files (the "Software"), to deal |
| 51 |
* in the Software without restriction, including without limitation the rights |
| 52 |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 53 |
* copies of the Software, and to permit persons to whom the Software is |
| 54 |
* furnished to do so, subject to the following conditions: |
| 55 |
* |
| 56 |
* The above copyright notice and this permission notice shall be included in |
| 57 |
* all copies or substantial portions of the Software. |
| 58 |
* |
| 59 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 60 |
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 61 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 62 |
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 63 |
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 64 |
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 65 |
* THE SOFTWARE. |
| 66 |
* |
| 67 |
*/ |
| 68 |
|
| 69 |
### Process ### |
| 70 |
|
| 71 |
* Reviewers are listed in the CODEOWNERS file |
| 72 |
* Code format guidelines |
| 73 |
|
| 74 |
AMD SMI uses the clang-format tool for formatting code in source files. |
| 75 |
The formatting style is captured in .clang-format which is located at |
| 76 |
the root of AMD SMI. These are different options to follow: |
| 77 |
|
| 78 |
1. Using pre-commit and docker - `pre-commit run` |
| 79 |
1. Using only clang-format - `clang-format -i \<path-to-the-source-file\>` |
| 80 |
|
| 81 |
## References ## |
| 82 |
|
| 83 |
1. [pre-commit](https://github.com/pre-commit/pre-commit) |
| 84 |
1. [clang-format](https://clang.llvm.org/docs/ClangFormat.html) |