Monthly Archives: April 2014

CUDA OpenCL installation

As a part of lab assignment to get familiar with parallel computing, we have to set up either OpenCL or CUDA .
what is CUDA ?
CUDA ( Compute Unified Device Architecture) is a parallel computing platform and programming model that enables dramatic increases in computing performance by harnessing the power of the graphics processing unit (GPU).CUDA is an NVIDIA product and only runs on NVIDIA GPUs.
CUDA supports Windows 7, Windows XP, Windows Vista, Linux and Mac OS (including 32-bit and 64-bit versions).To compile the CUDA C programs, NVIDIA provides nvcc — the NVIDIA CUDA“compiler driver”, which separates out the host code and device code.

CUDA makes use of a GPU for general purpose computing simple and elegant. The developer still programs in the familiar C, C++, Fortran, or an ever expanding list of supported languages, and incorporates extensions of these languages in the form of a few basic keywords.

These keywords let the developer express massive amounts of parallelism and direct the compiler to the portion of the application that maps to the GPU.

A simple example of code is shown below, written first in plain “C” and then in “C with CUDA extensions.”

Sample code - standard C code on the left, C with CUDA extensions on the right.

More information about CUDA can be found on its official website (http://www.nvidia.com/object/cuda_home_new.html)
As CUDA has some higher requirements of which my laptop failed to meet 🙂 (what can i do in that case?? such as my laptop isn’t configured for NVIDIA  graphic card) . so i have to proceed either with OpenCL or  execute the program online.
I choose to proceed with OpenCL. 🙂
so first lets get familiar with OpenCL.

what is OpenCL ?
OpenCL(Open Computing Language) is a framework for writing programs that execute across heterogeneous platforms consisting of central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), field-programmable gate arrays (FPGAs) and other processors. OpenCL includes a language (based on C99) for writing kernels (functions that execute on OpenCL devices), plus application programming interfaces (APIs) that are used to define and then control the platforms. OpenCL provides parallel computing using task-based and data-based parallelism.
More detail can be found at:(https://www.khronos.org/opencl/) & http://en.wikipedia.org/wiki/OpenCL

Now to proceed for installation , download required software from here. Tools or sdk are available for both ubuntu and windows. I installed it for windows. After downloading follow the installation instruction form here .After installation one can either write a c program and use function of OpenCL by importing CL/cl.h and other appropriate header file or can use gui of IDE installed with SDK.
As i was facing some problem after installing OpenCL. so i’ll update the blog very soon regarding the complete  procedute of using OpenCL and then create and run the program on it.

Thankyou