AMD common language runtimes (CLR)

AMD common language runtimes (CLR)#

CLR contains source codes for AMD’s compute languages runtimes: HIP and OpenCL™. CLR is the part of HIP runtime which is supported on the AMD ROCm platform, it provides a header and runtime library built on top of HIP-Clang compiler. For developers and users, CLR implements HIP runtime APIs including streams, events, and memory APIs, which is a object library that is linked with the application. The source codes for all headers and the library implementation are available on GitHub in the CLR repository.

Project organization#

CLR includes the following source code,

  • hipamd - contains implementation of HIP language on the AMD platform. It is hosted at clr/hipamd.

  • opencl - contains implementation of OpenCL™ on AMD platform. It is hosted at clr/opencl.

  • rocclr - contains common runtime used in HIP and OpenCL™. This is hosted at clr/rocclr.

How to build/install#

Prerequisites#

Please refer to Quick Start Guide in ROCm Docs.

Building CLR requires rocm-hip-libraries meta package, which provides the pre-requisites for CLR.

Linux#

  • Clone this repository

cd clr && mkdir build && cd build
  • For HIP

cmake .. -DCLR_BUILD_HIP=ON -DHIP_COMMON_DIR=$HIP_COMMON_DIR

``HIP_COMMON_DIR`` points to `HIP <https://github.com/ROCm/HIP>`_.
  • For OpenCL™

cmake .. -DCLR_BUILD_OCL=ON
make
make install

Users can also build OCL and HIP at the same time by passing -DCLR_BUILD_HIP=ON -DCLR_BUILD_OCL=ON to configure command.

For detail instructions, please refer to build HIP.

Test#

hip-tests is a separate repository hosted at hip-tests.

To run hip-tests please go to the repository and follow the steps.

Release notes#

HIP provides release notes in CLR change log, which has records of changes in each release.