Skip to content

Latest commit

 

History

History
67 lines (48 loc) · 2.47 KB

File metadata and controls

67 lines (48 loc) · 2.47 KB
layout title
default
Quickstart OpenCL

Overview

ROCm 1.6 introduces big updates to our OpenCL compiler and runtime implementation -- built on top of the ROCm software stack!

This developer release includes the following:

Quickstart Instructions

Here's a simple workflow to get you quickly up and running with OpenCL on ROCm --

Install the ROCm OpenCL implementation (assuming you already have the 'rocm' package installed):
sudo apt-get install rocm-opencl-dev

For a sample OpenCL application, let's use a simple vector-add example from the University of Bristol's very nice "Hands On OpenCL" lectures.

git clone https://github.com/HandsOnOpenCL/Exercises-Solutions.git

cd Exercises-Solutions/Exercises/Exercise02/C

make \
  CCFLAGS="-I$OPENCL_ROOT/include/opencl1.2 -O3 -DDEVICE=CL_DEVICE_TYPE_DEFAULT" \
  LIBS="-L$OPENCL_ROOT/lib/x86_64 -lOpenCL -lm"

./vadd

Not for all your application that supported the AMDGPU SDK for OpenCL to get the Header, rocm-opencl-dev now included the headerfiles.

If your built all your code with the AMDAPPSDK you do not need to download anything else, you can just export environment variable to /opt/rocm/opencl Do not install the AMDAPPSDK 3.0 on ROCm OpenCL it designed for old driver which need headers installed. rocm-opencl-dev package does this for you.

Example 1 for AMDAPPSDKROOT

export AMDAPPSDKROOT=/opt/rocm/opencl 

Example 2 for AMDAPPSDK

export AMDAPPSDK=/opt/rocm/opencl

Where is clinfo?

/opt/rocm/opencl/bin/x86_64/clinfo 
That's it! Super easy.

Related Resources

ROCm Developer website will have more information: http:/rocm.github.io

University of Bristol's "Hands On OpenCL" course webpage: https://handsonopencl.github.io/