Friday, 29 September 2017

Let the parallel hacking begin!

Its a Friday evening and the challenge for the weekends is Image Processing on NVIDIA GPU!

Its a Lab Assignment, yet so interesting that a formal log of the same is a must. Thus this is gonna be it.

Friday, September 29, 2017
The task is implementing a parallel algorithm for image processing on the NVIDIA Tesla K40c GPU. We are going to use CUDA (in C++). Sequential approach is not so complicated, but the challenge is to implement the same in parallel components by invoking kernels for the same in the GPU. Its going to be a 2 day hackathon, so stay tuned for updates!

Saturday, September 30, 2017
CUDA is a bit complicated to begin. A lot of new concepts of grid, blocks, and threads had to be brought into the picture to even get started. Luckily for me, I had been following the parallel computing course on Udacity to get started. Also, there are a few good webinars on CUDA from NVIDIA to get started. The first task is to convert the image into grayscale. This should not be very difficult. A few ideas are coming into the mind. I can simply begin to read out the image as a 2D array using x for width and y for the height. Implementing on the GPU means invoking threadIdx.x and threadIdx.y; Plan is to read one byte at a time (not very efficient, i know) from the array and from each pixel, we can note down the values of RGBA using the inputImage array. I still cannot figure out what exactly is the role of CImg.h file. For the record, its gigantic - something like 45,000 lines of code. (That clearly means, don't go into the details)

No comments:

Post a Comment