-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Starting to fix linting errors in markdown files.
- Loading branch information
1 parent
3a8b0db
commit e8f5ce3
Showing
20 changed files
with
451 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
MD013: false | ||
MD024: | ||
siblings_only: true | ||
MD026: | ||
punctuation: ".,;:!" | ||
MD029: | ||
style: ordered | ||
MD033: false | ||
MD034: false | ||
MD041: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,54 @@ | ||
# Applications Examples | ||
|
||
## Summary | ||
|
||
The examples in this subdirectory showcase several GPU-implementations of finance, computer science, physics, etc. models or algorithms that additionally offer a command line application. The examples are build on Linux for the ROCm (AMD GPU) backend. Some examples additionally support the CUDA (NVIDIA GPU) backend. | ||
|
||
## Prerequisites | ||
|
||
### Linux | ||
|
||
- [CMake](https://cmake.org/download/) (at least version 3.21) | ||
- OR GNU Make - available via the distribution's package manager | ||
- [ROCm](https://docs.amd.com/bundle/ROCm-Installation-Guide-v5.1.3/page/Overview_of_ROCm_Installation_Methods.html) (at least version 5.x.x) | ||
|
||
### Windows | ||
|
||
- [Visual Studio](https://visualstudio.microsoft.com/) 2019 or 2022 with the "Desktop Development with C++" workload | ||
- ROCm toolchain for Windows (No public release yet) | ||
- The Visual Studio ROCm extension needs to be installed to build with the solution files. | ||
- The Visual Studio ROCm extension needs to be installed to build with the solution files. | ||
- [CMake](https://cmake.org/download/) (optional, to build with CMake. Requires at least version 3.21) | ||
- [Ninja](https://ninja-build.org/) (optional, to build with CMake) | ||
|
||
## Building | ||
|
||
### Linux | ||
|
||
Make sure that the dependencies are installed, or use one of the [provided Dockerfiles](../../Dockerfiles/) to build and run the examples in a containerized environment. | ||
|
||
#### Using CMake | ||
|
||
All examples in the `Applications` subdirectory can either be built by a single CMake project or be built independently. | ||
|
||
- `$ cd Libraries/Applications` | ||
- `$ cmake -S . -B build` (on ROCm) or `$ cmake -S . -B build -D GPU_RUNTIME=CUDA` (on CUDA, when supported) | ||
- `$ cmake --build build` | ||
|
||
#### Using Make | ||
|
||
All examples can be built by a single invocation to Make or be built independently. | ||
|
||
- `$ cd Libraries/Applications` | ||
- `$ make` (on ROCm) or `$ make GPU_RUNTIME=CUDA` (on CUDA, when supported) | ||
|
||
### Windows | ||
|
||
#### Visual Studio | ||
|
||
Visual Studio solution files are available for the individual examples. To build all supported HIP runtime examples open the top level solution file [ROCm-Examples-VS2019.sln](../../ROCm-Examples-VS2019.sln) and filter for Applications. | ||
|
||
For more detailed build instructions refer to the top level [README.md](../../README.md#visual-studio). | ||
|
||
#### CMake | ||
|
||
All examples in the `Applications` subdirectory can either be built by a single CMake project or be built independently. For build instructions refer to the top-level [README.md](../../README.md#cmake-2). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,61 @@ | ||
# Guidelines | ||
To keep the style of the examples consistent, please follow the following guidelines when implementing your example. | ||
|
||
To keep the style of the examples consistent, please follow the following | ||
guidelines when implementing your example. | ||
|
||
## Make/CMake | ||
Each example has to at least support `CMake` as build system. The simpler examples should also support `Make`.<br/> | ||
Every example has to be able to be built separately from the others, but also has to be added to the top-level build scripts. | ||
|
||
Each example has to at least support `CMake` as build system. | ||
The simpler examples should also support `Make`. <br/> | ||
Every example has to be able to be built separately from the others, | ||
but also has to be added to the top-level build scripts. | ||
|
||
## Code Format | ||
The formatting rules of the examples are enforced by `clang-format` using the `.clang-format` file in the top-level directory. | ||
|
||
The formatting rules of the examples are enforced by `clang-format` using the | ||
`.clang-format` file in the top-level directory. | ||
|
||
## Variable Naming Conventions | ||
- Use `lower_snake_case` style to name variables and functions (e.g. block_size, multiply_kernel and multiply_host). | ||
|
||
- Use `lower_snake_case` style to name variables and functions (e.g. block_size, | ||
multiply_kernel and multiply_host). | ||
- Use `PascalCase` for `class`, `struct`, `enum` and template argument definitions. | ||
|
||
## File and Directory Naming Conventions | ||
|
||
- Top-level directories use `PascalCase`. | ||
- The directories in Libraries/ should use the exact name of the library they represent, including casing. If any directory does not represent a library, it should named in `camelCase`. | ||
- The directories in Libraries/ should use the exact name of the library they | ||
represent, including casing. If any directory does not represent a library, it | ||
should named in `camelCase`. | ||
- Directories for individual examples use `snake_case`. | ||
- Files generally use `snake_case`, with the exception of files for which an existing convention already applies (`README.md`, `LICENSE.md`, `CMakeLists.txt`, etc). | ||
- Example binaries should be prefixed with the library name of the binary, so that there are no conflicts between libraries (e.g. `hipcub_device_sum` and `rocprim_device_sum`). | ||
- Files generally use `snake_case`, with the exception of files for which an | ||
existing convention already applies (`README.md`, `LICENSE.md`, `CMakeLists.txt`, | ||
etc). | ||
- Example binaries should be prefixed with the library name of the binary, so | ||
hat there are no conflicts between libraries (e.g. `hipcub_device_sum` and | ||
`rocprim_device_sum`). | ||
|
||
## Utilities | ||
Utility-functions (printing vectors, etc) and common error-handling code, that is used by all examples, should be moved to the common utility-header [example_utils.hpp](../Common/example_utils.hpp). | ||
|
||
Utility-functions (printing vectors, etc) and common error-handling code, that | ||
is used by all examples, should be moved to the common utility-header | ||
[example_utils.hpp](../Common/example_utils.hpp). | ||
|
||
## Error Handling | ||
Error checking and handling should be applied where appropriate, e.g. when handling user input. `HIP_CHECK` should be used whenever possible. Exceptions should only be used if the complexity of the program requires it.<br/> | ||
In most cases printing an explanation to stderr and terminating the program with an error code, as specified in the common header, is sufficient. | ||
|
||
Error checking and handling should be applied where appropriate, e.g. when | ||
handling user input. `HIP_CHECK` should be used whenever possible. Exceptions | ||
should only be used if the complexity of the program requires it.<br/> | ||
In most cases printing an explanation to stderr and terminating the program with | ||
an error code, as specified in the common header, is sufficient. | ||
|
||
## Printing Intermediate Results | ||
Results should be printed when they are helpful for the understanding and showcasing the example. However the output shouldn't be overwhelming, printing a vector with hundreds of entries is usually not useful. | ||
|
||
Results should be printed when they are helpful for the understanding and | ||
showcasing the example. However the output shouldn't be overwhelming, printing | ||
a vector with hundreds of entries is usually not useful. | ||
|
||
## .gitignore | ||
A .gitignore file is required in every example subdirectory to exclude the binary generated when using Make. | ||
|
||
A .gitignore file is required in every example subdirectory to exclude the | ||
binary generated when using Make. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,56 @@ | ||
# HIP-Basic Examples | ||
|
||
## Summary | ||
|
||
The examples in this subdirectory showcase the functionality of the HIP runtime. The examples build on Linux for the ROCm (AMD GPU) backend. Some examples additionally support Windows, some examples additionally support the CUDA (NVIDIA GPU) backend. | ||
|
||
## Prerequisites | ||
|
||
### Linux | ||
|
||
- [CMake](https://cmake.org/download/) (at least version 3.21) | ||
- OR GNU Make - available via the distribution's package manager | ||
- [ROCm](https://docs.amd.com/bundle/ROCm-Installation-Guide-v5.1.3/page/Overview_of_ROCm_Installation_Methods.html) (at least version 5.x.x) | ||
|
||
### Windows | ||
|
||
- [Visual Studio](https://visualstudio.microsoft.com/) 2019 or 2022 with the "Desktop Development with C++" workload | ||
- ROCm toolchain for Windows (No public release yet) | ||
- The Visual Studio ROCm extension needs to be installed to build with the solution files. | ||
- The Visual Studio ROCm extension needs to be installed to build with the solution files. | ||
- [CMake](https://cmake.org/download/) (optional, to build with CMake. Requires at least version 3.21) | ||
- [Ninja](https://ninja-build.org/) (optional, to build with CMake) | ||
|
||
## Building | ||
|
||
### Linux | ||
|
||
Make sure that the dependencies are installed, or use one of the [provided Dockerfiles](../../Dockerfiles/) to build and run the examples in a containerized environment. | ||
|
||
#### Using CMake | ||
|
||
All examples in the `HIP-Basic` subdirectory can either be built by a single CMake project or be built independently. | ||
|
||
- `$ cd Libraries/HIP-Basic` | ||
- `$ cmake -S . -B build` (on ROCm) or `$ cmake -S . -B build -D GPU_RUNTIME=CUDA` (on CUDA, when supported) | ||
- `$ cmake --build build` | ||
|
||
#### Using Make | ||
|
||
All examples can be built by a single invocation to Make or be built independently. | ||
|
||
- `$ cd Libraries/HIP-Basic` | ||
- `$ make` (on ROCm) or `$ make GPU_RUNTIME=CUDA` (on CUDA, when supported) | ||
|
||
### Windows | ||
|
||
Not all HIP runtime examples support building on Windows. See the README file in the directory of the example for more details. | ||
|
||
#### Visual Studio | ||
|
||
Visual Studio solution files are available for the individual examples. To build all supported HIP runtime examples open the top level solution file [ROCm-Examples-VS2019.sln](../../ROCm-Examples-VS2019.sln) and filter for HIP-Basic. | ||
|
||
For more detailed build instructions refer to the top level [README.md](../../README.md#visual-studio). | ||
|
||
#### CMake | ||
|
||
All examples in the `HIP-Basic` subdirectory can either be built by a single CMake project or be built independently. For build instructions refer to the top-level [README.md](../../README.md#cmake-2). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.