diff --git a/projects/hip-tests/README.md b/projects/hip-tests/README.md index 7d3fac4538..066abd52e9 100644 --- a/projects/hip-tests/README.md +++ b/projects/hip-tests/README.md @@ -6,9 +6,9 @@ This repository provides unit tests for [HIP](https://github.com/ROCm/HIP) impl The information presented in this document is for informational purposes only and may contain technical inaccuracies, omissions, and typographical errors. The information contained herein is subject to change and may be rendered inaccurate for many reasons, including but not limited to product and roadmap changes, component and motherboard versionchanges, new model and/or product releases, product differences between differing manufacturers, software changes, BIOS flashes, firmware upgrades, or the like. Any computer system has risks of security vulnerabilities that cannot be completely prevented or mitigated.AMD assumes no obligation to update or otherwise correct or revise this information. However, AMD reserves the right to revise this information and to make changes from time to time to the content hereof without obligation of AMD to notify any person of such revisions or changes.THIS INFORMATION IS PROVIDED ‘AS IS.” AMD MAKES NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE CONTENTS HEREOF AND ASSUMES NO RESPONSIBILITY FOR ANY INACCURACIES, ERRORS, OR OMISSIONS THAT MAY APPEAR IN THIS INFORMATION. AMD SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR ANY PARTICULAR PURPOSE. IN NO EVENT WILL AMD BE LIABLE TO ANY PERSON FOR ANY RELIANCE, DIRECT, INDIRECT, SPECIAL, OR OTHER CONSEQUENTIAL DAMAGES ARISING FROM THE USE OF ANY INFORMATION CONTAINED HEREIN, EVEN IF AMD IS EXPRESSLY ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. AMD, the AMD Arrow logo, and combinations thereof are trademarks of Advanced Micro Devices, Inc. Other product names used in this publication are for identification purposes only and may be trademarks of their respective companies. -©2022 Advanced Micro Devices, Inc. All Rights Reserved. +©2025 Advanced Micro Devices, Inc. All Rights Reserved. -## Repository branches: +## Repository branches The hip-tests repository maintains several branches. The branches that are of importance are: @@ -16,46 +16,45 @@ The hip-tests repository maintains several branches. The branches that are of im * Develop branch: This is the default branch, on which the new features are still under development and visible. While this maybe of interest to many, it should be noted that this branch and the features under development might not be stable. * Release branches. These are branches corresponding to each ROCM release, listed with release tags, such as rocm-5.4, etc. -## Release tagging: +## Release tagging hip-tests releases are typically naming convention for each ROCM release to help differentiate them. * rocm x.yy: These are the stable releases based on the ROCM release. - This type of release is typically made once a month.* + This type of release is typically made once a month. +## Build HIP Catch tests -### Build HIP catch tests +For building HIP from source, please check instructions on the [HIP page](https://rocm.docs.amd.com/projects/HIP/en/latest/install/build.html). -For building HIP from sources, please check instructions on [HIP page](https://rocm.docs.amd.com/projects/HIP/en/latest/install/build.html) +HIP catch tests can be built via the following instructions: -HIP catch tests can be built via the following instructions, - -Clone the hip-tests source code from the repository, with definition of branch. The default branch is `develop`, as an example, -``` -git clone -b develop https://github.com/ROCm/hip-tests.git -export HIP_TESTS_DIR="$(readlink -f hip-tests)" +1 .Clone the hip-tests source code from the repository, with definition of branch. The default branch is `develop`, as an example, +```bash +$ git clone -b develop https://github.com/ROCm/hip-tests.git +$ export HIP_TESTS_DIR="$(readlink -f hip-tests)" ``` -Build the catch tests -``` -cd "$HIP_TESTS_DIR" -mkdir -p build; cd build -cmake ../catch/ -DHIP_PLATFORM=amd -make -j$(nproc) build_tests -ctest # run tests +2. Build the catch tests +```bash +$ cd "$HIP_TESTS_DIR" +$ mkdir -p build; cd build +$ cmake ../catch/ -DHIP_PLATFORM=amd +$ make -j$(nproc) build_tests +$ ctest # run tests ``` -HIP catch tests are built under the folder $HIP_TESTS_DIR/build. +HIP catch tests are built under the folder `$HIP_TESTS_DIR/build`. ### Build HIP Catch2 standalone test HIP Catch2 supports building standalone tests, for example, -``` -hipcc $HIP_TESTS_DIR/catch/unit/memory/hipPointerGetAttributes.cc -I ./catch/include ./catch/hipTestMain/standalone_main.cc -I ./catch/external/Catch2 -o hipPointerGetAttributes -./hipPointerGetAttributes +```bash +$ hipcc $HIP_TESTS_DIR/catch/unit/memory/hipPointerGetAttributes.cc -I ./catch/include ./catch/hipTestMain/standalone_main.cc -I ./catch/external/Catch2 -o hipPointerGetAttributes +$ ./hipPointerGetAttributes ``` ### Building with address sanitizer -To build catch tests with Address Sanitizer options, use the cmake option `-DENABLE_ADDRESS_SANITIZER=ON` +To build catch tests with Address Sanitizer options, use the cmake option `-DENABLE_ADDRESS_SANITIZER=ON`. diff --git a/projects/hip-tests/samples/README.md b/projects/hip-tests/samples/README.md index dcf178c883..29a8b8e619 100644 --- a/projects/hip-tests/samples/README.md +++ b/projects/hip-tests/samples/README.md @@ -1,44 +1,43 @@ -Build procedure +Building +--- The CMakeLists.txt at hip-tests/samples folder can be used for building and packaging samples. -CMakeLists.txt can support shared and static libs of hip-rocclr runtime. -The same steps can be followed for both. +CMakeLists.txt can support shared and static libs of hip-rocclr runtime. The same steps can be followed for both. -1. To build a specific sample (e.g. 0_Intro/bit_extract) run .. +To build a specific sample (e.g. `0_Intro/bit_extract`) run: +```bash +$ cd samples/0_Intro/bit_extract +$ mkdir -p build && cd build +$ cmake .. +$ make all +``` -cd samples/0_Intro/bit_extract +To build all samples together run: +```bash +$ cd hip-tests +$ mkdir -p build && cd build +$ rm -rf * # (to clear up) +$ cmake ../samples +$ make build_samples +``` -mkdir -p build && cd build +In order to build specific samples (Intro, Utils or Cookbook) run: +```bash +$ make build_intro +$ make build_utils +$ make build_cookbook +``` -cmake .. +Note that if you want debug version, add `-DCMAKE_BUILD_TYPE=Debug` in cmake cmd. -make all +3. To package samples and generate packages. From hip-tests/build: +```bash +$ cmake ../samples +$ make package_samples +``` -2. To build all samples together run .. +Note +--- -cd hip-tests - -mkdir -p build && cd build - -rm -rf * (to clear up) - -cmake ../samples - -make build_samples - -In order to build specific samples (Intro, Utils or Cookbook) run .. - -make build_intro -make build_utils -make build_cookbook - -Note that if you want debug version, add "-DCMAKE_BUILD_TYPE=Debug" in cmake cmd. - -3. To package samples and generate packages. From hip-tests/build - -cmake ../samples - -make package_samples - -## Note: sample 2_Cookbook/22_cmake_hip_lang is current not included in toplevel cmake. To build this sample from toplevel cmake, uncomment Line 43 inside samples/2_Cookbook/CMakeLists.txt. +Sample `2_Cookbook/22_cmake_hip_lang` is current not included in toplevel cmake. To build this sample from toplevel cmake, uncomment Line 43 inside `samples/2_Cookbook/CMakeLists.txt`.