The examples in this subdirectory are the code samples found in the HIP documentation. They are primarily intended for testing and continuous integration (CI) purposes but also serve as standalone examples. Most of them build for both Linux and Windows.
- CMake (at least version 3.21)
- OR GNU Make - available via the distribution's package manager
- ROCm (at least version 6.x.x)
- Visual Studio 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.
- CMake (optional, to build with CMake. Requires at least version 3.21)
- Ninja (optional, to build with CMake)
Make sure that the dependencies are installed, or use one of the provided Dockerfiles to build and run the examples in a containerized environment.
All examples in the HIP-Doc subdirectory can either be built by a single CMake project or be built
independently.
$ cd HIP-Doc$ cmake -S . -B build(on ROCm) or$ cmake -S . -B build -D ROCM_EXAMPLES_GPU_LANGUAGE=CUDA(on CUDA)$ cmake --build build
All examples can be built by a single invocation to Make or be built independently.
$ cd HIP-Doc$ make(on ROCm) or$ make ROCM_EXAMPLES_GPU_LANGUAGE=CUDA(on CUDA)
Make sure that you have the current version of the HIP SDK installed and that the environment variable HIP_SDK is
pointing to HIP SDK's installation directory.
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-VS2022.sln and filter for HIP-Doc.
For more detailed build instructions refer to the top level README.md.
All examples in the HIP-Doc subdirectory can either be built by a single CMake project or be built
independently. For build instructions refer to the top-level README.md.