-
Notifications
You must be signed in to change notification settings - Fork 11
Opencl
The OpenCL block allows a user to interface with an OpenCL compatible device, like a GPU. This block handles most of the complications of using the OpenCL API. All the user has to do is feed the block a .cl file with the kernel source and click run! This block makes use of GRAS's special buffer model so memory allocated from OpenCL can be directly written by upstream blocks and read by downstream blocks.
The first step is to install an OpenCL development environment. Now this part is specific to the hardware or GPU in question, so please refer to your vendor's installation or SDK install instructions for OpenCL. I personally found that this step was very easy on an Ubuntu machine with an Nvidia GPU. I simply had to install the nvidia-opencl-dev package and everything was taken care of.
After installing the OpenCL development environment. You should install GRAS according to the build instructions here:
During the cmake configuration step, you should see verbose similar to this:
Found OpenCL: /usr/lib/libOpenCL.so
If the cmake configuration cannot find the OpenCL development files, the development directories for OpenCL headers and libraries can also be manually set via the following variables in cmake:
- OPENCL_LIBRARIES
- OPENCL_INCLUDE_DIRS