2020-05-20 18:06:39 -04:00
|
|
|
# OpenCL™ Compatible Runtime
|
2020-04-10 15:44:40 -04:00
|
|
|
|
2020-05-20 18:06:39 -04:00
|
|
|
- OpenCL 2.0 compatible language runtime
|
|
|
|
|
- Supports offline and in-process/in-memory compilation
|
2020-04-10 15:44:40 -04:00
|
|
|
|
2020-05-20 18:06:39 -04:00
|
|
|
## Getting the source code
|
|
|
|
|
Download the git projects using the following commands:
|
2020-04-10 15:44:40 -04:00
|
|
|
|
2020-05-20 18:06:39 -04:00
|
|
|
```bash
|
|
|
|
|
git clone -b master-next https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime.git
|
|
|
|
|
```
|
2020-04-10 15:44:40 -04:00
|
|
|
|
2020-05-20 18:06:39 -04:00
|
|
|
## Repository branches
|
|
|
|
|
The repository maintains several branches. The branches that are of importance are:
|
|
|
|
|
|
|
|
|
|
- master-next: This is the default branch.
|
|
|
|
|
|
|
|
|
|
## Setup OpenCL
|
|
|
|
|
Copy the amdocl64.icd file to /etc/OpenCL/vendors
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
sudo cp api/opencl/config/amdocl64.icd /etc/OpenCL/vendors/
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Building
|
|
|
|
|
Follow these steps:
|
|
|
|
|
|
|
|
|
|
- Build ROCclr first. Follow the steps in the following link to build ROCclr
|
|
|
|
|
[ROCclr Readme](https://github.com/ROCm-Developer-Tools/ROCclr)
|
|
|
|
|
In this step, $OPENCL_DIR and $ROCclr_DIR are defined.
|
2020-04-10 15:44:40 -04:00
|
|
|
|
2020-05-20 18:06:39 -04:00
|
|
|
- Building OpenCL
|
|
|
|
|
Run these commands:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
cd "$OPENCL_DIR"
|
2020-04-10 15:44:40 -04:00
|
|
|
mkdir -p build; cd build
|
2020-08-06 12:10:36 -04:00
|
|
|
cmake -DUSE_COMGR_LIBRARY=ON -DCMAKE_PREFIX_PATH="$ROCclr_DIR/build;/opt/rocm/" ..
|
2020-05-20 18:06:39 -04:00
|
|
|
make -j$(nproc)
|
|
|
|
|
```
|
|
|
|
|
|
2020-08-06 12:10:36 -04:00
|
|
|
Note: For release build, add "-DCMAKE_BUILD_TYPE=Release" to the cmake command line.
|
2020-04-10 15:44:40 -04:00
|
|
|
|
2020-05-20 18:06:39 -04:00
|
|
|
---
|
|
|
|
|
OpenCL™ is registered Trademark of Apple
|