Development of OpenCL applications using OpenCL specification. This project utilises the CMake framework to allow cross-platform development.
└── 📁OpenCL-Development
└── 📁include
└── 📁CL # OpenCL headers
└── 📁src
└── 📁HelloWorld
└── CMakeLists.txt
└── HelloWorld.cl
└── HelloWorld.cpp
└── 📁 .. # Other OpenCL applications
└── CMakelists.txt
└── .gitignore
└── CMakeLists.txt
└── README.md
OpenCL is typically packaged with graphic drivers from vendors like AMD, Intel, and NVIDIA. To ensure that OpenCL is properly installed on your system, install the latest graphic drivers on your device.
- For AMD GPUs, download drivers from the AMD website.
- For NVIDIA GPUs, download drivers from the NVIDIA website.
- For Intel GPUs, download drivers from the Intel website.
On Linux machines, it is recommended to install the ocl-icd-opencl-dev package
sudo apt-get install ocl-icd-opencl-devNote
Ensure that CMake is properly installed and added to the PATH environment variable on your machine. See CMake official documentation.
This project is developed using visual studio code IDE. The CMake Tools extension is used extensively within the project development. It is highly recommended that users develop with VS code with this extension.
- Within the root directory of the project, build the project using
CMake. In this example, theDebugconfiguration is used and option to not build2DImageFilterapplication is set (Due to external dependencies required). See Installing FreeImage library on Windows.
mkdir build
cmake -S . -B build -DBUILD_2D_IMAGE_FILTER=OFF
cmake --build build --config Debug- Head to the application and run. For example, the
HelloWorldapplication
cd .\src\HelloWorld\Debug
.\HelloWorld.exe- Within the root directory of the project, build the project using
CMake. The option to not build2DImageFilterapplication is set here as well. See Installing FreeImage library on Linux.
mkdir build
cmake -S . -B build -DBUILD_2D_IMAGE_FILTER=OFF
cd build
make- Head to the application and run. For example, the
HelloWorldapplication
cd src/HelloWorld
./HelloWorld