Now that you've been armed with how convolution actually works, you should be able to imagine how our algorithm might look like. Briefly, we will read an input image assuming that it's going to be in the Windows BMP format.
Next we'll construct the necessary data structures for transporting this image file in the OpenCL device for convolution, and once that's done we'll read and write the data out to another image file, so that we can compare the two.
Optionally, you can choose to implement this using the
clCreateImage(...) APIs provided by OpenCL, and we'll leave it as an exercise for the reader to make the attempt.
In the following sections, you will be shown with an implementation ...