/SimpleOpenCLSamples

Simple OpenCL Samples that Build with Khronos Headers and Libs

Primary LanguageC++MIT LicenseMIT

Simple OpenCLTM Samples

This repo contains simple OpenCL samples that demonstrate how to build OpenCL applications using only the Khronos-provided headers and libs. All samples have been tested on Windows and Linux.

Code Structure

README.md               This file
LICENSE                 License information
CMakeLists.txt          Top-level CMakefile
external/               External Projects (headers and libs)
include/                Include Files (OpenCL C++ bindings)
samples/                Samples

How to Build the Samples

The samples require the following external dependencies:

OpenCL Headers:

git clone https://github.com/KhronosGroup/OpenCL-Headers external/OpenCL-Headers

OpenCL ICD Loader:

git clone https://github.com/KhronosGroup/opencl-icd-loader external/opencl-icd-loader

After satisfying the external dependencies create build files using CMake. For example:

mkdir build && cd build
cmake ..

Then, build with the generated build files.

How to Run the Samples

To run the samples, you will need to obtain and install an ICD loader and an OpenCL implementation (ICD) that supports the cl_khr_icd extension.

The ICD loader is likely provided by your operating system or an OpenCL implementation. If desired, you may use the ICD loader that is built along with these OpenCL samples. The OpenCL implementation will likely be provided by your OpenCL device vendor. There are several open source OpenCL implementations as well.

Further Reading

License

These samples are licensed under the MIT License.

Notes:


OpenCL and the OpenCL logo are trademarks of Apple Inc. used by permission by Khronos.

* Other names and brands may be claimed as the property of others.