From 9e4d81fcb6282c46ae0566de0147b10323897257 Mon Sep 17 00:00:00 2001 From: Alex Xie Date: Thu, 28 May 2020 21:40:25 -0400 Subject: [PATCH] Add document README.md Change-Id: Ib186c1b55663e397b562ec53fca2d476de0c96b3 --- rocclr/README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 rocclr/README.md diff --git a/rocclr/README.md b/rocclr/README.md new file mode 100644 index 0000000000..a3b213f197 --- /dev/null +++ b/rocclr/README.md @@ -0,0 +1,54 @@ +# ROCclr - Radeon Open Compute Common Language Runtime +ROCclr is a virtual device interface that compute runtimes interact with to different backends such as ROCr or PAL +This abstraction allows runtimes to work on Windows as well as on Linux without much effort. + +## Repository branches +The repository maintains several branches. The branches that are of importance are: + +- master: This is the default branch. + +## Building + +### Prerequisites + +- Install mesa-common-dev +- Either build or install [COMGR](https://github.com/RadeonOpenCompute/ROCm-CompilerSupport), [CLANG](https://github.com/RadeonOpenCompute/llvm-project) and [Device Library](https://github.com/RadeonOpenCompute/ROCm-Device-Libs) + +### Getting the source code + +```bash +git clone https://github.com/ROCm-Developer-Tools/ROCclr.git +git clone -b master-next https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime.git +``` + +### Set the environment variables + +```bash +export ROCclr_DIR="$(readlink -f ROCclr)" +export OPENCL_DIR="$(readlink -f ROCm-OpenCL-Runtime)" +``` + +### Build ROCclr +Here is command to build ROCclr: + +```bash +cd "$ROCclr_DIR" +mkdir -p build; cd build +cmake -DOPENCL_DIR="$OPENCL_DIR" -DCMAKE_INSTALL_PREFIX=/opt/rocm/rocclr .. +make -j$(nproc) +``` + +### Optional steps to build HIP runtime +Enter the directory where git cloned the ROCClr and OpenCL. Run the following commands: + +```bash +git clone -b master-next https://github.com/ROCm-Developer-Tools/HIP.git +export HIP_DIR="$(readlink -f HIP)" +cd "$HIP_DIR" +mkdir -p build; cd build +cmake -DHIP_COMPILER=clang -DHIP_PLATFORM=rocclr -DCMAKE_PREFIX_PATH="$ROCclr_DIR/build" .. +make -j$(nproc) +``` + +### Release build +For release build, add "-DCMAKE_BUILD_TYPE=Release" to the cmake command line.